问:
Conversion of Scala class to javascript using jscala
I am a newbie to Scala and JScala. I have a Scala class with globals defined as val test = Set("testglobal"). My code to convert this to javascript is as following:

```<code>object Convertscalatojs {
  def converttoscala() {
    @Javascript class TrafficSource {
      val test = Set("test")
      //
      val test1="testvar"
    }

    val js = TrafficSource.jscala.javascript
    js.eval()
    println(js.asString)
  }

  def main(args: Array[String]) {
    converttoscala()
  }
}
</code>```

I am getting an error as:

```<code>Error:(14, 6) Unsupported syntax: scala.this.Predef.Set.apply[String].
    @Javascript class TrafficSource {
</code>```

How do I convert the globals to JS code?

答:
I believe that the @JavaScript annotation just means that a constructor for an equivalent type will be available in javascript code blocks. Such as the following:

@Javascript class StaticGlobalsReference {
    val test = Set("test")
}
```

<p>Which can then be used in code blocks:</p>

<pre class="lang-scala prettyprint-override"><code>def main(args: Array[String]) {
    val js = javascript {
        val globals = new StaticGlobalsReference();
        println(globals.test);
    }
    println(js.asString);
}
</code>```

Reference: http://jscala.org/

Body:
I am a newbie to Scala and JScala. I have a Scala class with globals defined as val test = Set("testglobal"). My code to convert this to javascript is as following:

object Convertscalatojs {
  def converttoscala() {
    @Javascript class TrafficSource {
      val test = Set("test")
      //
      val test1="testvar"
    }

    val js = TrafficSource.jscala.javascript
    js.eval()
    println(js.asString)
  }

  def main(args: Array[String]) {
    converttoscala()
  }
}

I am getting an error as:

Error:(14, 6) Unsupported syntax: scala.this.Predef.Set.apply[String].
    @Javascript class TrafficSource {

How do I convert the globals to JS code?

Body:
I believe that the @JavaScript annotation just means that a constructor for an equivalent type will be available in javascript code blocks. Such as the following:

@Javascript class StaticGlobalsReference {
    val test = Set("test")
}

Which can then be used in code blocks:

def main(args: Array[String]) {
    val js = javascript {
        val globals = new StaticGlobalsReference();
        println(globals.test);
    }
    println(js.asString);
}

Reference: http://jscala.org/


来源: stackexchange

问:
Distinct Unique Keys with JSON Server
I am using json-server from typicode, it works but is it possible to get requested key values as an array?

For example I have

```<code>{
    "users": [
        {
            "name": "ABC",
            "job": "Engineer",
            "age" : 28
        },
        {
            "name": "XYZ",
            "job": "Product Manager",
            "age" : 32
        },
        {
            "name": "ASD",
            "job": "HR Manager",
            "age" : 325
        }
    ]
}
</code>```

I want to get a array of jobs

```<code>["Engineer", "Product Manager", "Human Resource"]
</code>```

答:
You can use map() to loop through the users and create a new array with the jobs:

let obj = {
    "users": [
        {
            "name": "ABC",
            "job": "Engineer",
            "age" : 28
        },
        {
            "name": "XYZ",
            "job": "Product Manager",
            "age" : 32
        },
        {
            "name": "ASD",
            "job": "HR Manager",
            "age" : 325
        }
    ]
}

let arr = obj.users.map(user => user.job);

console.log(arr);```

ContentLicense: CC BY-SA 4.0

Title: Distinct Unique Keys with JSON Server

Body:
I am using json-server from typicode, it works but is it possible to get requested key values as an array?

For example I have

{
    "users": [
        {
            "name": "ABC",
            "job": "Engineer",
            "age" : 28
        },
        {
            "name": "XYZ",
            "job": "Product Manager",
            "age" : 32
        },
        {
            "name": "ASD",
            "job": "HR Manager",
            "age" : 325
        }
    ]
}

I want to get a array of jobs

["Engineer", "Product Manager", "Human Resource"]


问:
How to build Visual Studio solution with .NET Framework and .NET Standard projects?
I have a solution containing .NET Framework project - WPF application, frontend - and multiple .NET Standard projects - backend. I need to build the .NET Framework project, but to do it, I must build the .NET Standard projects, because the .NET Framework project references the .NET Standard projects.

Visual Studio Build and MSBuild throw errors like "'System' namespace doesn't exist" in the .NET Standard projects.

Net Core build fails to find some assemblies in certain Nuget packages, namely Prism and DevExpress.

How should I build .NET Framework WPF app that is referencing .NET Standard in Azure DevOps?

答:
Thanks Levi Lu for his reply. It is the solution. Reposting it here:

"
I just used the Visual Studio Build task to build the solution. If you see above error, you can try setting the restoreNugetPackages: true of Visual Studio Build task.
"


问:
Where to put the purge.php file in varnish server?
I am using two application load balancers that are routing requests to 4 backend varnish servers. I got answers to configure the PHP file to purge the cache but I have no idea where to put it and how to execute.</p>

答:
For which type of PHP application are you trying to configure cache purging?

A custom application?

WordPress?

Drupal?

Magento?

Some other CMS or framework?

If you're using an existing platform, CMS, or framework, the documentation will probably state how to configure purging.

Varnish Configuration

Of course, the Varnish VCL code should also be tuned to process purges.

You can find more information about purging (and banning) in Varnish on http://varnish-cache.org/docs/6.0/users-guide/purging.html

Here are the questions you should ask yourself regarding purging. Maybe the documentation of your CMS or framework will answer these as well?

Are you trying to purge individual URLs?

Does your code have pattern matching in play to invalidate multiple URLs at once (uses bans in VCL)

If pattern matching is used, are you sending the invalidation pattern via an HTTP request header?

Does your invalidation code use the URL to identify objects in cache, or does it rely on tagged content?

Are you restricting access to the purging mechanism based on IP address or subnet. If so, please configure an ACL in VCL.

Many WordPress plugins rely on individual URL purging. Other WordPress plugins use bans through request header patterns.

Drupal uses bans, but has a system in place that tags content. The ban patterns don't match URLs, but tags.

Magento uses bans.

Conclusion

If you use a CMS or framework, the purging strategy is set in advance. It's just a matter of configuring your app and making sure the VCL can handle it.

If you have custom code, you have a choice, and you can implement purging or banning.

Please have a look at the user guide section about purging I mentioned above. It should help you understand the underlying mechanism.


问:
View file info from a folder into DataGrid
I want to view file info from a folder into datagrid.

MainWindow.xaml:

```<code><TabItem Header="Happy" Width="60" Height="30">
    <Grid Margin="0,0,0,0">
        <DataGrid x:Name="MusicTabHappy" AutoGenerateColumns="False" Margin="10">
            <DataGrid.Columns>
                <DataGridTextColumn Header="File Name"/>
                <DataGridTextColumn Header="Time"/>
                <DataGridTextColumn Header="Format"/>
                <DataGridTextColumn Header="Size"/>
                <DataGridTextColumn Header="*"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</TabItem>
</code>```

MainWindow.xaml.vb:

```<code>Public Class MusicLibrary
    Private Sub MusicTabHappy_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles MusicTabHappy.SelectionChanged
    (###)
    End Sub

    Public Shared Function GetFileName(path As String) As String
        Dim filename As String = "C:\User\Desktop\A"
        result = path.GetFileName(filename)
        (###)
    End Function
End Class
</code>```

Please help me, thank you so much.

答:
You could use the Directory.GetFiles and FileInfo APIs to get information about the files. The below sample sets the ItemsSource of the DataGrid to an IEnumerable(Of FileInfo):

```<code>MusicTabHappy.ItemsSource = System.IO.Directory.GetFiles("C:\Temp").Select(Function(fileName)
                                                                               Return New FileInfo(fileName)
                                                                           End Function).ToArray()
</code>```

You would then bind to the properties of the FileInfo in your XAML markup:

```<code><DataGrid x:Name="MusicTabHappy" AutoGenerateColumns="False" Margin="10">
    <DataGrid.Columns>
        <DataGridTextColumn Header="File Name" Binding="{Binding Name}"/>
        <DataGridTextColumn Header="Time" Binding="{Binding LastAccessTime}"/>
        <DataGridTextColumn Header="Format" Binding="{Binding Extension}"/>
        <DataGridTextColumn Header="Size" Binding="{Binding Length}"/>
        <DataGridTextColumn Header="*" Width="*"/>
    </DataGrid.Columns>
</DataGrid>
</code>```

Body:
I want to view file info from a folder into datagrid.

MainWindow.xaml:

<TabItem Header="Happy" Width="60" Height="30">
    <Grid Margin="0,0,0,0">
        <DataGrid x:Name="MusicTabHappy" AutoGenerateColumns="False" Margin="10">
            <DataGrid.Columns>
                <DataGridTextColumn Header="File Name"/>
                <DataGridTextColumn Header="Time"/>
                <DataGridTextColumn Header="Format"/>
                <DataGridTextColumn Header="Size"/>
                <DataGridTextColumn Header="*"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</TabItem>

MainWindow.xaml.vb:

Public Class MusicLibrary
    Private Sub MusicTabHappy_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles MusicTabHappy.SelectionChanged
    (###)
    End Sub

    Public Shared Function GetFileName(path As String) As String
        Dim filename As String = "C:\User\Desktop\A"
        result = path.GetFileName(filename)
        (###)
    End Function
End Class

Please help me, thank you so much.

Body:
You could use the Directory.GetFiles and FileInfo APIs to get information about the files. The below sample sets the ItemsSource of the DataGrid to an IEnumerable(Of FileInfo):

MusicTabHappy.ItemsSource = System.IO.Directory.GetFiles("C:\Temp").Select(Function(fileName)
                                                                               Return New FileInfo(fileName)
                                                                           End Function).ToArray()

You would then bind to the properties of the FileInfo in your XAML markup:

<DataGrid x:Name="MusicTabHappy" AutoGenerateColumns="False" Margin="10">
    <DataGrid.Columns>
        <DataGridTextColumn Header="File Name" Binding="{Binding Name}"/>
        <DataGridTextColumn Header="Time" Binding="{Binding LastAccessTime}"/>
        <DataGridTextColumn Header="Format" Binding="{Binding Extension}"/>
        <DataGridTextColumn Header="Size" Binding="{Binding Length}"/>
        <DataGridTextColumn Header="*" Width="*"/>
    </DataGrid.Columns>
</DataGrid>


问:
Provide HTML output for paragraph
I am having an issue when I pull data into the WordPress website.

I use the code snippet below to print the category description.

```<code><p> {{ currentTax.activeTerm.description}} </p>
</code>```

It works fine, it prints description but it is not HTML output. Links, bold or other tags I enter in category don't show in the output.

For example it prints like this

This is description of the car category. In order to check cars check this link  Cars

It doesn't display a link, it shows text. Is there any way to quickly solve this issue?

答: refer dangerouslysetinnerhtml or use iframe to load the content. But I prefer to use iframe</p>

Title: Provide HTML output for paragraph

Body:
I am having an issue when I pull data into the WordPress website.

I use the code snippet below to print the category description.

 {{ currentTax.activeTerm.description}}

It works fine, it prints description but it is not HTML output. Links, bold or other tags I enter in category don't show in the output.

For example it prints like this

This is description of the car category. In order to check cars check this link  Cars

It doesn't display a link, it shows text. Is there any way to quickly solve this issue?


问:
Can I use Electron without node.js
Im new to Javascript so I would like to keep it at the bare minimum. Is there a way that I can use the Electron to communicate with python script without having node.js? My app is just a basic app that takes some input from users from a html page and I need this text input to be processed in python and write an excel file. So there is not much happening in html so is there a simple way to transfer the input to python file? I want to use Electron because I need this html to be my UI and also I need to distribute this app.</p>

答:
Recently i have done it with some sort of trick hope it will help you and there are the following step which i followed-

Created a stand alone python exe using pyinstaller and the exe has flask server internally then i put the flask server inside my node application.

Now we have to initiate our flask server and send a request to it for processing, i have done this with the help of "execFile" function as a child process, for which i have created a function and the code was something like that-

async function callFlask(){
 var child = require('child_process').execFile;
 child('path_to_python_exe ', function(err, data) {
 if(err){
   console.error(err);
   return;
 }
 });
 }

Now we have initiated our flask server then will send the request with the help of fetch request like

await callFlask().then(
await fetch('host_ip_defined_in_flask'+encodeURIComponent('data'))

Now further we can extend our then chain to get response from python if any and proceed further forexample -

await callFlask().then(
await fetch('host_ip_defined_in_flask'+encodeURIComponent('data'))
.then(res => res.text())
.then(body => console.log(body)))

Here, your output data which python return will be printed in console then you can make your node application behave differently depending on output returned by it.

Also you can package your app with available packagers for electron like electron-packager it will work like a charm.

Also there is are some disadvantage for using python as like it will increase your package size and the process will be difficult to kill from electron after processing so it will increase burden on host machine.

I am assuming that Explaining to create a flask server is not the scope of this question instead if you face any issues let me know, i hope it will help...

Title: Can I use Electron without node.js


问:
Remove 'blog' section in the Github Jekyll
I am wondering how to use the Github Jekyll website without the 'Blog' section (that includes posts). Could you share your solutions? Thanks in advance.</p>

答:
I'll have to make the assumption that you have a blog page, either blog.html or blog/index.html, and in that page you have a for loop calling site.posts or paginator.posts. You have two options:

Delete the _posts directory.

If you want to keep the posts in _posts but don't want them to display on your site, don't use those for loops mentioned above and you won't see the posts on the frontend.


问:
How to share the state between all my component?
I currently have an App component, which is the parent to another component "Cart".
I actually use React Router for the routing, and as such my code is :

```<code>class App extends Component { // (PARENT)
  state = {
    likedClass : ["1"]
  }

  render() {
    return (
      <Router>
        <div className="App">
        <Switch>
          <Route exact path="/cart" component={() => (<Cart likedClass={this.state.likedClass} /> )}/>
        </Switch></div></Router>)} // (etc...)
</code>```

and a child component (cart)

```<code>class Cart extends Component {
  render() {
    return (
      <div className="Cart">
      <Header></Header>
      <section>
          <ul>
              {this.props.likedClass.map((course,index) =>  <CartComponent key={index} ID={course} />)}
          </ul>
      </section>
      <Contact></Contact>
      <Footer></Footer>
      </div>
    )
  }
}

export default Cart;
</code>```

My problem is when I update my state in my App component, my Cart component does not see any change (I change the state with some functions in another children "Course" not shown here for clarity).
I used the React debogger to see that my App state indeed changes when I press the button in my "Course" Children, but still using the React debogger, the state of my Cart never changes and is always showing the initial state..

I am pretty new to React, what am I doing wrong ? Thanks!

Edit :

As asked, the code I use to change the state is in my "course" component, to which I pass a function as a prop, so in my Course component I have :

```<code><button onClick={(e) => {this.props.addLike(course.id)}} className="btn btn-secondary module__button"> LIKER LE COURS</button>
</code>```

and the function "addLike" is passed through props in the App component as such :

```<code>data_cours.map( (card,id) => {
      return (<Route exact path={`/${card.categorie}/${card.id}`} key={id} component={() => <Course
         id={`${card.id}`}
         addLike={this.addLikedClassHandler}
          />}  />)
  } )
  }
</code>```

答:
may be you missed something. Please check this example. it works perfectly.

App Component

```<code>import React, {useEffect, useState} from 'react';
import {BrowserRouter as Router, Switch, Route,} from "react-router-dom";
import history from "./history";
import HelloComponent from "./HelloComponent";

class App extends React.Component {
    state = {
        likedClass: ["khabir"]
    };

    render() {
        return (
            <div>
                <Router history={history}>
                    <Switch>
                        <Route exact path="/hello"
                               component={() => (<HelloComponent likedClass={this.state.likedClass} />)}/>
                    </Switch>
                </Router>
            </div>
        )
    }
}

export default App;
</code>```

history.js

```<code>import {createBrowserHistory} from "history";

export default createBrowserHistory();
</code>```

Hello Component

```<code>import React from "react";

export default function HelloComponent({likedClass}) {

    return (
        <div>
            <ul>
                {likedClass}
            </ul>
        </div>
    );
}
</code>```

Body:
I currently have an App component, which is the parent to another component "Cart".
I actually use React Router for the routing, and as such my code is :

class App extends Component { // (PARENT)
  state = {
    likedClass : ["1"]
  }

  render() {
    return (
      <Router>

        <Switch>
          <Route exact path="/cart" component={() => (<Cart likedClass={this.state.likedClass} /> )}/>
        </Switch>
</Router>)} // (etc...)

and a child component (cart)

class Cart extends Component {
  render() {
    return (

              {this.props.likedClass.map((course,index) =>  <CartComponent key={index} ID={course} />)}

      <Contact></Contact>

    )
  }
}

export default Cart;

My problem is when I update my state in my App component, my Cart component does not see any change (I change the state with some functions in another children "Course" not shown here for clarity).
I used the React debogger to see that my App state indeed changes when I press the button in my "Course" Children, but still using the React debogger, the state of my Cart never changes and is always showing the initial state..

I am pretty new to React, what am I doing wrong ? Thanks!

Edit :

As asked, the code I use to change the state is in my "course" component, to which I pass a function as a prop, so in my Course component I have :

<button onClick={(e) => {this.props.addLike(course.id)}} className="btn btn-secondary module__button"> LIKER LE COURS</button>

and the function "addLike" is passed through props in the App component as such :

data_cours.map( (card,id) => {
      return (<Route exact path={`/${card.categorie}/${card.id}`} key={id} component={() => <Course
         id={`${card.id}`}
         addLike={this.addLikedClassHandler}
          />}  />)
  } )
  }

Body:
may be you missed something. Please check this example. it works perfectly.

App Component

import React, {useEffect, useState} from 'react';
import {BrowserRouter as Router, Switch, Route,} from "react-router-dom";
import history from "./history";
import HelloComponent from "./HelloComponent";

class App extends React.Component {
    state = {
        likedClass: ["khabir"]
    };

    render() {
        return (
            <div>
                <Router history={history}>
                    <Switch>
                        <Route exact path="/hello"
                               component={() => (<HelloComponent likedClass={this.state.likedClass} />)}/>
                    </Switch>
                </Router>
            </div>
        )
    }
}

export default App;

history.js

import {createBrowserHistory} from "history";

export default createBrowserHistory();

Hello Component

import React from "react";

export default function HelloComponent({likedClass}) {

    return (
        <div>
            <ul>
                {likedClass}
            </ul>
        </div>
    );
}


问:
Using markers and polylines with google maps api
I have a map and it has both markers and polylines.

Now I need to seperate these polylines and the markers on different layers I.E

When i want to remove the polylines i just execute the method with layer name that removes the polyline's layer

can you please help me with this?

答:
Not sure what you mean by layers, but check the docs.

Google Maps API Docs  Sepcifically, look at GPolyline.hide();

OwnerDisplayName: David Bonnici

ContentLicense: CC BY-SA 2.5

OwnerDisplayName: Daniel Beardsley


问:
Specifying dynamic number of roles in n-ary relation
I am aware that Grakn allows us to specify n-ary edges/relations.
But, can they allow us to specify many-to-1 relationships when we don't know the size of "many" beforehand?

For example:

If I want to connect two entities 'a' and 'b' to entity 'c', I can do that.
But, what if I don't know before hand how many entities I would want to connect to 'c'.
What if I wanted to keep that dynamic? (sometimes connect 2 entities to 1 or 4 entities to 1)
Does Grakn allow me to represent that?

I hope I have been able to describe my question clearly.

Please let me know. Thank you.

答:
I think you don't necessarily want to do exactly as you described, adding a new role would require dynamically changing the schema. Possible but more likely you want to dynamically choose the number of role players. It's worth clarifying that a role can be played many times within the same relation instance.

Let's re-use Alex Walker's parenthood example. He creates a new relation instance for each parenthood relation. This is a perfectly valid and encouraged approach.

The alternative approach is to have an unknown number of parents and children in the same relation. The schema remains exactly the same, but you are able to add data in this way:

```<code>match [ do matching for $a, $b, $c, $d ]
insert (parent: $a, child: $b, child: $c, child: $d) isa parenthood;
</code>```

The two approaches have different semantic meanings. In this second case there is a single relation connecting the parent to their three children. Modelling with a single relation says that the combination of role players are necessary for the relation.

In the parenthood case, the 3 children are not prerequisite, but two parents are prerequisite to having a child (most of the time):

```<code>match [ do matching for $p1, $p2, $c1 ]
insert (parent: $p1, parent: $p2, child: $c1) isa parenthood;
</code>```

If those two parents have another child, you have two options. Either create a new relation between the two parents and the new child (approach 1), or add the new child to the existing relation (approach 2). The latter you can do like this:

```<code>match
  [ do matching for $p1, $p2, $c1, $c2 ]
  $ph(parent: $p1, parent: $p2, child: $c1) isa parenthood;
insert
  $ph(child: $c2) isa parenthood;
</code>```

The one relation will then look like

```<code>$ph(parent: $p1, parent: $p2, child: $c1, child: $c2) isa parenthood;
</code>```

Notice the use of a variable $ph to match for an existing relation and add a role player to it.

Body:
I think you don't necessarily want to do exactly as you described, adding a new role would require dynamically changing the schema. Possible but more likely you want to dynamically choose the number of role players. It's worth clarifying that a role can be played many times within the same relation instance.

Let's re-use Alex Walker's parenthood example. He creates a new relation instance for each parenthood relation. This is a perfectly valid and encouraged approach.

The alternative approach is to have an unknown number of parents and children in the same relation. The schema remains exactly the same, but you are able to add data in this way:

match [ do matching for $a, $b, $c, $d ]
insert (parent: $a, child: $b, child: $c, child: $d) isa parenthood;

The two approaches have different semantic meanings. In this second case there is a single relation connecting the parent to their three children. Modelling with a single relation says that the combination of role players are necessary for the relation.

In the parenthood case, the 3 children are not prerequisite, but two parents are prerequisite to having a child (most of the time):

match [ do matching for $p1, $p2, $c1 ]
insert (parent: $p1, parent: $p2, child: $c1) isa parenthood;

If those two parents have another child, you have two options. Either create a new relation between the two parents and the new child (approach 1), or add the new child to the existing relation (approach 2). The latter you can do like this:

match
  [ do matching for $p1, $p2, $c1, $c2 ]
  $ph(parent: $p1, parent: $p2, child: $c1) isa parenthood;
insert
  $ph(child: $c2) isa parenthood;

The one relation will then look like

$ph(parent: $p1, parent: $p2, child: $c1, child: $c2) isa parenthood;

Notice the use of a variable $ph to match for an existing relation and add a role player to it.


问:
In C for postfix and prefix operator, operand should be an lvalue, so what actually lvalue means for a pointer variable in case of these operators?
In C for postfix and prefix operator, operand should be an l value, so if cp = &ch; and assume that address of ch is 1000 and address of cp is 5000 so ++cp should be 5001 or 1001 ?

This doubt arises because lvalue of cp is location of cp(5000) and rvalue of cp is value at 5000, "that is 1000". So if ++ operator works on lvalue then it should increment 5000 and not the 1000(because it's an rvalue)?

Thanks in advance.

答:
If you have for example these two declarations

```<code>char ch = 'A';
char *cp = &ch;
</code>```

Then this expression ++cp increases the value stored in the variable cp. The value is the address of the variable ch So after the increment the value stored in the variable cp will point to the memory that is after the memory occupied by the variable ch.

The unary operator ++ can change a value of an lvalue expression.  You may not for example to write

```<code>char ch = 'A';
`++&ch;`
</code>```

because the expression &ch yields a value of the address.

It is the same as to write

```<code>++3;
</code>```

instead of

```<code>int x = 3;
++x;
</code>```

Body:
If you have for example these two declarations

char ch = 'A';
char *cp = &ch;

Then this expression ++cp increases the value stored in the variable cp. The value is the address of the variable ch So after the increment the value stored in the variable cp will point to the memory that is after the memory occupied by the variable ch.

The unary operator ++ can change a value of an lvalue expression.  You may not for example to write

char ch = 'A';
`++&ch;`

because the expression &ch yields a value of the address.

It is the same as to write

++3;

instead of

int x = 3;
++x;


问:
Use observer with decorator in EmberJS
I tried to use observers with decorator syntax but it does not seem to work.

Without decorators:

onRouteChange: observer('router.currentRouteName', function () {
  this.closeModal();
}),
```
<p>Tried this with decorators (fails):</p>
```@observer('router.currentRouteName')
handler() {
  this.closeModal();
}
```

Error message:

Assertion Failed: observer must be provided a function or an observer definition

I may have missed something but I did not found anything about decorators and observers in the documentation.

答:
Ember does not provide the decorator version of observer out of the box.

If your use case does not have a migration path you are happy with, you can use the observer decorator from ember-decorators.

Make sure to read the quickstart as it includes some information other than ember install ember-decorators.

Title: Use observer with decorator in EmberJS

Body:
I tried to use observers with decorator syntax but it does not seem to work.

Without decorators:

onRouteChange: observer('router.currentRouteName', function () {
  this.closeModal();
}),

Tried this with decorators (fails):

@observer('router.currentRouteName')
handler() {
  this.closeModal();
}

Error message:

Assertion Failed: observer must be provided a function or an observer definition

I may have missed something but I did not found anything about decorators and observers in the documentation.


问:
ReadLine on TCPDump-Buffer sometimes blocks until kill tcpdump
I have a problem using TCPDump from my Android-Application.
It is supposed to read the output from tcpdump line by line and process it within my Application.
The Problem is:
Sometimes the code works fine, it reads the captured packets immediately. But sometimes, ReadLine blocks until I kill the tcpdump process from the Linux-Console (killall tcpdump). After doing that, my loop is processed for each line (sometimes 10, sometimes 1 or 2) - which means, the readLine should have worked, but didn´t.

I read about similar problems, but did not find any solution for this problem...
THANKS!!

```<code>public class ListenActivity extends Activity {

static ArrayList<Packet> packetBuffer = new ArrayList<Packet>();
static Process tcpDumpProcess = null;
static ListenThread thread = null;
public static final String TCPDUMP_COMMAND = "tcpdump -A -s0 | grep -i -e 'Cookie'\n";

private InputStream  inputStream = null;
private OutputStream outputStream = null;

@Override
protected void onStart() {
    super.onStart();
    try {
        tcpDumpProcess = new ProcessBuilder().command("su").redirectErrorStream(true).start();
        inputStream = tcpDumpProcess.getInputStream();
        outputStream = tcpDumpProcess.getOutputStream();
        outputStream.write(TCPDUMP_COMMAND.getBytes("ASCII"));
    } catch (Exception e) {
        Log.e("FSE", "", e);
    }
    thread = new ListenThread(new BufferedReader(new InputStreamReader(inputStream)));
    thread.start();
}

private class ListenThread extends Thread {

    public ListenThread(BufferedReader reader) {
        this.reader = reader;
    }

    private BufferedReader reader = null;

    @Override
    public void run() {

        reader = new BufferedReader(new InputStreamReader(inputStream));
        while (true) {
            try {
                String received = reader.readLine();
                Log.d("FS", received);
                Packet pReceived = Packet.analyze(received);
                if (pReceived != null) {
                    packetBuffer.add(pReceived);
                }
            } catch (Exception e) {
                Log.e("FSE", "", e);
            }

        }

    }

}
</code>```

}

答:
I don't understand why, but even with the -l option the buffer is too large if you read on the standard output of the process wherein you run tcpdump.
I solve this problem by redirect TcpDump's output to a file and read this file in another thread. The TcpDump command should be something like :

```<code>tcpdump -l-A -s0 > /data/local/output.txt
</code>```

The run method inside your thread have to be change to read in the output file :

```<code>File dumpedFile = new File("/data/local/output.txt");
//open a reader on the tcpdump output file
BufferedReader reader = new BufferedReader(new FileReader(dumpedFile));
String temp = new String();
//The while loop is broken if the thread is interrupted
while (!Thread.interrupted()) {
    temp = reader.readLine();
    if (temp!=null) {
        Log.e("READER",new String(temp));
    }
}
</code>```

I dont exactly know what you want to do with grep but I think it's possible do achieve the same actions with a regexp inside the Java code.

You should also be aware that the TcpDump's process will never end, so you have to kill it when your activity is paused or distroy.
You can have a look here to my blog post, I explain my whole code to start/stop tcpdump.

ContentLicense: CC BY-SA 3.0

Body:
I have a problem using TCPDump from my Android-Application.
It is supposed to read the output from tcpdump line by line and process it within my Application.
The Problem is:
Sometimes the code works fine, it reads the captured packets immediately. But sometimes, ReadLine blocks until I kill the tcpdump process from the Linux-Console (killall tcpdump). After doing that, my loop is processed for each line (sometimes 10, sometimes 1 or 2) - which means, the readLine should have worked, but didn´t.

I read about similar problems, but did not find any solution for this problem...
THANKS!!

public class ListenActivity extends Activity {

static ArrayList<Packet> packetBuffer = new ArrayList<Packet>();
static Process tcpDumpProcess = null;
static ListenThread thread = null;
public static final String TCPDUMP_COMMAND = "tcpdump -A -s0 | grep -i -e 'Cookie'\n";

private InputStream  inputStream = null;
private OutputStream outputStream = null;

@Override
protected void onStart() {
    super.onStart();
    try {
        tcpDumpProcess = new ProcessBuilder().command("su").redirectErrorStream(true).start();
        inputStream = tcpDumpProcess.getInputStream();
        outputStream = tcpDumpProcess.getOutputStream();
        outputStream.write(TCPDUMP_COMMAND.getBytes("ASCII"));
    } catch (Exception e) {
        Log.e("FSE", "", e);
    }
    thread = new ListenThread(new BufferedReader(new InputStreamReader(inputStream)));
    thread.start();
}

private class ListenThread extends Thread {

    public ListenThread(BufferedReader reader) {
        this.reader = reader;
    }

    private BufferedReader reader = null;

    @Override
    public void run() {

        reader = new BufferedReader(new InputStreamReader(inputStream));
        while (true) {
            try {
                String received = reader.readLine();
                Log.d("FS", received);
                Packet pReceived = Packet.analyze(received);
                if (pReceived != null) {
                    packetBuffer.add(pReceived);
                }
            } catch (Exception e) {
                Log.e("FSE", "", e);
            }

        }

    }

}

}

Body:
I don't understand why, but even with the -l option the buffer is too large if you read on the standard output of the process wherein you run tcpdump.
I solve this problem by redirect TcpDump's output to a file and read this file in another thread. The TcpDump command should be something like :

tcpdump -l-A -s0 > /data/local/output.txt

The run method inside your thread have to be change to read in the output file :

File dumpedFile = new File("/data/local/output.txt");
//open a reader on the tcpdump output file
BufferedReader reader = new BufferedReader(new FileReader(dumpedFile));
String temp = new String();
//The while loop is broken if the thread is interrupted
while (!Thread.interrupted()) {
    temp = reader.readLine();
    if (temp!=null) {
        Log.e("READER",new String(temp));
    }
}

I dont exactly know what you want to do with grep but I think it's possible do achieve the same actions with a regexp inside the Java code.

You should also be aware that the TcpDump's process will never end, so you have to kill it when your activity is paused or distroy.
You can have a look here to my blog post, I explain my whole code to start/stop tcpdump.


问:
Chrome Extension - Invalid Package. Details:Can't unzip the extension
I worked on a chrome extension and uploaded it to chrome webstore and everything went well, I installed it on my Mac and on my Ubuntu machines in chrome it worked fine and installed. But when I try it on Windows machines, after download it popups a error message saying "Invalid Package, Can't unzip the extension".

Can any one tell me why or what might be the cause for this OS specific issue. Does it have anything to do with the permission or anything with respective folder name or content? The folder name or the extension name don't have any special characters and the previous version was fine.

Thanks in advance.

答:
It could be caused by a lot of things.
For me, the problem was having .xcf (Gimp) files inside the package.

The extension loaded fine when unzipped manually but showed the "couldn't unzip" error in when loaded from the Chrome Webstore.


问:
Is there a way to implement a countdown within a window, without the window freezing?
```<code>import PySimpleGUI as sg
import time
q1 = [
        [sg.Text("Question 1!"), sg.Button("x", visible=False), sg.Text("Time:"), sg.Text(" ", size=(10,1), key="t")],
        [sg.Text("This is where question 1 will be?")],
        [sg.Button("Option 1", key="1",button_color=("#ffffff","#151515")), sg.Button("Option 2", key="2",button_color=("#00ff00", "#151515"))],
        [sg.Button("Option 3", key="3",button_color=("#00ffff", "#151515")), sg.Button("Option 4", key="4",button_color=("#ff00ff", "#151515"))],
        [sg.Button("Submit"), sg.Button("Next Question"), sg.Button("Skip")]
    ]

window = sg.Window("Question 1",q1)

while True:
    event, values = window.Read()
    if event is None:
        break

    seconds = 20
    for i in range(seconds):
        seconds = seconds - i
        window.FindElement("t").Update(seconds)
        time.sleep(1)
</code>```

I'm not sure if I am approaching this the correct way, but I want to make it so that a 20-second timer appears in the upper right corner. However, with the code above, no timer starts, and when you press a button, it freezes the program for 20 seconds.

答:
Apologies if this is discussed in the many notes in this post.  If so, feel free to ignore and sorry for taking up the space.

Never put a "sleep" in an event loop.  Use a timeout on your window.read instead

Call window.refresh() to have changes appear in your window:
https://pysimplegui.readthedocs.io/en/latest/call%20reference/#window
It states:

Use this call when you want something to appear in your Window immediately (as soon as this function is called). Without this call your changes to a Window will not be visible to the user until the next Read call

There is a timer demo - this demo and the concept of refreshing a window periodically is referenced throughout the documentation, in a demo program and also on Trinket.  The docs speak directly about having windows the appear to freeze if you don't call read or refresh periodically.  The timer is discussed here in the main docs:

https://pysimplegui.readthedocs.io/en/latest/#persistent-window-example-running-timer-that-updates

Body:
import PySimpleGUI as sg
import time
q1 = [
        [sg.Text("Question 1!"), sg.Button("x", visible=False), sg.Text("Time:"), sg.Text(" ", size=(10,1), key="t")],
        [sg.Text("This is where question 1 will be?")],
        [sg.Button("Option 1", key="1",button_color=("#ffffff","#151515")), sg.Button("Option 2", key="2",button_color=("#00ff00", "#151515"))],
        [sg.Button("Option 3", key="3",button_color=("#00ffff", "#151515")), sg.Button("Option 4", key="4",button_color=("#ff00ff", "#151515"))],
        [sg.Button("Submit"), sg.Button("Next Question"), sg.Button("Skip")]
    ]

window = sg.Window("Question 1",q1)

while True:
    event, values = window.Read()
    if event is None:
        break

    seconds = 20
    for i in range(seconds):
        seconds = seconds - i
        window.FindElement("t").Update(seconds)
        time.sleep(1)

I'm not sure if I am approaching this the correct way, but I want to make it so that a 20-second timer appears in the upper right corner. However, with the code above, no timer starts, and when you press a button, it freezes the program for 20 seconds.


问:
UIView animation completion callback?
Can I setup a function to be called once my animation is complete?  I want to fade a UIView and then remove it from the superView.

答:
Animation blocks were introduced in iOS4. Apple recommends you use these, and the new methods mostly ask for completion blocks which replace callbacks. For example:</p>

```<code>[UIView animateWithDuration:0.5f
                      delay:0.0f
                    options:UIViewAnimationCurveEaseInOut
                 animations:^{
                   [myView setAlpha:0.0f];
                 }
                 completion:^(BOOL finished) {
                   [myView removeFromSuperview];
                 }];
</code>```

Title: UIView animation completion callback?

Body:
Animation blocks were introduced in iOS4. Apple recommends you use these, and the new methods mostly ask for completion blocks which replace callbacks. For example:

[UIView animateWithDuration:0.5f
                      delay:0.0f
                    options:UIViewAnimationCurveEaseInOut
                 animations:^{
                   [myView setAlpha:0.0f];
                 }
                 completion:^(BOOL finished) {
                   [myView removeFromSuperview];
                 }];


问:
How to return a string instead of system.object[] using powershell?
I have a function

```<code>function Build-Exec($path,$param1,$param2,$param3,$param4)
{
    $var = @($path,$param1,$param2,$param3,$param4) -join " "
    return $var
}
</code>```

when i call it it returns

```<code>System.Object[]
</code>```

How can i make it return a string?

example usage

```<code>$var1 = Build-Exec("1","2","3","4","5")

Write-Output $var1
</code>```

答:
The problem is that isn't how you define or call parameters for a function in PowerShell

function Build-Exec
{
    Param ($path,$param1,$param2,$param3,$param4)
    $var = @($path,$param1,$param2,$param3,$param4) -join " "
    return $var
}
```

<p>Calling the function</p>

<pre class="lang-bsh prettyprint-override"><code>$var1 = Build-Exec "1" "2" "3" "4" "5"
Write-Output $var1
1 2 3 4 5
</code>```

When you include the commas, you are passing the first param a string array.

Body:
I have a function

function Build-Exec($path,$param1,$param2,$param3,$param4)
{
    $var = @($path,$param1,$param2,$param3,$param4) -join " "
    return $var
}

when i call it it returns

System.Object[]

How can i make it return a string?

example usage

$var1 = Build-Exec("1","2","3","4","5")

Write-Output $var1

Body:
The problem is that isn't how you define or call parameters for a function in PowerShell

function Build-Exec
{
    Param ($path,$param1,$param2,$param3,$param4)
    $var = @($path,$param1,$param2,$param3,$param4) -join " "
    return $var
}

Calling the function

$var1 = Build-Exec "1" "2" "3" "4" "5"
Write-Output $var1
1 2 3 4 5

When you include the commas, you are passing the first param a string array.


问:
Select all values from last date that is shared between rows grouped by a value
I have a Postgresql table with a list of values for countries over time, and their continents. Values can be NULL. I’d like to get the sum for each continent over time, up to the latest date each continent has data for.

This is my table (view on DB Fiddle):

```<code>| continent | country | date       | value | id  |
| --------- | ------- | ---------- | ----- | --- |
| Europe    | Germany | 2020-05-25 | 10    | 1   |
| Europe    | Germany | 2020-05-26 | 11    | 2   |
| Europe    | Germany | 2020-05-27 | 12    | 3   |
| Europe    | Germany | 2020-05-28 | 13    | 4   |
| Europe    | Italy   | 2020-05-25 | 20    | 5   |
| Europe    | Italy   | 2020-05-26 | 21    | 6   |
| Europe    | Italy   | 2020-05-27 | 22    | 7   |
| Europe    | Italy   | 2020-05-28 | 23    | 8   |
| Europe    | France  | 2020-05-25 | 30    | 9   |
| Europe    | France  | 2020-05-26 | 31    | 10  |
| Europe    | France  | 2020-05-27 | 32    | 11  |
| Europe    | France  | 2020-05-28 | NULL  | 12  |
| Africa    | Congo   | 2020-05-25 | 40    | 13  |
| Africa    | Congo   | 2020-05-26 | 41    | 14  |
| Africa    | Congo   | 2020-05-27 | NULL  | 15  |
</code>```

And this is what I’d like to get back. Note that the Europe includes data up to the 27th, because France has no data for the 28th, and Africa up to the 26th, because that’s the last date its countries have data for.

```<code>| continent | date       | value |
| --------- | ---------- | ----- |
| Europe    | 2020-05-27 | 66    |
| Africa    | 2020-05-26 | 41    |
| Europe    | 2020-05-26 | 63    |
| Africa    | 2020-05-25 | 40    |
| Europe    | 2020-05-25 | 60    |
</code>```

I managed to almost get there by including the number of countries per continent that have data on each date.

SELECT
    countries.continent,
    countries.date,
    SUM(countries.value) AS value,
    COUNT(countries.country) AS countries_count
FROM
    countries
WHERE
    countries.value IS NOT NULL
GROUP BY
    countries.continent,
    countries.date
ORDER BY
    countries.date DESC,
    countries.continent;
```

```| continent | date       | value | countries_count |
| --------- | ---------- | ----- | --------------- |
| Europe    | 2020-05-28 | 36    | 2               |
| Europe    | 2020-05-27 | 66    | 3               |
| Africa    | 2020-05-26 | 41    | 1               |
| Europe    | 2020-05-26 | 63    | 3               |
| Africa    | 2020-05-25 | 40    | 1               |
| Europe    | 2020-05-25 | 60    | 3               |
```

<p>I also managed to get the number of countries per continent.</p>

<pre class="lang-sql prettyprint-override"><code>SELECT
    countries.continent,
    COUNT(DISTINCT countries.country) as number_of_countries
FROM
    countries
GROUP BY
    countries.continent;
</code>```

```<code>| continent | number_of_countries |
| --------- | ------------------- |
| Africa    | 1                   |
| Europe    | 3                   |
</code>```

I’m stuck on how to combine the two queries to filter out rows that haven’t got the full number of countries for the continent (e. g. select rows where countries_count is 3 for Europe and 1 for Africa.

This is the end result I’d like to get back:

```<code>| continent | date       | value |
| --------- | ---------- | ----- |
| Europe    | 2020-05-27 | 66    |
| Africa    | 2020-05-26 | 41    |
| Europe    | 2020-05-26 | 63    |
| Africa    | 2020-05-25 | 40    |
| Europe    | 2020-05-25 | 60    |
</code>```

Or maybe there’s a completely different way to go about this?

View on DB Fiddle

答:
With SUM() window function:

```<code>select distinct c.continent, c.date,
  sum(c.value) over (partition by c.continent, c.date) "value"
from countries c
where not exists (
  select 1 from countries
  where continent = c.continent and date = c.date and value is null
)
order by c.date desc, c.continent;
</code>```

See the demo.

Results:

```<code>| continent | date                     | value |
| --------- | ------------------------ | ----- |
| Europe    | 2020-05-27T00:00:00.000Z | 66    |
| Africa    | 2020-05-26T00:00:00.000Z | 41    |
| Europe    | 2020-05-26T00:00:00.000Z | 63    |
| Africa    | 2020-05-25T00:00:00.000Z | 40    |
| Europe    | 2020-05-25T00:00:00.000Z | 60    |
</code>```

Body:
I have a Postgresql table with a list of values for countries over time, and their continents. Values can be NULL. I’d like to get the sum for each continent over time, up to the latest date each continent has data for.

This is my table (view on DB Fiddle):

| continent | country | date       | value | id  |
| --------- | ------- | ---------- | ----- | --- |
| Europe    | Germany | 2020-05-25 | 10    | 1   |
| Europe    | Germany | 2020-05-26 | 11    | 2   |
| Europe    | Germany | 2020-05-27 | 12    | 3   |
| Europe    | Germany | 2020-05-28 | 13    | 4   |
| Europe    | Italy   | 2020-05-25 | 20    | 5   |
| Europe    | Italy   | 2020-05-26 | 21    | 6   |
| Europe    | Italy   | 2020-05-27 | 22    | 7   |
| Europe    | Italy   | 2020-05-28 | 23    | 8   |
| Europe    | France  | 2020-05-25 | 30    | 9   |
| Europe    | France  | 2020-05-26 | 31    | 10  |
| Europe    | France  | 2020-05-27 | 32    | 11  |
| Europe    | France  | 2020-05-28 | NULL  | 12  |
| Africa    | Congo   | 2020-05-25 | 40    | 13  |
| Africa    | Congo   | 2020-05-26 | 41    | 14  |
| Africa    | Congo   | 2020-05-27 | NULL  | 15  |

And this is what I’d like to get back. Note that the Europe includes data up to the 27th, because France has no data for the 28th, and Africa up to the 26th, because that’s the last date its countries have data for.

| continent | date       | value |
| --------- | ---------- | ----- |
| Europe    | 2020-05-27 | 66    |
| Africa    | 2020-05-26 | 41    |
| Europe    | 2020-05-26 | 63    |
| Africa    | 2020-05-25 | 40    |
| Europe    | 2020-05-25 | 60    |

I managed to almost get there by including the number of countries per continent that have data on each date.

SELECT
    countries.continent,
    countries.date,
    SUM(countries.value) AS value,
    COUNT(countries.country) AS countries_count
FROM
    countries
WHERE
    countries.value IS NOT NULL
GROUP BY
    countries.continent,
    countries.date
ORDER BY
    countries.date DESC,
    countries.continent;

| continent | date       | value | countries_count |
| --------- | ---------- | ----- | --------------- |
| Europe    | 2020-05-28 | 36    | 2               |
| Europe    | 2020-05-27 | 66    | 3               |
| Africa    | 2020-05-26 | 41    | 1               |
| Europe    | 2020-05-26 | 63    | 3               |
| Africa    | 2020-05-25 | 40    | 1               |
| Europe    | 2020-05-25 | 60    | 3               |

I also managed to get the number of countries per continent.

SELECT
    countries.continent,
    COUNT(DISTINCT countries.country) as number_of_countries
FROM
    countries
GROUP BY
    countries.continent;

| continent | number_of_countries |
| --------- | ------------------- |
| Africa    | 1                   |
| Europe    | 3                   |

I’m stuck on how to combine the two queries to filter out rows that haven’t got the full number of countries for the continent (e. g. select rows where countries_count is 3 for Europe and 1 for Africa.

This is the end result I’d like to get back:

| continent | date       | value |
| --------- | ---------- | ----- |
| Europe    | 2020-05-27 | 66    |
| Africa    | 2020-05-26 | 41    |
| Europe    | 2020-05-26 | 63    |
| Africa    | 2020-05-25 | 40    |
| Europe    | 2020-05-25 | 60    |

Or maybe there’s a completely different way to go about this?

View on DB Fiddle

Body:
With SUM() window function:

select distinct c.continent, c.date,
  sum(c.value) over (partition by c.continent, c.date) "value"
from countries c
where not exists (
  select 1 from countries
  where continent = c.continent and date = c.date and value is null
)
order by c.date desc, c.continent;

See the demo.

Results:

| continent | date                     | value |
| --------- | ------------------------ | ----- |
| Europe    | 2020-05-27T00:00:00.000Z | 66    |
| Africa    | 2020-05-26T00:00:00.000Z | 41    |
| Europe    | 2020-05-26T00:00:00.000Z | 63    |
| Africa    | 2020-05-25T00:00:00.000Z | 40    |
| Europe    | 2020-05-25T00:00:00.000Z | 60    |


问:
Cannot process the message because the content type 'application/xml;charset="utf-8"' was not the expected type 'text/xml; charset=utf-8'
I Called a soap service which was developed in c# and I am implementing it in MY PHP code, I am getting this error "HTTP/1.1 415 Cannot process the message because the content type 'application/xml;charset="utf-8"' was not the expected type 'text/xml; charset=utf-8'.".

Please help me how can I resolve this issue?

Here is my code.

```<code>    <?php
    $xml_string = '<?xml version="1.0" encoding="UTF-8"?>
    <Invoice xmlns:ubltr="urn:oasis:names:specification:ubl:schema:xsd:TurkishCustomizationExtensionComponents" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xsi:schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 UBL-Invoice-2.1.xsd" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
        <ext:UBLExtensions>
          <ext:UBLExtension>
            <ext:ExtensionContent><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature_INN2020000004738">
      <ds:SignedInfo>
      <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
      <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
      <ds:Reference Id="Reference-Id-fbfd9b87-0852-47e8-9fe0-43967645102c" URI="#Signed-Properties-Id-ff550d10-a81d-4ce5-943c-89d50061cc19" Type="http://uri.etsi.org/01903#SignedProperties">
      <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
      <ds:DigestValue>G3wTvli8QJrLgjxMLCkK1c7MGjzmTMwKVSzvHMg9Odg=</ds:DigestValue>
      </ds:Reference>
      <ds:Reference Id="Reference-Id-3f25e0e0-2e7e-462c-8b9e-7b73bc6c7119" URI="">
      <ds:Transforms>
      <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
      </ds:Transforms>
      <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
      <ds:DigestValue>StpFdOkLqURx7QnNqftBTzlDBL2isDBD10av/ttVTL0=</ds:DigestValue>
      </ds:Reference>
      </ds:SignedInfo>
      <ds:SignatureValue Id="Signature-Value-Id-7823ee32-b522-4b0a-b022-1d49eaa13d7f">qba6lrTyBvJk1nuTGQ9atoJE5F3ku9mwkrradJKZ6YMJX5ccu1VhzS3FfryFBqfJYI1Xqt+uqQ6j7o5N1yI1RHfmL7PNK3mjOU1UBNSMwf3dJPhDxAegwZkwaAx5tTWIu8T/vO3mZQmX7ZJqLzvmw/1bnk1VrswrzewbfjCha5RajIUDV5a/K4hX6b+N9LENta/cPEoTtc76UTQS3QHzPyFc8r1/Te8sPmpRWTdmNIAnye8BHHKMAodRf3hWfgNfwnUwfzBpa3H6DJGGGzjH4EkzR7clN8D3GYKU4V3U3Xi3dBkv9+fZSJMpb5LzceRwGZcNvVINMig57SVt5MEkWg==</ds:SignatureValue>
      <ds:KeyInfo>
      <ds:KeyValue>
      <ds:RSAKeyValue>
      <ds:Modulus>yIBUILxPZ0ZffJGtlAOXP9jBGcf8gfqd4UXMzpFqpMcGXikuoDA1bBrcyXYOJEQyz5irike1cVKBUdiLvtqDVItPoWxGJqP2yumc7nFcUUYwpsTVXFdLQwQNhFCairzjRWLoCyWrMKU81wWc+N/WrdEHIhMzR9IKKcne8J/OswPldWAxNjFJMiVh9pvx0Oi1rKxyCGmQxqaqOY1yY1vSS/J+l4voY44cshN0rq+rYBic2RSZpMVZIxlHGWmNiFHXRXfBPihFtg67BkubZw9IQ6ZlqmtzYARr/d0tcv0GEfGqNILixxbxSnLSZ5zsSVqpq6BVTDxbs7Ho4CeUpkABvw==</ds:Modulus>
      <ds:Exponent>AQAB</ds:Exponent>
      </ds:RSAKeyValue>
      </ds:KeyValue>
      <ds:X509Data>
      <ds:X509Certificate>MIIFrDCCBJSgAwIBAgIHCCnDYwP6+zANBgkqhkiG9w0BAQsFADBcMQswCQYDVQQGEwJUUjFNMEsGA1UEAwxETWFsaSBNw7xow7xyIEVsZWt0cm9uaWsgU2VydGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLEgLSBTw7xyw7xtIDIwHhcNMTcxMTI5MDgzMTEyWhcNMjAxMTI4MDgzMTEyWjBUMRMwEQYDVQQFEwo0NzgwMTYzODMxMT0wOwYDVQQDDDTEsE5OT1ZBIELEsEzEsMWexLBNIMOHw5Zaw5xNTEVSxLAgQU5PTsSwTSDFnsSwUktFVMSwMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyIBUILxPZ0ZffJGtlAOXP9jBGcf8gfqd4UXMzpFqpMcGXikuoDA1bBrcyXYOJEQyz5irike1cVKBUdiLvtqDVItPoWxGJqP2yumc7nFcUUYwpsTVXFdLQwQNhFCairzjRWLoCyWrMKU81wWc+N/WrdEHIhMzR9IKKcne8J/OswPldWAxNjFJMiVh9pvx0Oi1rKxyCGmQxqaqOY1yY1vSS/J+l4voY44cshN0rq+rYBic2RSZpMVZIxlHGWmNiFHXRXfBPihFtg67BkubZw9IQ6ZlqmtzYARr/d0tcv0GEfGqNILixxbxSnLSZ5zsSVqpq6BVTDxbs7Ho4CeUpkABvwIDAQABo4ICeTCCAnUwHwYDVR0jBBgwFoAUA4T6lzHn9IcZL2Ur4bQbY6evdb4wHQYDVR0OBBYEFMOPW9KDTpQT4l3RHZgk49E82cXAMA4GA1UdDwEB/wQEAwIHgDCCATMGA1UdIASCASowggEmMIIBIgYLYIYYAQIBAQUHBAEwggERMCoGCCsGAQUFBwIBFh5odHRwOi8vZGVwby5rYW11c20uZ292LnRyL2lsa2UwgeIGCCsGAQUFBwICMIHVHoHSAEIAdQAgAHMAZQByAHQAaQBmAGkAawBhACAAaQBsAGUAIABpAGwAZwBpAGwAaQAgAHMAZQByAHQAaQBmAGkAawBhACAAdQB5AGcAdQBsAGEAbQBhACAAZQBzAGEAcwBsAGEAcgExAG4BMQAgAG8AawB1AG0AYQBrACAAaQDnAGkAbgAgAGIAZQBsAGkAcgB0AGkAbABlAG4AIAB3AGUAYgAgAHMAaQB0AGUAcwBpAG4AaQAgAHoAaQB5AGEAcgBlAHQAIABlAGQAaQBuAGkAegAuMAwGA1UdEwEB/wQCMAAwFgYDVR0lBA8wDQYLYIYYAQIBAQUHMgEwQQYDVR0fBDowODA2oDSgMoYwaHR0cDovL2RlcG8ua2FtdXNtLmdvdi50ci9rdXJ1bXNhbC9tbWVzaHMtczIuY3JsMIGCBggrBgEFBQcBAQR2MHQwPAYIKwYBBQUHMAKGMGh0dHA6Ly9kZXBvLmthbXVzbS5nb3YudHIva3VydW1zYWwvbW1lc2hzLXMyLmNydDA0BggrBgEFBQcwAYYoaHR0cDovL2Npc2R1cG1tczIua3VydW1zYWwua2FtdXNtLmdvdi50cjANBgkqhkiG9w0BAQsFAAOCAQEAhhYuCI0NvHiqO/0fdQHki6NIm5Dn/PsfN9T6mEFbXKOjiwx6zNPBnDoF7N3c63Konw6r07Jnho8oryiB1xFf1iahRvd1DliClFboq81SXJlVf0aQzaw9Opi8D7FRqWFBtIbjPu+ME73zNjt3skmN6OupQRZjIQmRmtZdYCt7OCf13PKdz4cYd3fnTLHtHMb1K8s43P0Ev+KzalXxwh0P6C0PnYoso9s4IV8wRFwqIn3FfT71U38hGfPcCnkOFhhwNzf5xDdRpwxhG9uZFNZhCx1TjmkSsTMApMu57AT8Q6L8o8qAtWTzJMfMMyAqV2gfGXVblDnuUrHEV2zDkie0Lw==</ds:X509Certificate>
      <ds:X509SubjectName>CN=İNNOVA BİLİŞİM ÇÖZÜMLERİ ANONİM ŞİRKETİ,SERIALNUMBER=4780163831</ds:X509SubjectName>
      </ds:X509Data>
      </ds:KeyInfo>
      <ds:Object Id="Object-Id-885f4d52-fed0-4ad2-b298-93850cdc874c"><xades:QualifyingProperties xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" Target="Signature_INN2020000004738">
      <xades:SignedProperties Id="Signed-Properties-Id-ff550d10-a81d-4ce5-943c-89d50061cc19">
      <xades:SignedSignatureProperties>
      <xades:SigningTime>2020-05-07T12:20:52.0792734+03:00</xades:SigningTime>
      <xades:SigningCertificate>
      <xades:Cert>
      <xades:CertDigest>
      <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
      <ds:DigestValue>VCgHJeCh7rKyUChRRRSEn90raVcNP3pavlk/NifKd9g=</ds:DigestValue>
      </xades:CertDigest>
      <xades:IssuerSerial>
      <ds:X509IssuerName>CN=Mali Mühür Elektronik Sertifika Hizmet Sağlayıcısı - Sürüm 2,C=TR</ds:X509IssuerName>
      <ds:X509SerialNumber>2297718970252027</ds:X509SerialNumber>
      </xades:IssuerSerial>
      </xades:Cert>
      </xades:SigningCertificate>
      </xades:SignedSignatureProperties>
      <xades:SignedDataObjectProperties>
      <xades:DataObjectFormat ObjectReference="#Reference-Id-3f25e0e0-2e7e-462c-8b9e-7b73bc6c7119">
      <xades:MimeType>text/xml</xades:MimeType>
      </xades:DataObjectFormat>
      </xades:SignedDataObjectProperties>
      </xades:SignedProperties>
      </xades:QualifyingProperties>
      </ds:Object>
      </ds:Signature></ext:ExtensionContent>
          </ext:UBLExtension>
        </ext:UBLExtensions>
        <cbc:UBLVersionID>2.1</cbc:UBLVersionID>
        <cbc:CustomizationID>TR1.2</cbc:CustomizationID>
        <cbc:ProfileID>TICARIFATURA</cbc:ProfileID>
        <cbc:ID>INN2020000004738</cbc:ID>
        <cbc:CopyIndicator>false</cbc:CopyIndicator>
        <cbc:UUID>18FF00EA-9F5F-4713-98E6-7E61353DD749</cbc:UUID>
        <cbc:IssueDate>2020-01-08</cbc:IssueDate>
        <cbc:IssueTime>13:00:00.0000000+03:00</cbc:IssueTime>
        <cbc:InvoiceTypeCode>TEVKIFAT</cbc:InvoiceTypeCode>
        <cbc:Note>YALNIZ  BİN DOKSAN TL SIFIR KURUŞ</cbc:Note>
        <cbc:DocumentCurrencyCode listID="ISO 4217 Alpha" listAgencyName="United Nations Economic Commission for Europe" listName="Currency" listVersionID="2001">TRY</cbc:DocumentCurrencyCode>
        <cbc:LineCountNumeric>1</cbc:LineCountNumeric>
        <cac:AdditionalDocumentReference>
          <cbc:ID>7D09D503-0E91-4CF0-A40D-6D075C8A0DD1</cbc:ID>
          <cbc:IssueDate>2020-01-08</cbc:IssueDate>

        </cac:AdditionalDocumentReference>
        <cac:Signature>
          <cbc:ID schemeID="VKN_TCKN">4780163831</cbc:ID>
          <cac:SignatoryParty>
            <cbc:WebsiteURI>www.innova.com.tr</cbc:WebsiteURI>
            <cac:PartyIdentification>
              <cbc:ID schemeID="VKN">4780163831</cbc:ID>
            </cac:PartyIdentification>
            <cac:PartyName>
              <cbc:Name>İnnova Bilişim Çözümleri A.Ş.</cbc:Name>
            </cac:PartyName>
            <cac:PostalAddress>
              <cbc:Room>1</cbc:Room>
              <cbc:StreetName>Ayazağa Caddesi</cbc:StreetName>
              <cbc:BuildingName>Arı 4</cbc:BuildingName>
              <cbc:BuildingNumber>2</cbc:BuildingNumber>
              <cbc:CitySubdivisionName>MASLAK</cbc:CitySubdivisionName>
              <cbc:CityName>İSTANBUL</cbc:CityName>
              <cbc:PostalZone>34469</cbc:PostalZone>
              <cac:Country>
                <cbc:Name>Türkiye</cbc:Name>
              </cac:Country>
            </cac:PostalAddress>
          </cac:SignatoryParty>
          <cac:DigitalSignatureAttachment>
            <cac:ExternalReference>
              <cbc:URI>#Signature_INN2020000004738</cbc:URI>
            </cac:ExternalReference>
          </cac:DigitalSignatureAttachment>
        </cac:Signature>
        <cac:AccountingSupplierParty>
          <cac:Party>
            <cbc:WebsiteURI>www.innova.com.tr</cbc:WebsiteURI>
            <cac:PartyIdentification>
              <cbc:ID schemeID="VKN">4780163831</cbc:ID>
            </cac:PartyIdentification>
            <cac:PartyIdentification>
              <cbc:ID schemeID="TICARETSICILNO">231345</cbc:ID>
            </cac:PartyIdentification>
            <cac:PartyIdentification>
              <cbc:ID schemeID="MERSISNO">777777777778</cbc:ID>
            </cac:PartyIdentification>
            <cac:PartyName>
              <cbc:Name>İnnova Bilişim Çözümleri A.Ş.</cbc:Name>
            </cac:PartyName>
            <cac:PostalAddress>
              <cbc:Room>1</cbc:Room>
              <cbc:StreetName>Ayazağa Caddesi</cbc:StreetName>
              <cbc:BuildingName>Arı 4</cbc:BuildingName>
              <cbc:BuildingNumber>2</cbc:BuildingNumber>
              <cbc:CitySubdivisionName>MASLAK</cbc:CitySubdivisionName>
              <cbc:CityName>İSTANBUL</cbc:CityName>
              <cbc:PostalZone>34469</cbc:PostalZone>
              <cac:Country>
                <cbc:Name>Türkiye</cbc:Name>
              </cac:Country>
            </cac:PostalAddress>
            <cac:PartyTaxScheme>
              <cac:TaxScheme>
                <cbc:Name>Boğaziçi Kurumlar Vergi Dairesi</cbc:Name>
              </cac:TaxScheme>
            </cac:PartyTaxScheme>
            <cac:Contact>
              <cbc:Telephone>2123297000</cbc:Telephone>
              <cbc:Telefax>2122864402</cbc:Telefax>
              <cbc:ElectronicMail>yalkis@innova.com.tr</cbc:ElectronicMail>
            </cac:Contact>
          </cac:Party>
        </cac:AccountingSupplierParty>
        <cac:AccountingCustomerParty>
          <cac:Party>
            <cac:PartyIdentification>
              <cbc:ID schemeID="VKN">4780163831</cbc:ID>
            </cac:PartyIdentification>
            <cac:PartyName>
              <cbc:Name>İnnova Bilişim Çözümleri A.Ş.</cbc:Name>
            </cac:PartyName>
            <cac:PostalAddress>
              <cbc:CitySubdivisionName>Semt/İlçe</cbc:CitySubdivisionName>
              <cbc:CityName>Şehir</cbc:CityName>
              <cbc:PostalZone />
              <cbc:Region>Semt/İlçe</cbc:Region>
              <cac:Country>
                <cbc:Name>Ülke</cbc:Name>
              </cac:Country>
            </cac:PostalAddress>
            <cac:PartyTaxScheme>
              <cac:TaxScheme>
                <cbc:Name>Vergi Dairesi</cbc:Name>
              </cac:TaxScheme>
            </cac:PartyTaxScheme>
            <cac:Contact>
              <cbc:ElectronicMail>yalkis@innova.com.tr</cbc:ElectronicMail>
            </cac:Contact>
          </cac:Party>
        </cac:AccountingCustomerParty>
        <cac:AllowanceCharge>
          <cbc:ChargeIndicator>false</cbc:ChargeIndicator>
          <cbc:MultiplierFactorNumeric>0</cbc:MultiplierFactorNumeric>
          <cbc:SequenceNumeric>1</cbc:SequenceNumeric>
          <cbc:Amount currencyID="TRY">0.00</cbc:Amount>
        </cac:AllowanceCharge>
        <cac:TaxTotal>
          <cbc:TaxAmount currencyID="TRY">90.00</cbc:TaxAmount>
          <cac:TaxSubtotal>
            <cbc:TaxableAmount currencyID="TRY">1000.00</cbc:TaxableAmount>
            <cbc:TaxAmount currencyID="TRY">180.00</cbc:TaxAmount>
            <cbc:CalculationSequenceNumeric>1</cbc:CalculationSequenceNumeric>
            <cbc:Percent>18</cbc:Percent>
            <cac:TaxCategory>
              <cac:TaxScheme>
                <cbc:Name>KDV</cbc:Name>
                <cbc:TaxTypeCode>0015</cbc:TaxTypeCode>
              </cac:TaxScheme>
            </cac:TaxCategory>
          </cac:TaxSubtotal>
        </cac:TaxTotal>
        <cac:WithholdingTaxTotal>
          <cbc:TaxAmount currencyID="TRY">90.00</cbc:TaxAmount>
          <cac:TaxSubtotal>
            <cbc:TaxableAmount currencyID="TRY">180.00</cbc:TaxableAmount>
            <cbc:TaxAmount currencyID="TRY">90.00</cbc:TaxAmount>
            <cbc:CalculationSequenceNumeric>1</cbc:CalculationSequenceNumeric>
            <cbc:Percent>50</cbc:Percent>
            <cac:TaxCategory>
              <cac:TaxScheme>
                <cbc:Name>Yemek servis hizmeti</cbc:Name>
                <cbc:TaxTypeCode>604</cbc:TaxTypeCode>
              </cac:TaxScheme>
            </cac:TaxCategory>
          </cac:TaxSubtotal>
        </cac:WithholdingTaxTotal>
        <cac:LegalMonetaryTotal>
          <cbc:LineExtensionAmount currencyID="TRY">1000.00</cbc:LineExtensionAmount>
          <cbc:TaxExclusiveAmount currencyID="TRY">1000.00</cbc:TaxExclusiveAmount>
          <cbc:TaxInclusiveAmount currencyID="TRY">1180.00</cbc:TaxInclusiveAmount>
          <cbc:AllowanceTotalAmount currencyID="TRY">0.00</cbc:AllowanceTotalAmount>
          <cbc:ChargeTotalAmount currencyID="TRY">0.00</cbc:ChargeTotalAmount>
          <cbc:PayableAmount currencyID="TRY">1090.00</cbc:PayableAmount>
        </cac:LegalMonetaryTotal>
        <cac:InvoiceLine>
          <cbc:ID>1</cbc:ID>
          <cbc:Note />
          <cbc:InvoicedQuantity unitCode="NIU">1</cbc:InvoicedQuantity>
          <cbc:LineExtensionAmount currencyID="TRY">1000.00</cbc:LineExtensionAmount>
          <cac:AllowanceCharge>
            <cbc:ChargeIndicator>false</cbc:ChargeIndicator>
            <cbc:MultiplierFactorNumeric>0</cbc:MultiplierFactorNumeric>
            <cbc:SequenceNumeric>1</cbc:SequenceNumeric>
            <cbc:Amount currencyID="TRY">0.00</cbc:Amount>
            <cbc:BaseAmount currencyID="TRY">1000</cbc:BaseAmount>
          </cac:AllowanceCharge>
          <cac:TaxTotal>
            <cbc:TaxAmount currencyID="TRY">90.00</cbc:TaxAmount>
            <cac:TaxSubtotal>
              <cbc:TaxableAmount currencyID="TRY">1000.00</cbc:TaxableAmount>
              <cbc:TaxAmount currencyID="TRY">180.00</cbc:TaxAmount>
              <cbc:CalculationSequenceNumeric>1</cbc:CalculationSequenceNumeric>
              <cbc:Percent>18</cbc:Percent>
              <cac:TaxCategory>
                <cac:TaxScheme>
                  <cbc:Name>KDV</cbc:Name>
                  <cbc:TaxTypeCode>0015</cbc:TaxTypeCode>
                </cac:TaxScheme>
              </cac:TaxCategory>
            </cac:TaxSubtotal>
          </cac:TaxTotal>
          <cac:WithholdingTaxTotal>
            <cbc:TaxAmount currencyID="TRY">90.00</cbc:TaxAmount>
            <cac:TaxSubtotal>
              <cbc:TaxableAmount currencyID="TRY">180.00</cbc:TaxableAmount>
              <cbc:TaxAmount currencyID="TRY">90.00</cbc:TaxAmount>
              <cbc:CalculationSequenceNumeric>1</cbc:CalculationSequenceNumeric>
              <cbc:Percent>50</cbc:Percent>
              <cac:TaxCategory>
                <cac:TaxScheme>
                  <cbc:Name>Yemek servis hizmeti</cbc:Name>
                  <cbc:TaxTypeCode>604</cbc:TaxTypeCode>
                </cac:TaxScheme>
              </cac:TaxCategory>
            </cac:TaxSubtotal>
          </cac:WithholdingTaxTotal>
          <cac:Item>
            <cbc:Name>Sadece Tevkifat</cbc:Name>
          </cac:Item>
          <cac:Price>
            <cbc:PriceAmount currencyID="TRY">1000</cbc:PriceAmount>
          </cac:Price>
        </cac:InvoiceLine>
      </Invoice>';

    //$Row['templateType'] = 'salesOrder';
    $invoiceName = 'SO12345.xml';

    $dom = new DOMDocument;
    $dom->preserveWhiteSpace = FALSE;
    $dom->loadXML($xml_string);

    //$basePath = UPLOAD_PATH . 'attachments/';
    //$file_url = $basePath . $invoiceName;
    //Save XML as a file
    //$dom->save($file_url);

    $username = 'wahmet';
    $password = '123+Test';

    $url = 'https://efaturatest.innova.com.tr/ClientInterfaceService?singlewsdl';
    $headers = array(
    "Content-type:  application/xml;charset=\"utf-8\"",
    "Accept: application/xml",
    "Cache-Control: no-cache",
    "Pragma: no-cache",
    'Authorization: Basic '. base64_encode($username.':'.$password),
    );
    $CURL = curl_init();

    curl_setopt($CURL, CURLOPT_URL, $url);
    curl_setopt($CURL, CURLOPT_POST, 1);
    curl_setopt($CURL, CURLOPT_POSTFIELDS, base64_encode($xml_string));
    curl_setopt($CURL, CURLOPT_HEADER, 1);
    curl_setopt($CURL, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($CURL, CURLOPT_RETURNTRANSFER, true);

    curl_setopt($CURL, CURLOPT_HTTPHEADER, $headers);
    //curl_setopt($CURL, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);

    $xmlResponse = curl_exec($CURL);

    $curlInfo = curl_getinfo($CURL, CURLINFO_HTTP_CODE);

      $errors = curl_error($CURL);

        var_dump($xmlResponse);
        //echo 'info=';print_r($curlInfo);
        //echo 'error=';print_r($errors);exit;

        curl_close ($CURL);
        ?>
        Response:
        "HTTP/1.1 415 Cannot process the message because the content type 'application/xml;charset="utf-8"' was not the expected type 'text/xml; charset=utf-8'. Content-Length: 0 Server: Microsoft-HTTPAPI/2.0 Date: Fri, 29 May 2020 09:33:42 GMT "
</code>```

答:
As text/xml;charset=utf-8 is the Content-Type expected by the server, you should replace :

```<code>"Content-type:  application/xml;charset=\"utf-8\"",
</code>```

by :

```<code>"Content-type:  text/xml;charset=utf-8",
</code>```

in the curl request headers.

Body:
I Called a soap service which was developed in c# and I am implementing it in MY PHP code, I am getting this error "HTTP/1.1 415 Cannot process the message because the content type 'application/xml;charset="utf-8"' was not the expected type 'text/xml; charset=utf-8'.".

Please help me how can I resolve this issue?

Here is my code.

    <?php
    $xml_string = '<?xml version="1.0" encoding="UTF-8"?>
    <Invoice xmlns:ubltr="urn:oasis:names:specification:ubl:schema:xsd:TurkishCustomizationExtensionComponents" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xsi:schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 UBL-Invoice-2.1.xsd" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
        <ext:UBLExtensions>
          <ext:UBLExtension>
            <ext:ExtensionContent><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature_INN2020000004738">
      <ds:SignedInfo>
      <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
      <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
      <ds:Reference Id="Reference-Id-fbfd9b87-0852-47e8-9fe0-43967645102c" URI="#Signed-Properties-Id-ff550d10-a81d-4ce5-943c-89d50061cc19" Type="http://uri.etsi.org/01903#SignedProperties">
      <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
      <ds:DigestValue>G3wTvli8QJrLgjxMLCkK1c7MGjzmTMwKVSzvHMg9Odg=</ds:DigestValue>
      </ds:Reference>
      <ds:Reference Id="Reference-Id-3f25e0e0-2e7e-462c-8b9e-7b73bc6c7119" URI="">
      <ds:Transforms>
      <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
      </ds:Transforms>
      <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
      <ds:DigestValue>StpFdOkLqURx7QnNqftBTzlDBL2isDBD10av/ttVTL0=</ds:DigestValue>
      </ds:Reference>
      </ds:SignedInfo>
      <ds:SignatureValue Id="Signature-Value-Id-7823ee32-b522-4b0a-b022-1d49eaa13d7f">qba6lrTyBvJk1nuTGQ9atoJE5F3ku9mwkrradJKZ6YMJX5ccu1VhzS3FfryFBqfJYI1Xqt+uqQ6j7o5N1yI1RHfmL7PNK3mjOU1UBNSMwf3dJPhDxAegwZkwaAx5tTWIu8T/vO3mZQmX7ZJqLzvmw/1bnk1VrswrzewbfjCha5RajIUDV5a/K4hX6b+N9LENta/cPEoTtc76UTQS3QHzPyFc8r1/Te8sPmpRWTdmNIAnye8BHHKMAodRf3hWfgNfwnUwfzBpa3H6DJGGGzjH4EkzR7clN8D3GYKU4V3U3Xi3dBkv9+fZSJMpb5LzceRwGZcNvVINMig57SVt5MEkWg==</ds:SignatureValue>
      <ds:KeyInfo>
      <ds:KeyValue>
      <ds:RSAKeyValue>
      <ds:Modulus>yIBUILxPZ0ZffJGtlAOXP9jBGcf8gfqd4UXMzpFqpMcGXikuoDA1bBrcyXYOJEQyz5irike1cVKBUdiLvtqDVItPoWxGJqP2yumc7nFcUUYwpsTVXFdLQwQNhFCairzjRWLoCyWrMKU81wWc+N/WrdEHIhMzR9IKKcne8J/OswPldWAxNjFJMiVh9pvx0Oi1rKxyCGmQxqaqOY1yY1vSS/J+l4voY44cshN0rq+rYBic2RSZpMVZIxlHGWmNiFHXRXfBPihFtg67BkubZw9IQ6ZlqmtzYARr/d0tcv0GEfGqNILixxbxSnLSZ5zsSVqpq6BVTDxbs7Ho4CeUpkABvw==</ds:Modulus>
      <ds:Exponent>AQAB</ds:Exponent>
      </ds:RSAKeyValue>
      </ds:KeyValue>
      <ds:X509Data>
      <ds:X509Certificate>MIIFrDCCBJSgAwIBAgIHCCnDYwP6+zANBgkqhkiG9w0BAQsFADBcMQswCQYDVQQGEwJUUjFNMEsGA1UEAwxETWFsaSBNw7xow7xyIEVsZWt0cm9uaWsgU2VydGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLEgLSBTw7xyw7xtIDIwHhcNMTcxMTI5MDgzMTEyWhcNMjAxMTI4MDgzMTEyWjBUMRMwEQYDVQQFEwo0NzgwMTYzODMxMT0wOwYDVQQDDDTEsE5OT1ZBIELEsEzEsMWexLBNIMOHw5Zaw5xNTEVSxLAgQU5PTsSwTSDFnsSwUktFVMSwMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyIBUILxPZ0ZffJGtlAOXP9jBGcf8gfqd4UXMzpFqpMcGXikuoDA1bBrcyXYOJEQyz5irike1cVKBUdiLvtqDVItPoWxGJqP2yumc7nFcUUYwpsTVXFdLQwQNhFCairzjRWLoCyWrMKU81wWc+N/WrdEHIhMzR9IKKcne8J/OswPldWAxNjFJMiVh9pvx0Oi1rKxyCGmQxqaqOY1yY1vSS/J+l4voY44cshN0rq+rYBic2RSZpMVZIxlHGWmNiFHXRXfBPihFtg67BkubZw9IQ6ZlqmtzYARr/d0tcv0GEfGqNILixxbxSnLSZ5zsSVqpq6BVTDxbs7Ho4CeUpkABvwIDAQABo4ICeTCCAnUwHwYDVR0jBBgwFoAUA4T6lzHn9IcZL2Ur4bQbY6evdb4wHQYDVR0OBBYEFMOPW9KDTpQT4l3RHZgk49E82cXAMA4GA1UdDwEB/wQEAwIHgDCCATMGA1UdIASCASowggEmMIIBIgYLYIYYAQIBAQUHBAEwggERMCoGCCsGAQUFBwIBFh5odHRwOi8vZGVwby5rYW11c20uZ292LnRyL2lsa2UwgeIGCCsGAQUFBwICMIHVHoHSAEIAdQAgAHMAZQByAHQAaQBmAGkAawBhACAAaQBsAGUAIABpAGwAZwBpAGwAaQAgAHMAZQByAHQAaQBmAGkAawBhACAAdQB5AGcAdQBsAGEAbQBhACAAZQBzAGEAcwBsAGEAcgExAG4BMQAgAG8AawB1AG0AYQBrACAAaQDnAGkAbgAgAGIAZQBsAGkAcgB0AGkAbABlAG4AIAB3AGUAYgAgAHMAaQB0AGUAcwBpAG4AaQAgAHoAaQB5AGEAcgBlAHQAIABlAGQAaQBuAGkAegAuMAwGA1UdEwEB/wQCMAAwFgYDVR0lBA8wDQYLYIYYAQIBAQUHMgEwQQYDVR0fBDowODA2oDSgMoYwaHR0cDovL2RlcG8ua2FtdXNtLmdvdi50ci9rdXJ1bXNhbC9tbWVzaHMtczIuY3JsMIGCBggrBgEFBQcBAQR2MHQwPAYIKwYBBQUHMAKGMGh0dHA6Ly9kZXBvLmthbXVzbS5nb3YudHIva3VydW1zYWwvbW1lc2hzLXMyLmNydDA0BggrBgEFBQcwAYYoaHR0cDovL2Npc2R1cG1tczIua3VydW1zYWwua2FtdXNtLmdvdi50cjANBgkqhkiG9w0BAQsFAAOCAQEAhhYuCI0NvHiqO/0fdQHki6NIm5Dn/PsfN9T6mEFbXKOjiwx6zNPBnDoF7N3c63Konw6r07Jnho8oryiB1xFf1iahRvd1DliClFboq81SXJlVf0aQzaw9Opi8D7FRqWFBtIbjPu+ME73zNjt3skmN6OupQRZjIQmRmtZdYCt7OCf13PKdz4cYd3fnTLHtHMb1K8s43P0Ev+KzalXxwh0P6C0PnYoso9s4IV8wRFwqIn3FfT71U38hGfPcCnkOFhhwNzf5xDdRpwxhG9uZFNZhCx1TjmkSsTMApMu57AT8Q6L8o8qAtWTzJMfMMyAqV2gfGXVblDnuUrHEV2zDkie0Lw==</ds:X509Certificate>
      <ds:X509SubjectName>CN=İNNOVA BİLİŞİM ÇÖZÜMLERİ ANONİM ŞİRKETİ,SERIALNUMBER=4780163831</ds:X509SubjectName>
      </ds:X509Data>
      </ds:KeyInfo>
      <ds:Object Id="Object-Id-885f4d52-fed0-4ad2-b298-93850cdc874c"><xades:QualifyingProperties xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" Target="Signature_INN2020000004738">
      <xades:SignedProperties Id="Signed-Properties-Id-ff550d10-a81d-4ce5-943c-89d50061cc19">
      <xades:SignedSignatureProperties>
      <xades:SigningTime>2020-05-07T12:20:52.0792734+03:00</xades:SigningTime>
      <xades:SigningCertificate>
      <xades:Cert>
      <xades:CertDigest>
      <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
      <ds:DigestValue>VCgHJeCh7rKyUChRRRSEn90raVcNP3pavlk/NifKd9g=</ds:DigestValue>
      </xades:CertDigest>
      <xades:IssuerSerial>
      <ds:X509IssuerName>CN=Mali Mühür Elektronik Sertifika Hizmet Sağlayıcısı - Sürüm 2,C=TR</ds:X509IssuerName>
      <ds:X509SerialNumber>2297718970252027</ds:X509SerialNumber>
      </xades:IssuerSerial>
      </xades:Cert>
      </xades:SigningCertificate>
      </xades:SignedSignatureProperties>
      <xades:SignedDataObjectProperties>
      <xades:DataObjectFormat ObjectReference="#Reference-Id-3f25e0e0-2e7e-462c-8b9e-7b73bc6c7119">
      <xades:MimeType>text/xml</xades:MimeType>
      </xades:DataObjectFormat>
      </xades:SignedDataObjectProperties>
      </xades:SignedProperties>
      </xades:QualifyingProperties>
      </ds:Object>
      </ds:Signature></ext:ExtensionContent>
          </ext:UBLExtension>
        </ext:UBLExtensions>
        <cbc:UBLVersionID>2.1</cbc:UBLVersionID>
        <cbc:CustomizationID>TR1.2</cbc:CustomizationID>
        <cbc:ProfileID>TICARIFATURA</cbc:ProfileID>
        <cbc:ID>INN2020000004738</cbc:ID>
        <cbc:CopyIndicator>false</cbc:CopyIndicator>
        <cbc:UUID>18FF00EA-9F5F-4713-98E6-7E61353DD749</cbc:UUID>
        <cbc:IssueDate>2020-01-08</cbc:IssueDate>
        <cbc:IssueTime>13:00:00.0000000+03:00</cbc:IssueTime>
        <cbc:InvoiceTypeCode>TEVKIFAT</cbc:InvoiceTypeCode>
        <cbc:Note>YALNIZ  BİN DOKSAN TL SIFIR KURUŞ</cbc:Note>
        <cbc:DocumentCurrencyCode listID="ISO 4217 Alpha" listAgencyName="United Nations Economic Commission for Europe" listName="Currency" listVersionID="2001">TRY</cbc:DocumentCurrencyCode>
        <cbc:LineCountNumeric>1</cbc:LineCountNumeric>
        <cac:AdditionalDocumentReference>
          <cbc:ID>7D09D503-0E91-4CF0-A40D-6D075C8A0DD1</cbc:ID>
          <cbc:IssueDate>2020-01-08</cbc:IssueDate>

        </cac:AdditionalDocumentReference>
        <cac:Signature>
          <cbc:ID schemeID="VKN_TCKN">4780163831</cbc:ID>
          <cac:SignatoryParty>
            <cbc:WebsiteURI>www.innova.com.tr</cbc:WebsiteURI>
            <cac:PartyIdentification>
              <cbc:ID schemeID="VKN">4780163831</cbc:ID>
            </cac:PartyIdentification>
            <cac:PartyName>
              <cbc:Name>İnnova Bilişim Çözümleri A.Ş.</cbc:Name>
            </cac:PartyName>
            <cac:PostalAddress>
              <cbc:Room>1</cbc:Room>
              <cbc:StreetName>Ayazağa Caddesi</cbc:StreetName>
              <cbc:BuildingName>Arı 4</cbc:BuildingName>
              <cbc:BuildingNumber>2</cbc:BuildingNumber>
              <cbc:CitySubdivisionName>MASLAK</cbc:CitySubdivisionName>
              <cbc:CityName>İSTANBUL</cbc:CityName>
              <cbc:PostalZone>34469</cbc:PostalZone>
              <cac:Country>
                <cbc:Name>Türkiye</cbc:Name>
              </cac:Country>
            </cac:PostalAddress>
          </cac:SignatoryParty>
          <cac:DigitalSignatureAttachment>
            <cac:ExternalReference>
              <cbc:URI>#Signature_INN2020000004738</cbc:URI>
            </cac:ExternalReference>
          </cac:DigitalSignatureAttachment>
        </cac:Signature>
        <cac:AccountingSupplierParty>
          <cac:Party>
            <cbc:WebsiteURI>www.innova.com.tr</cbc:WebsiteURI>
            <cac:PartyIdentification>
              <cbc:ID schemeID="VKN">4780163831</cbc:ID>
            </cac:PartyIdentification>
            <cac:PartyIdentification>
              <cbc:ID schemeID="TICARETSICILNO">231345</cbc:ID>
            </cac:PartyIdentification>
            <cac:PartyIdentification>
              <cbc:ID schemeID="MERSISNO">777777777778</cbc:ID>
            </cac:PartyIdentification>
            <cac:PartyName>
              <cbc:Name>İnnova Bilişim Çözümleri A.Ş.</cbc:Name>
            </cac:PartyName>
            <cac:PostalAddress>
              <cbc:Room>1</cbc:Room>
              <cbc:StreetName>Ayazağa Caddesi</cbc:StreetName>
              <cbc:BuildingName>Arı 4</cbc:BuildingName>
              <cbc:BuildingNumber>2</cbc:BuildingNumber>
              <cbc:CitySubdivisionName>MASLAK</cbc:CitySubdivisionName>
              <cbc:CityName>İSTANBUL</cbc:CityName>
              <cbc:PostalZone>34469</cbc:PostalZone>
              <cac:Country>
                <cbc:Name>Türkiye</cbc:Name>
              </cac:Country>
            </cac:PostalAddress>
            <cac:PartyTaxScheme>
              <cac:TaxScheme>
                <cbc:Name>Boğaziçi Kurumlar Vergi Dairesi</cbc:Name>
              </cac:TaxScheme>
            </cac:PartyTaxScheme>
            <cac:Contact>
              <cbc:Telephone>2123297000</cbc:Telephone>
              <cbc:Telefax>2122864402</cbc:Telefax>
              <cbc:ElectronicMail>yalkis@innova.com.tr</cbc:ElectronicMail>
            </cac:Contact>
          </cac:Party>
        </cac:AccountingSupplierParty>
        <cac:AccountingCustomerParty>
          <cac:Party>
            <cac:PartyIdentification>
              <cbc:ID schemeID="VKN">4780163831</cbc:ID>
            </cac:PartyIdentification>
            <cac:PartyName>
              <cbc:Name>İnnova Bilişim Çözümleri A.Ş.</cbc:Name>
            </cac:PartyName>
            <cac:PostalAddress>
              <cbc:CitySubdivisionName>Semt/İlçe</cbc:CitySubdivisionName>
              <cbc:CityName>Şehir</cbc:CityName>
              <cbc:PostalZone />
              <cbc:Region>Semt/İlçe</cbc:Region>
              <cac:Country>
                <cbc:Name>Ülke</cbc:Name>
              </cac:Country>
            </cac:PostalAddress>
            <cac:PartyTaxScheme>
              <cac:TaxScheme>
                <cbc:Name>Vergi Dairesi</cbc:Name>
              </cac:TaxScheme>
            </cac:PartyTaxScheme>
            <cac:Contact>
              <cbc:ElectronicMail>yalkis@innova.com.tr</cbc:ElectronicMail>
            </cac:Contact>
          </cac:Party>
        </cac:AccountingCustomerParty>
        <cac:AllowanceCharge>
          <cbc:ChargeIndicator>false</cbc:ChargeIndicator>
          <cbc:MultiplierFactorNumeric>0</cbc:MultiplierFactorNumeric>
          <cbc:SequenceNumeric>1</cbc:SequenceNumeric>
          <cbc:Amount currencyID="TRY">0.00</cbc:Amount>
        </cac:AllowanceCharge>
        <cac:TaxTotal>
          <cbc:TaxAmount currencyID="TRY">90.00</cbc:TaxAmount>
          <cac:TaxSubtotal>
            <cbc:TaxableAmount currencyID="TRY">1000.00</cbc:TaxableAmount>
            <cbc:TaxAmount currencyID="TRY">180.00</cbc:TaxAmount>
            <cbc:CalculationSequenceNumeric>1</cbc:CalculationSequenceNumeric>
            <cbc:Percent>18</cbc:Percent>
            <cac:TaxCategory>
              <cac:TaxScheme>
                <cbc:Name>KDV</cbc:Name>
                <cbc:TaxTypeCode>0015</cbc:TaxTypeCode>
              </cac:TaxScheme>
            </cac:TaxCategory>
          </cac:TaxSubtotal>
        </cac:TaxTotal>
        <cac:WithholdingTaxTotal>
          <cbc:TaxAmount currencyID="TRY">90.00</cbc:TaxAmount>
          <cac:TaxSubtotal>
            <cbc:TaxableAmount currencyID="TRY">180.00</cbc:TaxableAmount>
            <cbc:TaxAmount currencyID="TRY">90.00</cbc:TaxAmount>
            <cbc:CalculationSequenceNumeric>1</cbc:CalculationSequenceNumeric>
            <cbc:Percent>50</cbc:Percent>
            <cac:TaxCategory>
              <cac:TaxScheme>
                <cbc:Name>Yemek servis hizmeti</cbc:Name>
                <cbc:TaxTypeCode>604</cbc:TaxTypeCode>
              </cac:TaxScheme>
            </cac:TaxCategory>
          </cac:TaxSubtotal>
        </cac:WithholdingTaxTotal>
        <cac:LegalMonetaryTotal>
          <cbc:LineExtensionAmount currencyID="TRY">1000.00</cbc:LineExtensionAmount>
          <cbc:TaxExclusiveAmount currencyID="TRY">1000.00</cbc:TaxExclusiveAmount>
          <cbc:TaxInclusiveAmount currencyID="TRY">1180.00</cbc:TaxInclusiveAmount>
          <cbc:AllowanceTotalAmount currencyID="TRY">0.00</cbc:AllowanceTotalAmount>
          <cbc:ChargeTotalAmount currencyID="TRY">0.00</cbc:ChargeTotalAmount>
          <cbc:PayableAmount currencyID="TRY">1090.00</cbc:PayableAmount>
        </cac:LegalMonetaryTotal>
        <cac:InvoiceLine>
          <cbc:ID>1</cbc:ID>
          <cbc:Note />
          <cbc:InvoicedQuantity unitCode="NIU">1</cbc:InvoicedQuantity>
          <cbc:LineExtensionAmount currencyID="TRY">1000.00</cbc:LineExtensionAmount>
          <cac:AllowanceCharge>
            <cbc:ChargeIndicator>false</cbc:ChargeIndicator>
            <cbc:MultiplierFactorNumeric>0</cbc:MultiplierFactorNumeric>
            <cbc:SequenceNumeric>1</cbc:SequenceNumeric>
            <cbc:Amount currencyID="TRY">0.00</cbc:Amount>
            <cbc:BaseAmount currencyID="TRY">1000</cbc:BaseAmount>
          </cac:AllowanceCharge>
          <cac:TaxTotal>
            <cbc:TaxAmount currencyID="TRY">90.00</cbc:TaxAmount>
            <cac:TaxSubtotal>
              <cbc:TaxableAmount currencyID="TRY">1000.00</cbc:TaxableAmount>
              <cbc:TaxAmount currencyID="TRY">180.00</cbc:TaxAmount>
              <cbc:CalculationSequenceNumeric>1</cbc:CalculationSequenceNumeric>
              <cbc:Percent>18</cbc:Percent>
              <cac:TaxCategory>
                <cac:TaxScheme>
                  <cbc:Name>KDV</cbc:Name>
                  <cbc:TaxTypeCode>0015</cbc:TaxTypeCode>
                </cac:TaxScheme>
              </cac:TaxCategory>
            </cac:TaxSubtotal>
          </cac:TaxTotal>
          <cac:WithholdingTaxTotal>
            <cbc:TaxAmount currencyID="TRY">90.00</cbc:TaxAmount>
            <cac:TaxSubtotal>
              <cbc:TaxableAmount currencyID="TRY">180.00</cbc:TaxableAmount>
              <cbc:TaxAmount currencyID="TRY">90.00</cbc:TaxAmount>
              <cbc:CalculationSequenceNumeric>1</cbc:CalculationSequenceNumeric>
              <cbc:Percent>50</cbc:Percent>
              <cac:TaxCategory>
                <cac:TaxScheme>
                  <cbc:Name>Yemek servis hizmeti</cbc:Name>
                  <cbc:TaxTypeCode>604</cbc:TaxTypeCode>
                </cac:TaxScheme>
              </cac:TaxCategory>
            </cac:TaxSubtotal>
          </cac:WithholdingTaxTotal>
          <cac:Item>
            <cbc:Name>Sadece Tevkifat</cbc:Name>
          </cac:Item>
          <cac:Price>
            <cbc:PriceAmount currencyID="TRY">1000</cbc:PriceAmount>
          </cac:Price>
        </cac:InvoiceLine>
      </Invoice>';

    //$Row['templateType'] = 'salesOrder';
    $invoiceName = 'SO12345.xml';

    $dom = new DOMDocument;
    $dom->preserveWhiteSpace = FALSE;
    $dom->loadXML($xml_string);

    //$basePath = UPLOAD_PATH . 'attachments/';
    //$file_url = $basePath . $invoiceName;
    //Save XML as a file
    //$dom->save($file_url);

    $username = 'wahmet';
    $password = '123+Test';

    $url = 'https://efaturatest.innova.com.tr/ClientInterfaceService?singlewsdl';
    $headers = array(
    "Content-type:  application/xml;charset=\"utf-8\"",
    "Accept: application/xml",
    "Cache-Control: no-cache",
    "Pragma: no-cache",
    'Authorization: Basic '. base64_encode($username.':'.$password),
    );
    $CURL = curl_init();

    curl_setopt($CURL, CURLOPT_URL, $url);
    curl_setopt($CURL, CURLOPT_POST, 1);
    curl_setopt($CURL, CURLOPT_POSTFIELDS, base64_encode($xml_string));
    curl_setopt($CURL, CURLOPT_HEADER, 1);
    curl_setopt($CURL, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($CURL, CURLOPT_RETURNTRANSFER, true);

    curl_setopt($CURL, CURLOPT_HTTPHEADER, $headers);
    //curl_setopt($CURL, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);

    $xmlResponse = curl_exec($CURL);

    $curlInfo = curl_getinfo($CURL, CURLINFO_HTTP_CODE);

      $errors = curl_error($CURL);

        var_dump($xmlResponse);
        //echo 'info=';print_r($curlInfo);
        //echo 'error=';print_r($errors);exit;

        curl_close ($CURL);
        ?>
        Response:
        "HTTP/1.1 415 Cannot process the message because the content type 'application/xml;charset="utf-8"' was not the expected type 'text/xml; charset=utf-8'. Content-Length: 0 Server: Microsoft-HTTPAPI/2.0 Date: Fri, 29 May 2020 09:33:42 GMT "

Body:
As text/xml;charset=utf-8 is the Content-Type expected by the server, you should replace :

"Content-type:  application/xml;charset=\"utf-8\"",

by :

"Content-type:  text/xml;charset=utf-8",

in the curl request headers.


问:
Add latest Microsoft Edge (Win10) browser to Selenium Grid
Tried by adding the below code.

```<code>"capabilities": [
        {
            "browserName": "MicrosoftEdge",
            "platform": "WIN10",
            "maxInstances": 1
        },
]
</code>```

and passed it to command line

```<code>start java -Dwebdriver.edge.driver="../../Resources/Drivers/msedgedriver.exe" -jar "%SELSERV%" -role node -nodeConfig ..\ConfigFiles\NodeConfig.json
</code>```

I am getting the microsoft edge legacy

I need the latest microsoft edge (Based on chromium) in selenium grid.

答:
Latest Edge browser being chromium based, try using the below node configurations:

```<code>"capabilities": [
        {
            "browserName": "Chrome",
            "platform": "WIN10",
            "maxInstances": 1
        },
]
</code>```

And then execute the below command:

```<code>java -Dwebdriver.chrome.driver="../../Resources/Drivers/msedgedriver.exe" -jar "%SELSERV%" -role node -nodeConfig ..\ConfigFiles\NodeConfig.json
</code>```

Notice the webdriver.chrome.driver property being set to msedgedriver.exe file.

Body:
Tried by adding the below code.

"capabilities": [
        {
            "browserName": "MicrosoftEdge",
            "platform": "WIN10",
            "maxInstances": 1
        },
]

and passed it to command line

start java -Dwebdriver.edge.driver="../../Resources/Drivers/msedgedriver.exe" -jar "%SELSERV%" -role node -nodeConfig ..\ConfigFiles\NodeConfig.json

I am getting the microsoft edge legacy

I need the latest microsoft edge (Based on chromium) in selenium grid.

Body:
Latest Edge browser being chromium based, try using the below node configurations:

"capabilities": [
        {
            "browserName": "Chrome",
            "platform": "WIN10",
            "maxInstances": 1
        },
]

And then execute the below command:

java -Dwebdriver.chrome.driver="../../Resources/Drivers/msedgedriver.exe" -jar "%SELSERV%" -role node -nodeConfig ..\ConfigFiles\NodeConfig.json

Notice the webdriver.chrome.driver property being set to msedgedriver.exe file.


问:
C++ menu sfml center all things
```<code>enter code sf::FloatRect textRect = text.getLocalBounds();
//Font
if(!font.loadFromFile("arial.ttf")){}

//Tło - trzeba załadować
if(!texture.loadFromFile("bg_menu.png")){}

//play
mainMenu[0].setFont(font);
mainMenu[0].setFillColor(sf::Color::Blue);
mainMenu[0].setString("Play");
mainMenu[0].setCharacterSize(40);
mainMenu[0].setPosition(sf::Vector2f(width / 2, hight / (Max_main_menu + 1)));
//center text (?)
mainMenu[0].setOrigin(textRect.left + textRect.width / 2.0f,
    textRect.top + textRect.height / 2.0f);
mainMenu[1].setOrigin(textRect.left + textRect.width / 2.0f,
    textRect.top + textRect.height / 2.0f);
mainMenu[2].setOrigin(textRect.left + textRect.width / 2.0f,
    textRect.top + textRect.height / 2.0f);
</code>```

Main menu :

```<code>enter main(){
RenderWindow window(VideoMode(SCREEN_HIGH, SCREEN_WIDTH), "Age of Ants!", Style::Close);
Main_menu menu(SCREEN_WIDTH, SCREEN_HIGH);
while (window.isOpen()) {
    sf::Event event;
    while (window.pollEvent(event)) {
        if (event.type == sf::Event::Closed)
            window.close();
        //Movin in Menu - Up&Down&Selecting start
        if (event.type == Event::KeyReleased) {
            if (event.key.code == Keyboard::Up) {
                menu.moveUP();
                break;
            }
            if (event.key.code == Keyboard::Down) {
                menu.moveDOWN();
                break;
            }
            if (event.key.code == Keyboard::Return) {
                switch (menu.mainMenuPressed()) {
                case 0:
                    cout << "Play button has been pressed" << endl;
                    break;
                case 1:
                    cout << "Options button has been pressed" << endl;
                    break;
                case 2:
                    window.close();
                    cout << "Exit button has been pressed" << endl;
                    break;
</code>```

enter image description here

I do not know how to center this menu,  I would like to bo center (on the middle) and looks like on the image I have attached. ][1] Seconde image is the menu right now - how it looks like...

答:
If you want to center any image or text then

```<code>sf::Vector2f position;
position.x = ((windowSize.x - imageSize.x) / 2.0f);
position.y = ((windowSize.y - imageSize.y) / 2.0f);
</code>```

This works for images whose origin to the topleft of the image

Title: C++ menu sfml center all things

Body:
enter code sf::FloatRect textRect = text.getLocalBounds();
//Font
if(!font.loadFromFile("arial.ttf")){}

//Tło - trzeba załadować
if(!texture.loadFromFile("bg_menu.png")){}

//play
mainMenu[0].setFont(font);
mainMenu[0].setFillColor(sf::Color::Blue);
mainMenu[0].setString("Play");
mainMenu[0].setCharacterSize(40);
mainMenu[0].setPosition(sf::Vector2f(width / 2, hight / (Max_main_menu + 1)));
//center text (?)
mainMenu[0].setOrigin(textRect.left + textRect.width / 2.0f,
    textRect.top + textRect.height / 2.0f);
mainMenu[1].setOrigin(textRect.left + textRect.width / 2.0f,
    textRect.top + textRect.height / 2.0f);
mainMenu[2].setOrigin(textRect.left + textRect.width / 2.0f,
    textRect.top + textRect.height / 2.0f);

Main menu :

enter main(){
RenderWindow window(VideoMode(SCREEN_HIGH, SCREEN_WIDTH), "Age of Ants!", Style::Close);
Main_menu menu(SCREEN_WIDTH, SCREEN_HIGH);
while (window.isOpen()) {
    sf::Event event;
    while (window.pollEvent(event)) {
        if (event.type == sf::Event::Closed)
            window.close();
        //Movin in Menu - Up&Down&Selecting start
        if (event.type == Event::KeyReleased) {
            if (event.key.code == Keyboard::Up) {
                menu.moveUP();
                break;
            }
            if (event.key.code == Keyboard::Down) {
                menu.moveDOWN();
                break;
            }
            if (event.key.code == Keyboard::Return) {
                switch (menu.mainMenuPressed()) {
                case 0:
                    cout << "Play button has been pressed" << endl;
                    break;
                case 1:
                    cout << "Options button has been pressed" << endl;
                    break;
                case 2:
                    window.close();
                    cout << "Exit button has been pressed" << endl;
                    break;

enter image description here

I do not know how to center this menu,  I would like to bo center (on the middle) and looks like on the image I have attached. ][1] Seconde image is the menu right now - how it looks like...

Body:
If you want to center any image or text then

sf::Vector2f position;
position.x = ((windowSize.x - imageSize.x) / 2.0f);
position.y = ((windowSize.y - imageSize.y) / 2.0f);

This works for images whose origin to the topleft of the image


问:
How to launch the atmx file programmatically in C#?
can someone please tell me why my line of code to execute an atmx file isn't working?
the code doesn't go further after opening the internet explorer :(

```<code>try
                    {
                        switch (status)
                        {
                            case true:
                                IWebDriver driver = new InternetExplorerDriver();
                                driver.Navigate().GoToUrl(@"http://www.rpachallenge.com/");

                                Console.WriteLine("get ATMX file...........");
                                string getATMX = String.Format("C:\\Users\\{0}\\Desktop\\VS Test Environment\\Testing.atmx", Environment.UserName);
                                Process.Start(getATMX);

                                SqlConnection connect = new SqlConnection();
                                connect.Open();
                                SqlCommand

</code>```

the atmx file get info from sql and fills the fields on rpachallenge.com, capture the ending result then saves in sql.

答:
Atmx file runs on AAPlayer.exe, if you have Automation Anywhere installed you can execute ATMX by invoking AAPlayer.exe with atmx file path.</p>

```<code>        Process p = new System.Diagnostics.Process();
        p.StartInfo.FileName = "C:\\Program Files (x86)\\Automation Anywhere\\Enterprise\\Client\\AAPlayer.exe";
        p.StartInfo.Arguments = "/fD:\\bots\\mybot.atmx";
        p.Start();
</code>```

Body:
can someone please tell me why my line of code to execute an atmx file isn't working?
the code doesn't go further after opening the internet explorer :(

try
                    {
                        switch (status)
                        {
                            case true:
                                IWebDriver driver = new InternetExplorerDriver();
                                driver.Navigate().GoToUrl(@"http://www.rpachallenge.com/");

                                Console.WriteLine("get ATMX file...........");
                                string getATMX = String.Format("C:\\Users\\{0}\\Desktop\\VS Test Environment\\Testing.atmx", Environment.UserName);
                                Process.Start(getATMX);

                                SqlConnection connect = new SqlConnection();
                                connect.Open();
                                SqlCommand

the atmx file get info from sql and fills the fields on rpachallenge.com, capture the ending result then saves in sql.

Body:
Atmx file runs on AAPlayer.exe, if you have Automation Anywhere installed you can execute ATMX by invoking AAPlayer.exe with atmx file path.

        Process p = new System.Diagnostics.Process();
        p.StartInfo.FileName = "C:\\Program Files (x86)\\Automation Anywhere\\Enterprise\\Client\\AAPlayer.exe";
        p.StartInfo.Arguments = "/fD:\\bots\\mybot.atmx";
        p.Start();