问:
TextField either phone number or Email format validation swift?
I having one text field for forgot password ,here user enter either mobile number or email then we send OTP to that.

I am trying to validations for that text field with my code but it is not working, any one give some idea on that please find my code with following.

It needs to valid for either mailid or Phone number format.

```<code>if emaiTF.text == "" {
            print("Enter either valid phone or email")
        }else if let validphone = emaiTF.text, validphone.isValidPhone() || validphone.isValidEmail() {
            print("Enter either valid phone or email")
        }else{
            forGotPasswordApi()
        }
</code>```

my validation methods like following.

```<code>extension String {
    func isValidEmail() -> Bool {
        // here, `try!` will always succeed because the pattern is valid
        let regex = try! NSRegularExpression(pattern: "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$", options: .caseInsensitive)
        return regex.firstMatch(in: self, options: [], range: NSRange(location: 0, length: count)) != nil
    }

    // vrify Valid PhoneNumber or Not
    func isValidPhone() -> Bool {

        let phoneRegex = "^[0-9]{10}$";
        let valid = NSPredicate(format: "SELF MATCHES %@", phoneRegex).evaluate(with: phoneRegex)
        return valid
    }
}
</code>```

答:
My Validation is:

```<code>extension String {

var isValidEmail: Bool {
    return NSPredicate(format: "SELF MATCHES %@", "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,3}").evaluate(with: self)
}
 var numberValidation: Bool {
    return NSPredicate(format: "SELF MATCHES %@", "^(?=.*[0-9]).{10}$").evaluate(with: self)
  }
}
</code>```

My code for checking give input

```<code>if mailTextField.text!.isValidEmail {
        print("u have entered correct mail format")
    }
if phonenumber.text!.numberValidation {
 print("mobile number in correct format")
}
</code>```

Body:
I having one text field for forgot password ,here user enter either mobile number or email then we send OTP to that.

I am trying to validations for that text field with my code but it is not working, any one give some idea on that please find my code with following.

It needs to valid for either mailid or Phone number format.

if emaiTF.text == "" {
            print("Enter either valid phone or email")
        }else if let validphone = emaiTF.text, validphone.isValidPhone() || validphone.isValidEmail() {
            print("Enter either valid phone or email")
        }else{
            forGotPasswordApi()
        }

my validation methods like following.

extension String {
    func isValidEmail() -> Bool {
        // here, `try!` will always succeed because the pattern is valid
        let regex = try! NSRegularExpression(pattern: "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$", options: .caseInsensitive)
        return regex.firstMatch(in: self, options: [], range: NSRange(location: 0, length: count)) != nil
    }

    // vrify Valid PhoneNumber or Not
    func isValidPhone() -> Bool {

        let phoneRegex = "^[0-9]{10}$";
        let valid = NSPredicate(format: "SELF MATCHES %@", phoneRegex).evaluate(with: phoneRegex)
        return valid
    }
}

Body:
My Validation is:

extension String {

var isValidEmail: Bool {
    return NSPredicate(format: "SELF MATCHES %@", "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,3}").evaluate(with: self)
}
 var numberValidation: Bool {
    return NSPredicate(format: "SELF MATCHES %@", "^(?=.*[0-9]).{10}$").evaluate(with: self)
  }
}

My code for checking give input

if mailTextField.text!.isValidEmail {
        print("u have entered correct mail format")
    }
if phonenumber.text!.numberValidation {
 print("mobile number in correct format")
}


来源: stackexchange

问:
How to read data from multiple microphones using Android's Oboe/AAudio
I'm interesting in accessing both microphone on a phone using the Android Oboe library. Most phones have a dual-mic configuration and I'd like to read data from both at the same time. I've extended the "LiveAffect" sample from Oboe, and tried the following:

Having two oboe::AudioStream, one for each microphone on my phone (Note 9 and Pixel 1). Running only one of the streams works fine, I'm able to read the data and play it back/save to file. But starting both streams doesn't work (I get the following error when attempting to start the second stream via stream->requestStart(): E/AUDIO-APP: Error starting stream. ErrorInvalidState). Apparently starting two input streams is an Android limitation as discussed in this SO question: Android Oboe Library: 2 streams recording from 2 recording devices possible?

Having one stream but with 2 channels. The two mics on my Note 9 are part of the same group, yet when I open a stream with either of them with 2 channels (->setChannelCount(oboe::ChannelCount::Stereo);), I get duplicate data in both channels for only one microphone. I've tried playing around with AudioStreamBuilder settings, for example setting ->setInputPreset(oboe::InputPreset::Camcorder). None of the InputPresets settings fixed it, still mirrored data in both channels.

Both attempts did not work using OpenSL backend either.

答:
The only way I could get a stereo input of both microphones (either AAUDIO or SLES ) on a Samsung S8 was to set:

```<code>builder->setDeviceId(0) // mandatory ! if set to the microphone id you get only one mic!
builder->setDirection(oboe::Direction::Input) // obvious
builder->setChannelCount(2) // obvious
builder->setFormat(oboe::AudioFormat::I16) // with oboe converter float should work to
builder->setInputPreset(oboe::InputPreset::Generic) // or oboe::InputPreset::Camcorder
builder->setUsage(oboe::Usage::Media) // unsure if this is ness.
</code>```

Odd thing I noticed, androids AudioManager.getDevices (AudioManager.GET_DEVICES_ALL) on this device returns a different list after you used the audio in mono ( 2 x TYPE_BUILTIN_MIC ) or stereo ( 1x TYPE_BUILTIN_MIC ) all having AudioDeviceInfo.getChannelCounts() list = [1,2] !

ContentLicense: CC BY-SA 4.0

Body:
The only way I could get a stereo input of both microphones (either AAUDIO or SLES ) on a Samsung S8 was to set:

builder->setDeviceId(0) // mandatory ! if set to the microphone id you get only one mic!
builder->setDirection(oboe::Direction::Input) // obvious
builder->setChannelCount(2) // obvious
builder->setFormat(oboe::AudioFormat::I16) // with oboe converter float should work to
builder->setInputPreset(oboe::InputPreset::Generic) // or oboe::InputPreset::Camcorder
builder->setUsage(oboe::Usage::Media) // unsure if this is ness.

Odd thing I noticed, androids AudioManager.getDevices (AudioManager.GET_DEVICES_ALL) on this device returns a different list after you used the audio in mono ( 2 x TYPE_BUILTIN_MIC ) or stereo ( 1x TYPE_BUILTIN_MIC ) all having AudioDeviceInfo.getChannelCounts() list = [1,2] !


问:
Protecting namespaces
This are my namespaces and classes in them.

MyProject
    ManagerClass
    ProjectClass
    UiClass

MyProject.Audio
    MusicManager
MyProject.Audio.DynamicMusic
    DynamicMusicSong
    DynamicMusicTrack
    DynamicMusicClip
```

Is there someway I can make the namespaces under Audio only accessible to classes in Audio? I want them to be invisible for classes in MyProject, except the ones in the actual Audio namespace.

答:
For classes there are the access modifiers public and internal (see here)

public:
  The type or member can be accessed by any other code in the same assembly or another assembly that references it.

internal:
  The type or member can be accessed by any code in the same assembly, but not from another assembly.

A more fine-grained control is not possible*, hence you cannot declare visibility on a per-namepace level.

*This is not 100% percent true. There is a possibility to allow other assemblies to access internal types and methods, the InternalsVisibleToAttribute. Anyway, I'd advise you to use it with utter care, since you increase coupling between those assemblies. They will rely on the internals of each other, which will increase the likelyhood of an unstable codebase (more changes). I'm using the attributes solely for testing purposes.

Title: Protecting namespaces

Body:
This are my namespaces and classes in them.

MyProject
    ManagerClass
    ProjectClass
    UiClass

MyProject.Audio
    MusicManager
MyProject.Audio.DynamicMusic
    DynamicMusicSong
    DynamicMusicTrack
    DynamicMusicClip

Is there someway I can make the namespaces under Audio only accessible to classes in Audio? I want them to be invisible for classes in MyProject, except the ones in the actual Audio namespace.


问:
How to get String representation of XmlType?
Is it possible to convert a javax.xml.bind.annotation.XmlType to the String representation of the XML?

Example:

The following class Req is from a third party library so I can't override the toString() method.

```<code>@javax.xml.bind.annotation.XmlAccessorType(javax.xml.bind.annotation.XmlAccessType.FIELD)
@javax.xml.bind.annotation.XmlType(name = "req", propOrder = {"myDetails", "customerDetails"})
public class Req  {
...
}
</code>```

In my application I want to simply get a String representation of the XML so that I can log it to a file:

```<code><Req>
    <MyDetails>
    ...
    </MyDetails>
    <CustomerDetails>
    ...
    </CustomerDetails>
</Req>
</code>```

When I try to use JAXB and Marshall to convert to XML String:

```<code>JAXBContext context = JAXBContext.newInstance(Req.class);
Marshaller marshaller = context.createMarshaller();
StringWriter sw = new StringWriter();
marshaller.marshal(instanceOfReq, sw);
String xmlString = sw.toString();
</code>```

I get the following exception:

```<code>javax.xml.bind.MarshalException
    - with linked exception:
    [com.sun.istack.SAXException2: unable to marshal type "mypackage.Req" as an element because it is missing an @XmlRootElement annotation]
</code>```

I have had a look at the other classes within the third party library and none of them use the @XmlRootElement annotation. Any way around this?

答:
You can use JAXB and marshall it to xml string</p>

```<code>JAXBContext context = JAXBContext.newInstance(Req.class);
Marshaller marshaller = context.createMarshaller();
StringWriter sw = new StringWriter();
marshaller.marshal(instanceOfReq, sw);

String xmlString = sw.toString();
</code>```

ContentLicense: CC BY-SA 3.0

Body:
Is it possible to convert a javax.xml.bind.annotation.XmlType to the String representation of the XML?

Example:

The following class Req is from a third party library so I can't override the toString() method.

@javax.xml.bind.annotation.XmlAccessorType(javax.xml.bind.annotation.XmlAccessType.FIELD)
@javax.xml.bind.annotation.XmlType(name = "req", propOrder = {"myDetails", "customerDetails"})
public class Req  {
...
}

In my application I want to simply get a String representation of the XML so that I can log it to a file:

<Req>
    <MyDetails>
    ...
    </MyDetails>
    <CustomerDetails>
    ...
    </CustomerDetails>
</Req>

When I try to use JAXB and Marshall to convert to XML String:

JAXBContext context = JAXBContext.newInstance(Req.class);
Marshaller marshaller = context.createMarshaller();
StringWriter sw = new StringWriter();
marshaller.marshal(instanceOfReq, sw);
String xmlString = sw.toString();

I get the following exception:

javax.xml.bind.MarshalException
    - with linked exception:
    [com.sun.istack.SAXException2: unable to marshal type "mypackage.Req" as an element because it is missing an @XmlRootElement annotation]

I have had a look at the other classes within the third party library and none of them use the @XmlRootElement annotation. Any way around this?

Body:
You can use JAXB and marshall it to xml string

JAXBContext context = JAXBContext.newInstance(Req.class);
Marshaller marshaller = context.createMarshaller();
StringWriter sw = new StringWriter();
marshaller.marshal(instanceOfReq, sw);

String xmlString = sw.toString();


问:
Regex - Match word/letters underneath a specific pattern
Very unusual one but I'm trying to match output from an SSH session that may collapse view and fall underneath the output required (like a collapsed column)...

Take a look at the example output:

```<code>      System Id     Interface          Circuit Id        State HoldTime Type     PRI
--------------------------------------------------------------------------------
rtr1.lab01.some GE0/0/1            0000000001         Up   22s      L2       --
thing
rtr2.lab01.some GE0/0/2            0000000002         Up   24s      L2       --
thingelse
</code>```

I can match the the first line with:

^([a-zA-Z0-9][a-zA-Z0-9.-]+[a-zA-Z0-9])

which returns (rtr1.lab01.some and rtr2.lab01.some) but I'm trying to find the easiest way to match it based on the full hostname (rtr1.lab01.something and rtr2.lab01.somethingelse)

I'm also matching the rest of the output perfectly fine and able to extract the data but really can't find a way to achieve what I'm trying... Can someone point me in the right direction? To expand further (for more context... I'm using the Google TextFSM in Python to match all this data from an SSH session)

答:
```<code>import re

text = """System Id     Interface          Circuit Id        State HoldTime Type     PRI
--------------------------------------------------------------------------------
rtr1.lab01.some GE0/0/1            0000000001         Up   22s      L2       --
thing
rtr2.lab01.some GE0/0/2            0000000002         Up   24s      L2       --
thingelse
rtr2.lab01.abcd GE0/0/4            0000000003         Up   24s      L2       --
rtr2.lab01.none GE0/0/24           0000000004         Up   24s      L2       --
sense
rtr2.lab01.efgh GE0/0/5            0000000003         Up   24s      L2       --
"""

lines = text.rstrip().split('\n')[2:]
n_lines = len(lines)
current_line = -1

def get_next_line():
    # Actual implementation would be reading from a file and yielding lines one line at a time
    global n_lines, current_line, lines
    current_line += 1
    # return special sentinel if "end of file"
    return  lines[current_line] if current_line < n_lines else '$'

def get_system_id():
    line = None
    while line != '$': # loop until end of file
        if line is None: # no current line
            line = get_next_line()
            if line == '$': # end of file
                return
        m = re.search(r'^([a-zA-Z0-9][a-zA-Z0-9.-]+[a-zA-Z0-9])', line)
        id = m[1]
        line = get_next_line() # might be sentinel
        if line != '$' and re.match(r'^[a-zA-Z0-9]+$', line): # next line just single id?
            id += line
            line = None # will need new line
        yield id

for id in get_system_id():
    print(id)
</code>```

Prints:

```<code>rtr1.lab01.something
rtr2.lab01.somethingelse
rtr2.lab01.abcd
rtr2.lab01.nonesense
rtr2.lab01.efgh
</code>```

See Python Demo

Body:
Very unusual one but I'm trying to match output from an SSH session that may collapse view and fall underneath the output required (like a collapsed column)...

Take a look at the example output:

      System Id     Interface          Circuit Id        State HoldTime Type     PRI
--------------------------------------------------------------------------------
rtr1.lab01.some GE0/0/1            0000000001         Up   22s      L2       --
thing
rtr2.lab01.some GE0/0/2            0000000002         Up   24s      L2       --
thingelse

I can match the the first line with:

^([a-zA-Z0-9][a-zA-Z0-9.-]+[a-zA-Z0-9])

which returns (rtr1.lab01.some and rtr2.lab01.some) but I'm trying to find the easiest way to match it based on the full hostname (rtr1.lab01.something and rtr2.lab01.somethingelse)

I'm also matching the rest of the output perfectly fine and able to extract the data but really can't find a way to achieve what I'm trying... Can someone point me in the right direction? To expand further (for more context... I'm using the Google TextFSM in Python to match all this data from an SSH session)

Body:
import re

text = """System Id     Interface          Circuit Id        State HoldTime Type     PRI
--------------------------------------------------------------------------------
rtr1.lab01.some GE0/0/1            0000000001         Up   22s      L2       --
thing
rtr2.lab01.some GE0/0/2            0000000002         Up   24s      L2       --
thingelse
rtr2.lab01.abcd GE0/0/4            0000000003         Up   24s      L2       --
rtr2.lab01.none GE0/0/24           0000000004         Up   24s      L2       --
sense
rtr2.lab01.efgh GE0/0/5            0000000003         Up   24s      L2       --
"""

lines = text.rstrip().split('\n')[2:]
n_lines = len(lines)
current_line = -1

def get_next_line():
    # Actual implementation would be reading from a file and yielding lines one line at a time
    global n_lines, current_line, lines
    current_line += 1
    # return special sentinel if "end of file"
    return  lines[current_line] if current_line < n_lines else '$'

def get_system_id():
    line = None
    while line != '$': # loop until end of file
        if line is None: # no current line
            line = get_next_line()
            if line == '$': # end of file
                return
        m = re.search(r'^([a-zA-Z0-9][a-zA-Z0-9.-]+[a-zA-Z0-9])', line)
        id = m[1]
        line = get_next_line() # might be sentinel
        if line != '$' and re.match(r'^[a-zA-Z0-9]+$', line): # next line just single id?
            id += line
            line = None # will need new line
        yield id

for id in get_system_id():
    print(id)

Prints:

rtr1.lab01.something
rtr2.lab01.somethingelse
rtr2.lab01.abcd
rtr2.lab01.nonesense
rtr2.lab01.efgh

See Python Demo


问:
How to get the value of the last assert statement?
Is there an easy way to get the value of the last assert as boolean so I can avoid asking for it twice?

Example:

```<code>assert 1 == 2
status = ???? # how can i get the boolean value of the previous assert
</code>```

I do not want just as i want the nice reporting feature of assert in pytest

```<code>test = 1 == 2
assert test
</code>```

答:
Try this:</p>

```<code>def my_assert(input):
    try:
        assert input
        status = True
    except AssertionError:
        status = False
    return status

my_assert(1 == 2)
</code>```

Body:
Is there an easy way to get the value of the last assert as boolean so I can avoid asking for it twice?

Example:

assert 1 == 2
status = ???? # how can i get the boolean value of the previous assert

I do not want just as i want the nice reporting feature of assert in pytest

test = 1 == 2
assert test

Body:
Try this:

def my_assert(input):
    try:
        assert input
        status = True
    except AssertionError:
        status = False
    return status

my_assert(1 == 2)


问:
Python - loop through same query with different variables, merge data frames
I have a query in SAS where I use a Macro variable to repeat a query to Teradata with a different variable. We have 5 databases, one for each state, where I run the same query, but use the variable to update the state, then mend all data sets. I'm looking for help in how I can do this in python.

loop through {state1, state2, state3, state4, state5} and save each query as {stateX}_df then merge all

```<code>import teradata as td
import pandas as pd
from teradata import tdodbc

udaExec = td.UdaExec(appConfigFile="udaexec.ini")

with udaExec.connect("${dataSourceName}", LoginTimeout=120) as session:

query1 = """database my_db_{state1};"""

     query2 = """
                select  distinct
                {state1}, item_a, item_b
                from table

              """
    session.execute(query1)
    session.execute(query2)

    {stateX}_df = pd.read_sql(query2), session)
</code>```

答:
I was able to get this working on a single test query, which was really helpful so thank you @andrew madsen

What I have not solved yet is how to do this across multiple queries that I use. I have been reading about cursors and connections and I think that will get me there.

```<code>import teradata as td
import pandas as pd
from teradata import tdodbc

udaExec = td.UdaExec(appConfigFile="udaexec.ini")

with udaExec.connect("${dataSourceName}") as session:

    state_dataframes = []
    STATES = ["IL", "TX", "MT", "OK", "NM"]

    for state in STATES:

        sql = """
        select top 10
        '{}' as state
        ,a.*
         from my_db_{}.table a
        """.format(state,state)

    state_dataframes.append(pd.read_sql(sql, session))

    all_states_df = pd.concat(state_dataframes)
</code>```

Body:
I have a query in SAS where I use a Macro variable to repeat a query to Teradata with a different variable. We have 5 databases, one for each state, where I run the same query, but use the variable to update the state, then mend all data sets. I'm looking for help in how I can do this in python.

loop through {state1, state2, state3, state4, state5} and save each query as {stateX}_df then merge all

import teradata as td
import pandas as pd
from teradata import tdodbc

udaExec = td.UdaExec(appConfigFile="udaexec.ini")

with udaExec.connect("${dataSourceName}", LoginTimeout=120) as session:

query1 = """database my_db_{state1};"""

     query2 = """
                select  distinct
                {state1}, item_a, item_b
                from table

              """
    session.execute(query1)
    session.execute(query2)

    {stateX}_df = pd.read_sql(query2), session)

Body:
I was able to get this working on a single test query, which was really helpful so thank you @andrew madsen

What I have not solved yet is how to do this across multiple queries that I use. I have been reading about cursors and connections and I think that will get me there.

import teradata as td
import pandas as pd
from teradata import tdodbc

udaExec = td.UdaExec(appConfigFile="udaexec.ini")

with udaExec.connect("${dataSourceName}") as session:

    state_dataframes = []
    STATES = ["IL", "TX", "MT", "OK", "NM"]

    for state in STATES:

        sql = """
        select top 10
        '{}' as state
        ,a.*
         from my_db_{}.table a
        """.format(state,state)

    state_dataframes.append(pd.read_sql(sql, session))

    all_states_df = pd.concat(state_dataframes)


问:
Are custom preconditions valid for a move assignment operator?
Is it valid to place custom preconditions on the state of the move target in a move assignment operator? In particular, would it be valid to only allow moving to an object that has not been fully initialized before?

Consider:

```<code>struct Foo {
private:
  std::unique_ptr<int> value;

public:
  Foo(std::unique_ptr<int> value) : value{std::move(value)} {}

  Foo(Foo&&) noexcept = default;
  Foo &operator =(Foo&& other) noexcept {
    assert(!value);
    value = std::move(other.value);
    return *this;
  }
};
</code>```

I wonder, e.g., if this class can be used with a container, without hitting the assertion. E.g. if you do:

```<code>    std::vector<Foo> foo;
    foo.emplace_back(std::make_unique<int>(42));
    foo.emplace_back(std::make_unique<int>(17));
    Foo removed = std::move(foo[0]);
    foo.erase(foo.begin());
</code>```

Were this guaranteed to work with the class, or is this relying on implementation details of std::vector?

答:
Is it valid to place custom preconditions on the state of the move target in a move assignment operator?

Yes, but...

In particular, would it be valid to only allow moving to an object that has not been fully initialized before?

Sure, but...

Consider:

No problem so far, but...

```<code>std::vector<Foo> foo;
// ...
</code>```

You can do anything you want with your class until you use it with std-code (or somebody else's code) which puts requirements on your type.

For example the standard says this about vector::erase:

For vector and deque, T is Cpp17MoveAssignable.

And Cpp17MoveAssignable is defined here.

```<code>t = rv
</code>```

rv’s state is unspecified. [Note: rv must still meet the requirements of the library component that is using it, whether or not t and rv refer to the same object. The operations listed in those requirements must work as specified whether rv has been moved from or not. —end note]

Foo doesn't fully meet the Cpp17MoveAssignable requirements.  And that's fine as long as you don't expect Foo to work with code that requires Cpp17MoveAssignable.

Disclaimer:  A future standard might relax the requirements on vector::erase so as to allow Foo.  But that is not the case today.

Note that std::remove_if also requires Cpp17MoveAssignable:

http://eel.is/c++draft/alg.remove#2

And this slight modification of your program actually will assert:

```<code>#include <algorithm>
#include <cassert>
#include <memory>
#include <vector>

struct Foo {
private:
  std::unique_ptr<int> value;

public:
  Foo(std::unique_ptr<int> value) : value{std::move(value)} {}

  Foo(Foo&&) noexcept = default;
  Foo &operator =(Foo&& other) noexcept {
    assert(!value);
    value = std::move(other.value);
    return *this;
  }

  bool operator==(int i) const {return *value == i;}
};

int
main()
{
    std::vector<Foo> foo;
    foo.push_back(std::make_unique<int>(1));
    foo.push_back(std::make_unique<int>(2));
    foo.push_back(std::make_unique<int>(3));
    std::remove_if(foo.begin(), foo.end(),
        [](auto const& f) {return f == 1;});
}
</code>```

Body:
Is it valid to place custom preconditions on the state of the move target in a move assignment operator? In particular, would it be valid to only allow moving to an object that has not been fully initialized before?

Consider:

struct Foo {
private:
  std::unique_ptr<int> value;

public:
  Foo(std::unique_ptr<int> value) : value{std::move(value)} {}

  Foo(Foo&&) noexcept = default;
  Foo &operator =(Foo&& other) noexcept {
    assert(!value);
    value = std::move(other.value);
    return *this;
  }
};

I wonder, e.g., if this class can be used with a container, without hitting the assertion. E.g. if you do:

    std::vector<Foo> foo;
    foo.emplace_back(std::make_unique<int>(42));
    foo.emplace_back(std::make_unique<int>(17));
    Foo removed = std::move(foo[0]);
    foo.erase(foo.begin());

Were this guaranteed to work with the class, or is this relying on implementation details of std::vector?

Body:
Is it valid to place custom preconditions on the state of the move target in a move assignment operator?

Yes, but...

In particular, would it be valid to only allow moving to an object that has not been fully initialized before?

Sure, but...

Consider:

No problem so far, but...

std::vector<Foo> foo;
// ...

You can do anything you want with your class until you use it with std-code (or somebody else's code) which puts requirements on your type.

For example the standard says this about vector::erase:

For vector and deque, T is Cpp17MoveAssignable.

And Cpp17MoveAssignable is defined here.

t = rv

rv’s state is unspecified. [Note: rv must still meet the requirements of the library component that is using it, whether or not t and rv refer to the same object. The operations listed in those requirements must work as specified whether rv has been moved from or not. —end note]

Foo doesn't fully meet the Cpp17MoveAssignable requirements.  And that's fine as long as you don't expect Foo to work with code that requires Cpp17MoveAssignable.

Disclaimer:  A future standard might relax the requirements on vector::erase so as to allow Foo.  But that is not the case today.

Note that std::remove_if also requires Cpp17MoveAssignable:

http://eel.is/c++draft/alg.remove#2

And this slight modification of your program actually will assert:

#include <algorithm>
#include <cassert>
#include <memory>
#include <vector>

struct Foo {
private:
  std::unique_ptr<int> value;

public:
  Foo(std::unique_ptr<int> value) : value{std::move(value)} {}

  Foo(Foo&&) noexcept = default;
  Foo &operator =(Foo&& other) noexcept {
    assert(!value);
    value = std::move(other.value);
    return *this;
  }

  bool operator==(int i) const {return *value == i;}
};

int
main()
{
    std::vector<Foo> foo;
    foo.push_back(std::make_unique<int>(1));
    foo.push_back(std::make_unique<int>(2));
    foo.push_back(std::make_unique<int>(3));
    std::remove_if(foo.begin(), foo.end(),
        [](auto const& f) {return f == 1;});
}


问:
Building a multidimensional object of form values using loops
I have this form that calculates the value of the radio button checkbox and quantity. I want to loop the name and value of every checked or selected item into a multidimensional object array. I am using the storeArray function to do this but all i could do was this tab = {Apple: 1, Orange: 2, quantity: 7}

But I want to be able to do something like so..
tab = {name: Apple, value: 1,}{name:Orange, value: 2}{name: quantity, value: 7}. I tried my best, I guess I'm not doing it right.

function storeArray() {
  var tab = {};

  $('*[data-in="num"]:checked,#quantity').each(function() {
    tab[$(this).attr('name')] = parseInt($(this).val());
  });
  console.log(tab);
  return tab;
}

function validate(s) {
  //This is how we check that at least a checkbox is checked
  /*if($("input:checkbox:not(:checked)").length == $('input[type=checkbox]').length){
 $('#totalcost,#checkedcount').val(0);
  } else {*/
  $('#checkedcount').val(s);
  $('#totalcost').val((parseInt($('#quantity').val()) * s));
  $('#totalcount').val($('#quantity').val());
  //}
}

$('*[data-in="num"],#quantity').on('change', function() {
  var sum = 0;
  $('[data-in="num"]:checked').each(function() {
    sum += parseInt($(this).val());
  });
  validate(sum);
  myArray = storeArray();

  //myArray Object containing all input values
  //console.log(myArray);
  //This is how get the quantity for example
  //console.log(myArray['quantity']);

});```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<form>
  <div id="CheckBoxList">
    <label><input type="checkbox" id='game0' value="1" name="Apple" data-d="b" data-in="num">Apple</label>
    <label><input type="checkbox" id='game1' value="2" name="Orange" data-d="b" data-in="num">Orange</label>
    <label><input type="checkbox" id='game2' value="3" name="Pineaple" data-d="b" data-in="num">Pineaple</label>
    <label><input type="checkbox" id='game3' value="4" name="Lemon" data-d="b" data-in="num">Lemon</label>
    <label><input type="checkbox" id='game4' value="5" name="Mango" data-d="b" data-in="num">Mango</label>
  </div>
  <div id="RadioButtonList">
    <label><input type="radio" id='pad' value="6" data-d="b" name="HI" data-in="num">Small Cup</label>
    <label><input type="radio" id='pad1' value="7" data-d="b" name="HI" data-in="num">Medium Cup</label>
    <label><input type="radio" id='pad2' value="8" data-d="b" name="HI" data-in="num">Big Cup</label>
  </div>
  <div id="SelectOptions">
    <select name="quantity" id="quantity" data-d="b">
      <option value="0">Select quantity</option>
      <option value="1">1</option>
      <option value="2">2</option>
      <option value="3">3</option>
      <option value="4">4</option>
      <option value="5">5</option>
    </select>
  </div>
  <code id="demo"></code>
  total cost<input type="text" id="totalcost" value="">
  <br>total Checked<input type="text" id="checkedcount" value="">
  <br>total boxes<input type="text" id="totalcount" value="">
  <!-- partial -->
</form></code>```

答:
Try with this code:</p>

```<code>function storeArray() {
  var tab = [];

  $('*[data-in="num"]:checked,#quantity').each(function(index) {
    tab[index] = {
         name: $(this).attr('name'),
         value: parseInt($(this).val())
  });

  return tab;
}
</code>```

Body:
I have this form that calculates the value of the radio button checkbox and quantity. I want to loop the name and value of every checked or selected item into a multidimensional object array. I am using the storeArray function to do this but all i could do was this tab = {Apple: 1, Orange: 2, quantity: 7}

But I want to be able to do something like so..
tab = {name: Apple, value: 1,}{name:Orange, value: 2}{name: quantity, value: 7}. I tried my best, I guess I'm not doing it right.

function storeArray() {
  var tab = {};

  $('*[data-in="num"]:checked,#quantity').each(function() {
    tab[$(this).attr('name')] = parseInt($(this).val());
  });
  console.log(tab);
  return tab;
}

function validate(s) {
  //This is how we check that at least a checkbox is checked
  /*if($("input:checkbox:not(:checked)").length == $('input[type=checkbox]').length){
 $('#totalcost,#checkedcount').val(0);
  } else {*/
  $('#checkedcount').val(s);
  $('#totalcost').val((parseInt($('#quantity').val()) * s));
  $('#totalcount').val($('#quantity').val());
  //}
}

$('*[data-in="num"],#quantity').on('change', function() {
  var sum = 0;
  $('[data-in="num"]:checked').each(function() {
    sum += parseInt($(this).val());
  });
  validate(sum);
  myArray = storeArray();

  //myArray Object containing all input values
  //console.log(myArray);
  //This is how get the quantity for example
  //console.log(myArray['quantity']);

});

<form>

    <input type="checkbox" id='game0' value="1" name="Apple" data-d="b" data-in="num">Apple
    <input type="checkbox" id='game1' value="2" name="Orange" data-d="b" data-in="num">Orange
    <input type="checkbox" id='game2' value="3" name="Pineaple" data-d="b" data-in="num">Pineaple
    <input type="checkbox" id='game3' value="4" name="Lemon" data-d="b" data-in="num">Lemon
    <input type="checkbox" id='game4' value="5" name="Mango" data-d="b" data-in="num">Mango

    <input type="radio" id='pad' value="6" data-d="b" name="HI" data-in="num">Small Cup
    <input type="radio" id='pad1' value="7" data-d="b" name="HI" data-in="num">Medium Cup
    <input type="radio" id='pad2' value="8" data-d="b" name="HI" data-in="num">Big Cup

    <select name="quantity" id="quantity" data-d="b">
      <option value="0">Select quantity</option>
      <option value="1">1</option>
      <option value="2">2</option>
      <option value="3">3</option>
      <option value="4">4</option>
      <option value="5">5</option>
    </select>

  total cost<input type="text" id="totalcost" value="">

total Checked<input type="text" id="checkedcount" value="">

total boxes<input type="text" id="totalcount" value="">

</form>

Body:
Try with this code:

function storeArray() {
  var tab = [];

  $('*[data-in="num"]:checked,#quantity').each(function(index) {
    tab[index] = {
         name: $(this).attr('name'),
         value: parseInt($(this).val())
  });

  return tab;
}


问:
Google Maps API V3 : How show the direction from a point A to point B (Blue line)?
I have latitude and longitude for 2 points on database, I want my Google Map to display a route from point A to point B...

Just like we see here (Google Maps Directions)

How to draw that direction line on map ?

答:
I'm using a popup to show the map in a new window. I'm using the following url

```<code>https://www.google.com/maps?z=15&daddr=LATITUDE,LONGITUDE
</code>```

HTML snippet

```<code><a target='_blank' href='https://www.google.com/maps?z=15&daddr=${location.latitude},${location.longitude}'>Calculate route</a>
</code>```

Body:
I'm using a popup to show the map in a new window. I'm using the following url

https://www.google.com/maps?z=15&daddr=LATITUDE,LONGITUDE

HTML snippet

<a target='_blank' href='https://www.google.com/maps?z=15&daddr=${location.latitude},${location.longitude}'>Calculate route</a>


问:
Trouble updating to Spyder 4.0.0
I am under Windows 10, 64 bits.

I tried several time to update Spyder 4.0.0 with both the Anaconda Prompt and the Anaconda Navigator.
It failed. I uninstalled Anaconda and reinstalled it.

Then I ran the Anaconda Prompt as an Administrator and executed :

```<code>conda update spyder
</code>```

The version of Spyder was 3.3.6.
I tried this command :

```<code>conda install spyder=4.0.0
</code>```

The prompt returned :

```<code>Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
Finding conflicts:   0%|                                                                       | 0/360 [00:00<?, ?it/s]|Examining hpack:  42%|█████████████████████████▌                                   | 151/360 [00:00<00:00, 1468.80it/s]/Examining jupyter_core:  56%|██████████████████████████████▍                       | 203/360 [00:00<00:00, 1468.80it/-
- mparing specs that have this dependency:   0%|                                                | 0/20 [00:00<?, ?it/\
Examining jupyter_core:  57%|██████████████████████████████▌                       | 204/360 [00:20<00:00, 1468.80it/s]|| mparing specs that have this dependency:  10%|████                                    | 2/20 [00:18<02:47,  9.32s/i/ |
Comparing specs that have this dependency:  55%|█████████████████████▍                 | 11/20 [01:07<00:55,  6.16s/i-
Examining tbb:  73%|███████████████████████████████████████████████▎                 | 262/360 [02:35<01:19,  1.24it/s]-Examining jedi:  81%|███████████████████████████████████████████████████▉            | 292/360 [02:35<00:54,  1.24it/- \
Examining jupyter_client:  90%|████████████████████████████████████████████████▍     | 323/360 [06:03<04:23,  7.12s/i\ \
Comparing specs that have this dependency:   7%|██▋                                     | 1/15 [00:10<02:27, 10.51s/i-
Comparing specs that have this dependency:  13%|█████▎                                  | 2/15 [00:21<02:19, 10.73s/i/ |
Comparing specs that have this dependency:  27%|██████████▋                             | 4/15 [00:31<01:25,  7.77s/i\ \
Finding conflict paths:   0%|                                                                    | 0/7 [00:00<?, ?it// -
Comparing specs that have this dependency:  73%|████████████████████████████▌          | 11/15 [01:21<00:29,  7.40s/i\ |
Finding shortest conflict path for jupyter_client[version='>=4.2']:  67%|██████████▋     | 4/6 [00:10<00:01,  1.35it/| -
Comparing specs that have this dependency:  80%|███████████████████████████████▏       | 12/15 [01:34<00:23,  7.91s/i- |
failed                                                                                /
                                                                                \
UnsatisfiableError: The following specifications were found to be incompatible with a past
explicit spec that is not an explicit spec in this operation (spyder):

  - spyder=4.0.0

The following specifications were found to be incompatible with each other:

Package jedi conflicts for:
spyder=4.0.0 -> python-language-server[version='>=0.31.2,<0.32.0'] -> jedi[version='>=0.14.1,<0.16']
jedi
jupyterlab_server -> notebook -> ipykernel -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
anaconda==2019.10 -> jedi==0.15.1[build='py37_0|py36_0|py27_0']
ipython -> jedi[version='>=0.10']
qtconsole -> ipykernel[version='>=4.1'] -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
_ipyw_jlab_nb_ext_conf -> ipywidgets -> ipython[version='>=4.0.0'] -> jedi[version='>=0.10']
jupyter_console -> ipython -> jedi[version='>=0.10']
spyder-kernels -> ipykernel -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
widgetsnbextension -> notebook[version='>=4.4.1'] -> ipykernel -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
jupyterlab -> notebook[version='>=4.3.1'] -> ipykernel -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
jupyter -> ipykernel -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
spyder=4.0.0 -> qtconsole[version='>=4.6.0'] -> ipykernel[version='>=4.1'] -> ipython[version='>=5.0'] -> jedi[version='>=0.10']
ipywidgets -> ipython[version='>=4.0.0'] -> jedi[version='>=0.10']
notebook -> ipykernel -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
ipykernel -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
anaconda==2019.10 -> spyder==3.3.6=py27_0 -> jedi[version='>=0.10|>=0.9']
spyder=4.0.0 -> jedi=0.14.1
Package jupyter_client conflicts for:
_ipyw_jlab_nb_ext_conf -> jupyterlab -> notebook[version='>=4.3.1'] -> nbconvert -> jupyter_client[version='>=4.2']
widgetsnbextension -> notebook[version='>=4.4.1'] -> nbconvert -> jupyter_client[version='>=4.2']
jupyterlab -> notebook[version='>=4.3.1'] -> nbconvert -> jupyter_client[version='>=4.2']
ipywidgets -> widgetsnbextension[version='>=3.3.0,<3.4.0'] -> notebook[version='>=4.4.1'] -> jupyter_client[version='>=5.2.0|>=5.3.1|>=5.3.4']
jupyterlab_server -> notebook -> jupyter_client[version='>=5.2.0|>=5.3.1|>=5.3.4']
anaconda==2019.10 -> ipykernel==4.10.0=py27_0 -> jupyter_client[version='>=4.1|>=5.2.0|>=5.2.3|>=5.3.1']
jupyter -> ipykernel -> jupyter_client[version='>=4.1|>=4.2|>=5.2.0|>=5.3.1|>=5.3.4']
ipywidgets -> widgetsnbextension[version='>=3.3.0,<3.4.0'] -> notebook[version='>=4.4.1'] -> nbconvert -> jupyter_client[version='>=4.2']
spyder=4.0.0 -> qtconsole[version='>=4.6.0'] -> ipykernel[version='>=4.1'] -> jupyter_client
jupyterlab -> notebook[version='>=4.3.1'] -> jupyter_client[version='>=5.2.0|>=5.3.1|>=5.3.4']
spyder=4.0.0 -> nbconvert -> jupyter_client[version='>=4.1|>=4.2|>=5.3.4']
ipywidgets -> ipykernel[version='>=4.5.1'] -> jupyter_client
anaconda==2019.10 -> jupyter_client==5.3.3[build='py27_1|py36_1|py37_1']
spyder-kernels -> ipykernel -> jupyter_client
jupyter_console -> jupyter_client
spyder-kernels -> jupyter_client[version='>=5.2.3|>=5.3.4']
notebook -> nbconvert -> jupyter_client[version='>=4.2']
jupyter_client
notebook -> jupyter_client[version='>=5.2.0|>=5.3.1|>=5.3.4']
nbconvert -> jupyter_client[version='>=4.2']
_ipyw_jlab_nb_ext_conf -> ipywidgets -> ipykernel[version='>=4.5.1'] -> jupyter_client[version='>=5.2.0|>=5.3.1|>=5.3.4']
jupyterlab_server -> notebook -> nbconvert -> jupyter_client[version='>=4.2']
widgetsnbextension -> notebook[version='>=4.4.1'] -> jupyter_client[version='>=5.2.0|>=5.3.1|>=5.3.4']
ipykernel -> jupyter_client
qtconsole -> ipykernel[version='>=4.1'] -> jupyter_client
qtconsole -> jupyter_client[version='>=4.1']
Package jupyter_core conflicts for:
anaconda==2019.10 -> jupyter_core==4.5.0=py_0
spyder=4.0.0 -> nbconvert -> jupyter_client[version='>=4.2'] -> jupyter_core[version='>=4.6.0']
nbconvert -> jupyter_client[version='>=4.2'] -> jupyter_core[version='>=4.6.0']
jupyterlab -> notebook[version='>=4.3.1'] -> jupyter_core[version='>=4.4.0|>=4.6.0']
ipywidgets -> ipykernel[version='>=4.5.1'] -> jupyter_client -> jupyter_core[version='>=4.4.0|>=4.6.0']
anaconda-project -> anaconda-client -> nbformat[version='>=4.4.0'] -> jupyter_core
jupyter_core
anaconda-navigator -> anaconda-client[version='>=1.6'] -> nbformat[version='>=4.4.0'] -> jupyter_core
jupyter -> notebook -> jupyter_core[version='>=4.4.0|>=4.6.0']
_ipyw_jlab_nb_ext_conf -> jupyterlab -> notebook[version='>=4.3.1'] -> jupyter_core[version='>=4.4.0|>=4.6.0']
spyder-kernels -> jupyter_client[version='>=5.2.3'] -> jupyter_core[version='>=4.6.0']
widgetsnbextension -> notebook[version='>=4.4.1'] -> jupyter_core[version='>=4.4.0|>=4.6.0']
notebook -> jupyter_core[version='>=4.4.0|>=4.6.0']
ipywidgets -> nbformat[version='>=4.2.0'] -> jupyter_core
anaconda-client -> nbformat[version='>=4.4.0'] -> jupyter_core
nbformat -> jupyter_core
jupyter_console -> jupyter_client -> jupyter_core[version='>=4.6.0']
anaconda==2019.10 -> jupyter_client==5.3.3=py27_1 -> jupyter_core[version='>=4.4.0']
qtconsole -> jupyter_core
ipykernel -> jupyter_client -> jupyter_core[version='>=4.6.0']
spyder=4.0.0 -> nbconvert -> jupyter_core
jupyter_client -> jupyter_core[version='>=4.6.0']
nbconvert -> jupyter_core
jupyterlab_server -> notebook -> jupyter_core[version='>=4.4.0|>=4.6.0']
qtconsole -> jupyter_client[version='>=4.1'] -> jupyter_core[version='>=4.6.0']
Package spyder-kernels conflicts for:
spyder=4.0.0 -> spyder-kernels[version='>=1.8.1,<2.0.0']
spyder-kernels
anaconda==2019.10 -> spyder-kernels==0.5.2[build='py37_0|py36_0|py27_0']
anaconda==2019.10 -> spyder==3.3.6=py27_0 -> spyder-kernels[version='>=0.5.0,<1']
Package qtconsole conflicts for:
anaconda==2019.10 -> qtconsole==4.5.5=py_0
jupyter -> qtconsole
anaconda==2019.10 -> jupyter==1.0.0=py27_7 -> qtconsole[version='>=4.2']
spyder=4.0.0 -> qtconsole[version='>=4.6.0']
qtconsole
</code>```

When launching the Anaconda Navigator, the Spyder version was still on 3.3.6.

What am I missing to benefit the last version of Spyder ?

EDIT 1:

When I try to use the Anaconda Navigator, it says :

spyder 4.0.0 cannot be installed on this environment

And it proposes other environments to install but I want Spyder to be updated, not installed somewhere else.

EDIT 2:
I successfuly change conda to 4.6, but I get these two errors :

```<code>FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\brichard\\AppData\\Local\\Continuum\\anaconda3\\Menu\\spyder_shortcut.jsodone
</code>```

and :

```<code>CondaError: Cannot link a source that does not exist. C:\Users\brichard\AppData\Local\Continuum\anaconda3\Scripts\conda.exe
Running `conda clean --packages` may resolve your problem.
</code>```

The conda clean --packages command does not help since the same errors are raised after it is executed.

答:
I used the following:

```<code>conda update anaconda
</code>```

and then

```<code>conda update spyder
conda install spyder=4.0.1
</code>```

to successfully update to version 4.0.1

Title: Trouble updating to Spyder 4.0.0

Body:
I am under Windows 10, 64 bits.

I tried several time to update Spyder 4.0.0 with both the Anaconda Prompt and the Anaconda Navigator.
It failed. I uninstalled Anaconda and reinstalled it.

Then I ran the Anaconda Prompt as an Administrator and executed :

conda update spyder

The version of Spyder was 3.3.6.
I tried this command :

conda install spyder=4.0.0

The prompt returned :

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
Finding conflicts:   0%|                                                                       | 0/360 [00:00<?, ?it/s]|Examining hpack:  42%|█████████████████████████▌                                   | 151/360 [00:00<00:00, 1468.80it/s]/Examining jupyter_core:  56%|██████████████████████████████▍                       | 203/360 [00:00<00:00, 1468.80it/-
- mparing specs that have this dependency:   0%|                                                | 0/20 [00:00<?, ?it/\
Examining jupyter_core:  57%|██████████████████████████████▌                       | 204/360 [00:20<00:00, 1468.80it/s]|| mparing specs that have this dependency:  10%|████                                    | 2/20 [00:18<02:47,  9.32s/i/ |
Comparing specs that have this dependency:  55%|█████████████████████▍                 | 11/20 [01:07<00:55,  6.16s/i-
Examining tbb:  73%|███████████████████████████████████████████████▎                 | 262/360 [02:35<01:19,  1.24it/s]-Examining jedi:  81%|███████████████████████████████████████████████████▉            | 292/360 [02:35<00:54,  1.24it/- \
Examining jupyter_client:  90%|████████████████████████████████████████████████▍     | 323/360 [06:03<04:23,  7.12s/i\ \
Comparing specs that have this dependency:   7%|██▋                                     | 1/15 [00:10<02:27, 10.51s/i-
Comparing specs that have this dependency:  13%|█████▎                                  | 2/15 [00:21<02:19, 10.73s/i/ |
Comparing specs that have this dependency:  27%|██████████▋                             | 4/15 [00:31<01:25,  7.77s/i\ \
Finding conflict paths:   0%|                                                                    | 0/7 [00:00<?, ?it// -
Comparing specs that have this dependency:  73%|████████████████████████████▌          | 11/15 [01:21<00:29,  7.40s/i\ |
Finding shortest conflict path for jupyter_client[version='>=4.2']:  67%|██████████▋     | 4/6 [00:10<00:01,  1.35it/| -
Comparing specs that have this dependency:  80%|███████████████████████████████▏       | 12/15 [01:34<00:23,  7.91s/i- |
failed                                                                                /
                                                                                \
UnsatisfiableError: The following specifications were found to be incompatible with a past
explicit spec that is not an explicit spec in this operation (spyder):

  - spyder=4.0.0

The following specifications were found to be incompatible with each other:

Package jedi conflicts for:
spyder=4.0.0 -> python-language-server[version='>=0.31.2,<0.32.0'] -> jedi[version='>=0.14.1,<0.16']
jedi
jupyterlab_server -> notebook -> ipykernel -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
anaconda==2019.10 -> jedi==0.15.1[build='py37_0|py36_0|py27_0']
ipython -> jedi[version='>=0.10']
qtconsole -> ipykernel[version='>=4.1'] -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
_ipyw_jlab_nb_ext_conf -> ipywidgets -> ipython[version='>=4.0.0'] -> jedi[version='>=0.10']
jupyter_console -> ipython -> jedi[version='>=0.10']
spyder-kernels -> ipykernel -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
widgetsnbextension -> notebook[version='>=4.4.1'] -> ipykernel -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
jupyterlab -> notebook[version='>=4.3.1'] -> ipykernel -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
jupyter -> ipykernel -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
spyder=4.0.0 -> qtconsole[version='>=4.6.0'] -> ipykernel[version='>=4.1'] -> ipython[version='>=5.0'] -> jedi[version='>=0.10']
ipywidgets -> ipython[version='>=4.0.0'] -> jedi[version='>=0.10']
notebook -> ipykernel -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
ipykernel -> ipython[version='>=4.0'] -> jedi[version='>=0.10']
anaconda==2019.10 -> spyder==3.3.6=py27_0 -> jedi[version='>=0.10|>=0.9']
spyder=4.0.0 -> jedi=0.14.1
Package jupyter_client conflicts for:
_ipyw_jlab_nb_ext_conf -> jupyterlab -> notebook[version='>=4.3.1'] -> nbconvert -> jupyter_client[version='>=4.2']
widgetsnbextension -> notebook[version='>=4.4.1'] -> nbconvert -> jupyter_client[version='>=4.2']
jupyterlab -> notebook[version='>=4.3.1'] -> nbconvert -> jupyter_client[version='>=4.2']
ipywidgets -> widgetsnbextension[version='>=3.3.0,<3.4.0'] -> notebook[version='>=4.4.1'] -> jupyter_client[version='>=5.2.0|>=5.3.1|>=5.3.4']
jupyterlab_server -> notebook -> jupyter_client[version='>=5.2.0|>=5.3.1|>=5.3.4']
anaconda==2019.10 -> ipykernel==4.10.0=py27_0 -> jupyter_client[version='>=4.1|>=5.2.0|>=5.2.3|>=5.3.1']
jupyter -> ipykernel -> jupyter_client[version='>=4.1|>=4.2|>=5.2.0|>=5.3.1|>=5.3.4']
ipywidgets -> widgetsnbextension[version='>=3.3.0,<3.4.0'] -> notebook[version='>=4.4.1'] -> nbconvert -> jupyter_client[version='>=4.2']
spyder=4.0.0 -> qtconsole[version='>=4.6.0'] -> ipykernel[version='>=4.1'] -> jupyter_client
jupyterlab -> notebook[version='>=4.3.1'] -> jupyter_client[version='>=5.2.0|>=5.3.1|>=5.3.4']
spyder=4.0.0 -> nbconvert -> jupyter_client[version='>=4.1|>=4.2|>=5.3.4']
ipywidgets -> ipykernel[version='>=4.5.1'] -> jupyter_client
anaconda==2019.10 -> jupyter_client==5.3.3[build='py27_1|py36_1|py37_1']
spyder-kernels -> ipykernel -> jupyter_client
jupyter_console -> jupyter_client
spyder-kernels -> jupyter_client[version='>=5.2.3|>=5.3.4']
notebook -> nbconvert -> jupyter_client[version='>=4.2']
jupyter_client
notebook -> jupyter_client[version='>=5.2.0|>=5.3.1|>=5.3.4']
nbconvert -> jupyter_client[version='>=4.2']
_ipyw_jlab_nb_ext_conf -> ipywidgets -> ipykernel[version='>=4.5.1'] -> jupyter_client[version='>=5.2.0|>=5.3.1|>=5.3.4']
jupyterlab_server -> notebook -> nbconvert -> jupyter_client[version='>=4.2']
widgetsnbextension -> notebook[version='>=4.4.1'] -> jupyter_client[version='>=5.2.0|>=5.3.1|>=5.3.4']
ipykernel -> jupyter_client
qtconsole -> ipykernel[version='>=4.1'] -> jupyter_client
qtconsole -> jupyter_client[version='>=4.1']
Package jupyter_core conflicts for:
anaconda==2019.10 -> jupyter_core==4.5.0=py_0
spyder=4.0.0 -> nbconvert -> jupyter_client[version='>=4.2'] -> jupyter_core[version='>=4.6.0']
nbconvert -> jupyter_client[version='>=4.2'] -> jupyter_core[version='>=4.6.0']
jupyterlab -> notebook[version='>=4.3.1'] -> jupyter_core[version='>=4.4.0|>=4.6.0']
ipywidgets -> ipykernel[version='>=4.5.1'] -> jupyter_client -> jupyter_core[version='>=4.4.0|>=4.6.0']
anaconda-project -> anaconda-client -> nbformat[version='>=4.4.0'] -> jupyter_core
jupyter_core
anaconda-navigator -> anaconda-client[version='>=1.6'] -> nbformat[version='>=4.4.0'] -> jupyter_core
jupyter -> notebook -> jupyter_core[version='>=4.4.0|>=4.6.0']
_ipyw_jlab_nb_ext_conf -> jupyterlab -> notebook[version='>=4.3.1'] -> jupyter_core[version='>=4.4.0|>=4.6.0']
spyder-kernels -> jupyter_client[version='>=5.2.3'] -> jupyter_core[version='>=4.6.0']
widgetsnbextension -> notebook[version='>=4.4.1'] -> jupyter_core[version='>=4.4.0|>=4.6.0']
notebook -> jupyter_core[version='>=4.4.0|>=4.6.0']
ipywidgets -> nbformat[version='>=4.2.0'] -> jupyter_core
anaconda-client -> nbformat[version='>=4.4.0'] -> jupyter_core
nbformat -> jupyter_core
jupyter_console -> jupyter_client -> jupyter_core[version='>=4.6.0']
anaconda==2019.10 -> jupyter_client==5.3.3=py27_1 -> jupyter_core[version='>=4.4.0']
qtconsole -> jupyter_core
ipykernel -> jupyter_client -> jupyter_core[version='>=4.6.0']
spyder=4.0.0 -> nbconvert -> jupyter_core
jupyter_client -> jupyter_core[version='>=4.6.0']
nbconvert -> jupyter_core
jupyterlab_server -> notebook -> jupyter_core[version='>=4.4.0|>=4.6.0']
qtconsole -> jupyter_client[version='>=4.1'] -> jupyter_core[version='>=4.6.0']
Package spyder-kernels conflicts for:
spyder=4.0.0 -> spyder-kernels[version='>=1.8.1,<2.0.0']
spyder-kernels
anaconda==2019.10 -> spyder-kernels==0.5.2[build='py37_0|py36_0|py27_0']
anaconda==2019.10 -> spyder==3.3.6=py27_0 -> spyder-kernels[version='>=0.5.0,<1']
Package qtconsole conflicts for:
anaconda==2019.10 -> qtconsole==4.5.5=py_0
jupyter -> qtconsole
anaconda==2019.10 -> jupyter==1.0.0=py27_7 -> qtconsole[version='>=4.2']
spyder=4.0.0 -> qtconsole[version='>=4.6.0']
qtconsole

When launching the Anaconda Navigator, the Spyder version was still on 3.3.6.

What am I missing to benefit the last version of Spyder ?

EDIT 1:

When I try to use the Anaconda Navigator, it says :

spyder 4.0.0 cannot be installed on this environment

And it proposes other environments to install but I want Spyder to be updated, not installed somewhere else.

EDIT 2:
I successfuly change conda to 4.6, but I get these two errors :

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\brichard\\AppData\\Local\\Continuum\\anaconda3\\Menu\\spyder_shortcut.jsodone

and :

CondaError: Cannot link a source that does not exist. C:\Users\brichard\AppData\Local\Continuum\anaconda3\Scripts\conda.exe
Running `conda clean --packages` may resolve your problem.

The conda clean --packages command does not help since the same errors are raised after it is executed.

Body:
I used the following:

conda update anaconda

and then

conda update spyder
conda install spyder=4.0.1

to successfully update to version 4.0.1


问:
react native :there is way to view the data that coming from state?
I'm trying to view all the data in the "swiper" coming from state but for some reason I can't see.
I'd love some help because i dont undrstand whats wrong there .
I go through the data with the map function and it doesn't work.
The goal is to display a table with the data

this is the link picture for how it should display :

```<code>
export default class InfoTable extends Component {
    constructor(props) {
        super(props);
        this.state = {
            tableHead0: [`${this.props.headerInfo.SHORT_TEXT} (${(this.props.headerInfo.ORDERID).replace(/^0+/, '')})`],
            tableHead3: ['BANANA'],
            tableData3: [
                ['APPLE', `${this.props.headerInfo.COSTCENTER_TXT} (${(this.props.headerInfo.COSTCENTER)})`],
                ['MONKEY', `${this.props.headerInfo.LOC_WBS_ELEM_TXT} (${this.props.headerInfo.LOC_WBS_ELEM})`],
                ['FRIZ', `${this.props.headerInfo.SETTLORDER_TXT} (${this.props.headerInfo.SETTLORDER})`],
            ]
        }
    }

    componentWillReceiveProps(nextProps) {
        if (nextProps.headerInfo != null) {
            this.setState({ tableHead0: [nextProps.headerInfo] })
        }
        alert(JSON.stringify(nextProps))
    }

    render() {
        const state = this.state;
        return (
            <Swiper style={styles.wrapper} showsButtons={true}>
                <ScrollView>
                    <View style={styles.container}>
                        <Table borderStyle={{ borderWidth: 2, borderColor: '#d83dff' }}>
                            <Row data={state.tableHead0} style={styles.head0} textStyle={styles.headText} />
                            <Row data={state.tableHead1} style={styles.head} textStyle={styles.headText} />
                            <Rows data={state.tableData1} textStyle={styles.text} />
                            <Row data={state.tableHead2} style={styles.head} textStyle={styles.headText} />
                            <Rows data={state.tableData2} textStyle={styles.text} />
                            <Row data={state.tableHead3} style={styles.head} textStyle={styles.headText} />
                            <Rows data={state.tableData3} textStyle={styles.text} />
                        </Table>
                    </View>
                </ScrollView>
            </Swiper>
        )
    }
}
const styles = StyleSheet.create({
    container: { flex: 1, backgroundColor: '#fff' },
    head0: { height: 80, backgroundColor: '#54beff' },
    head: { height: 40, backgroundColor: '#9febf5' },
    headText: { fontWeight: 'bold', fontSize: 20 },
    text: { margin: 10 },
});
</code>```

答:
Hey there you can use Flatlist, in which all the data will be passed as an array and it will show all your data it will help you.

```<code> import {Flatlist} from react-native;
    export default class InfoTable extends Component {
        constructor(props) {
            super(props);
            this.state = {
                tableHead0: [`${this.props.headerInfo.SHORT_TEXT} (${(this.props.headerInfo.ORDERID).replace(/^0+/, '')})`],
                tableHead3: ['BANANA'],
                tableData3: [
                    ['APPLE', `${this.props.headerInfo.COSTCENTER_TXT} (${(this.props.headerInfo.COSTCENTER)})`],
                    ['MONKEY', `${this.props.headerInfo.LOC_WBS_ELEM_TXT} (${this.props.headerInfo.LOC_WBS_ELEM})`],
                    ['FRIZ', `${this.props.headerInfo.SETTLORDER_TXT} (${this.props.headerInfo.SETTLORDER})`],
                ]
            }
        }

        componentWillReceiveProps(nextProps) {
            if (nextProps.headerInfo != null) {
                this.setState({ tableHead0: [nextProps.headerInfo] })
            }
            alert(JSON.stringify(nextProps))
        }

        render() {
            const state = this.state;
            return (
             <View style={styles.container}>
                            <FlatList
                //pass your state in data
                data={this.state.tableData3}
                renderItem={({ item }) =>
                 <View>
                    <Text>{item}</Text>
                    //this render item render the data so you can show data as you
                    want to.
                 </View>
                 }
                keyExtractor={item => item.id}
              />
                        </View>
            )
        }
    }
    const styles = StyleSheet.create({
        container: { flex: 1, backgroundColor: '#fff' },
        head0: { height: 80, backgroundColor: '#54beff' },
        head: { height: 40, backgroundColor: '#9febf5' },
        headText: { fontWeight: 'bold', fontSize: 20 },
        text: { margin: 10 },
    });
</code>```

the item in render item contain all the data and print it, weather it contain 100 of item it will print it in a list and you can scroll it , Flatlist is used with array data only.

Hope it helps, feel free for Doubts.

Body:
I'm trying to view all the data in the "swiper" coming from state but for some reason I can't see.
I'd love some help because i dont undrstand whats wrong there .
I go through the data with the map function and it doesn't work.
The goal is to display a table with the data

this is the link picture for how it should display :

export default class InfoTable extends Component {
    constructor(props) {
        super(props);
        this.state = {
            tableHead0: [`${this.props.headerInfo.SHORT_TEXT} (${(this.props.headerInfo.ORDERID).replace(/^0+/, '')})`],
            tableHead3: ['BANANA'],
            tableData3: [
                ['APPLE', `${this.props.headerInfo.COSTCENTER_TXT} (${(this.props.headerInfo.COSTCENTER)})`],
                ['MONKEY', `${this.props.headerInfo.LOC_WBS_ELEM_TXT} (${this.props.headerInfo.LOC_WBS_ELEM})`],
                ['FRIZ', `${this.props.headerInfo.SETTLORDER_TXT} (${this.props.headerInfo.SETTLORDER})`],
            ]
        }
    }

    componentWillReceiveProps(nextProps) {
        if (nextProps.headerInfo != null) {
            this.setState({ tableHead0: [nextProps.headerInfo] })
        }
        alert(JSON.stringify(nextProps))
    }

    render() {
        const state = this.state;
        return (
            <Swiper style={styles.wrapper} showsButtons={true}>
                <ScrollView>
                    <View style={styles.container}>

                            <Row data={state.tableHead0} style={styles.head0} textStyle={styles.headText} />
                            <Row data={state.tableHead1} style={styles.head} textStyle={styles.headText} />
                            <Rows data={state.tableData1} textStyle={styles.text} />
                            <Row data={state.tableHead2} style={styles.head} textStyle={styles.headText} />
                            <Rows data={state.tableData2} textStyle={styles.text} />
                            <Row data={state.tableHead3} style={styles.head} textStyle={styles.headText} />
                            <Rows data={state.tableData3} textStyle={styles.text} />

                    </View>
                </ScrollView>
            </Swiper>
        )
    }
}
const styles = StyleSheet.create({
    container: { flex: 1, backgroundColor: '#fff' },
    head0: { height: 80, backgroundColor: '#54beff' },
    head: { height: 40, backgroundColor: '#9febf5' },
    headText: { fontWeight: 'bold', fontSize: 20 },
    text: { margin: 10 },
});

Body:
Hey there you can use Flatlist, in which all the data will be passed as an array and it will show all your data it will help you.

 import {Flatlist} from react-native;
    export default class InfoTable extends Component {
        constructor(props) {
            super(props);
            this.state = {
                tableHead0: [`${this.props.headerInfo.SHORT_TEXT} (${(this.props.headerInfo.ORDERID).replace(/^0+/, '')})`],
                tableHead3: ['BANANA'],
                tableData3: [
                    ['APPLE', `${this.props.headerInfo.COSTCENTER_TXT} (${(this.props.headerInfo.COSTCENTER)})`],
                    ['MONKEY', `${this.props.headerInfo.LOC_WBS_ELEM_TXT} (${this.props.headerInfo.LOC_WBS_ELEM})`],
                    ['FRIZ', `${this.props.headerInfo.SETTLORDER_TXT} (${this.props.headerInfo.SETTLORDER})`],
                ]
            }
        }

        componentWillReceiveProps(nextProps) {
            if (nextProps.headerInfo != null) {
                this.setState({ tableHead0: [nextProps.headerInfo] })
            }
            alert(JSON.stringify(nextProps))
        }

        render() {
            const state = this.state;
            return (
             <View style={styles.container}>
                            <FlatList
                //pass your state in data
                data={this.state.tableData3}
                renderItem={({ item }) =>
                 <View>
                    <Text>{item}</Text>
                    //this render item render the data so you can show data as you
                    want to.
                 </View>
                 }
                keyExtractor={item => item.id}
              />
                        </View>
            )
        }
    }
    const styles = StyleSheet.create({
        container: { flex: 1, backgroundColor: '#fff' },
        head0: { height: 80, backgroundColor: '#54beff' },
        head: { height: 40, backgroundColor: '#9febf5' },
        headText: { fontWeight: 'bold', fontSize: 20 },
        text: { margin: 10 },
    });

the item in render item contain all the data and print it, weather it contain 100 of item it will print it in a list and you can scroll it , Flatlist is used with array data only.

Hope it helps, feel free for Doubts.


问:
how to remove other rows with same Word in the SQL table column
how to remove other rows with same Word in the SQL Table column

For example

```<code>StudentUserID     SessionID

DSteve             101
DSteve             102
CJohn              101
</code>```

For Reporting purpose we only need first ever row with StudentUserID

答:
You can get the first row that has no overlap with other rows:

```<code>select t.*
from t
where not exists (select 1
                  from t t2
                  where (t2.name like '%' + t.name + '%' or
                         t.name like '%' + t2.name + '%'
                        ) and
                        t2.SessionID < t.SessionID
                 );
</code>```

This seems to be technically what you are asking for.  It is not clear that this is actually useful.

EDIT:

For your revised question, I'll use a similar query:

```<code>select t.*
from t
where not exists (select 1
                  from t t2
                  where t2.StudentUserId = t2.StudentuserId and
                        t2.SessionID < t.SessionID
                 );
</code>```

Body:
how to remove other rows with same Word in the SQL Table column

For example

StudentUserID     SessionID

DSteve             101
DSteve             102
CJohn              101

For Reporting purpose we only need first ever row with StudentUserID

Body:
You can get the first row that has no overlap with other rows:

select t.*
from t
where not exists (select 1
                  from t t2
                  where (t2.name like '%' + t.name + '%' or
                         t.name like '%' + t2.name + '%'
                        ) and
                        t2.SessionID < t.SessionID
                 );

This seems to be technically what you are asking for.  It is not clear that this is actually useful.

EDIT:

For your revised question, I'll use a similar query:

select t.*
from t
where not exists (select 1
                  from t t2
                  where t2.StudentUserId = t2.StudentuserId and
                        t2.SessionID < t.SessionID
                 );


问:
How to get CSV data (as obtained from GoogleSheets - Google Python API) into a table-format (dataframe)?
I have written a piece of code that gets data from a Google-Sheets doc through a path defined by IFTTT, DialogFlow and Hiroku, this happens through this snippet:

```<code># Finding a workbook by name and opening the first sheet
sheet = client.open("IFTTT_Webhooks").sheet1

# Extract and print all of the values
list_of_answers = sheet.get_all_records()

#put the values from the list_of_answers into a csv and store locallyy.
with open('user_answers.csv', 'w') as myfile:
    wr = csv.writer(myfile, quoting=csv.QUOTE_ALL)
    wr.writerow(list_of_answers)
</code>```

If I open 'user_answers.csv' the csv looks as such:

[{'Date/Time': 'February 19, 2020 at 09:49PM', 'Intent':
  'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'Sometimes',
  'Statement 3': 'sometimes', 'Statement 4': 'yes'}, {'Date/Time':
  'February 19, 2020 at 09:50PM', 'Intent': 'poll_completed', 'Statement
  1': 'yes', 'Statement 2': 'never', 'Statement 3': 'never', 'Statement
  4': 'no'}, {'Date/Time': 'February 19, 2020 at 10:48PM', 'Intent':
  'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'often',
  'Statement 3': 'sometimes', 'Statement 4': 'yes'}, {'Date/Time':
  'February 20, 2020 at 12:14AM', 'Intent': 'poll_completed', 'Statement
  1': 'now', 'Statement 2': 'often', 'Statement 3': 'sometimes',
  'Statement 4': 'yes'}]

How can I get this data in a table-format with the columns as such and their respective values:

```<code>Date/time,                    Statement 1, Statement 2, Statement 3, Statement 4
February 19, 2020 at 09:49PM.  yes         Sometimes    Sometimes.   no
</code>```

It's ok if the csv format stays as is. But I want to be able to work with data more effectively in another file. So I want to create I guess a dataframe that considers this new (requested) table-format. Any help is appreciated.

答:
You have list of dictionares so you should use DictWriter()

first I get keys from first row to have headers

next I create writer which can work with dictionares

finally I write headers and all data

Code:

```<code>import csv

data = [{'Date/Time': 'February 19, 2020 at 09:49PM', 'Intent': 'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'Sometimes', 'Statement 3': 'sometimes', 'Statement 4': 'yes'}, {'Date/Time': 'February 19, 2020 at 09:50PM', 'Intent': 'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'never', 'Statement 3': 'never', 'Statement 4': 'no'}, {'Date/Time': 'February 19, 2020 at 10:48PM', 'Intent': 'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'often', 'Statement 3': 'sometimes', 'Statement 4': 'yes'}, {'Date/Time': 'February 20, 2020 at 12:14AM', 'Intent': 'poll_completed', 'Statement 1': 'now', 'Statement 2': 'often', 'Statement 3': 'sometimes', 'Statement 4': 'yes'}]

headers = data[0].keys()

with open('user_answers.csv', 'w') as f:
    csv_writer = csv.DictWriter(f, headers)
    csv_writer.writeheader()
    csv_writer.writerows(data)
</code>```

You can also use pandas.DataFrame directly

```<code>import pandas as pd

data = [{'Date/Time': 'February 19, 2020 at 09:49PM', 'Intent': 'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'Sometimes', 'Statement 3': 'sometimes', 'Statement 4': 'yes'}, {'Date/Time': 'February 19, 2020 at 09:50PM', 'Intent': 'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'never', 'Statement 3': 'never', 'Statement 4': 'no'}, {'Date/Time': 'February 19, 2020 at 10:48PM', 'Intent': 'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'often', 'Statement 3': 'sometimes', 'Statement 4': 'yes'}, {'Date/Time': 'February 20, 2020 at 12:14AM', 'Intent': 'poll_completed', 'Statement 1': 'now', 'Statement 2': 'often', 'Statement 3': 'sometimes', 'Statement 4': 'yes'}]

df = pd.DataFrame(data)
df.to_csv('user_answers.csv', index=False)

print(df)
</code>```

Body:
I have written a piece of code that gets data from a Google-Sheets doc through a path defined by IFTTT, DialogFlow and Hiroku, this happens through this snippet:

# Finding a workbook by name and opening the first sheet
sheet = client.open("IFTTT_Webhooks").sheet1

# Extract and print all of the values
list_of_answers = sheet.get_all_records()

#put the values from the list_of_answers into a csv and store locallyy.
with open('user_answers.csv', 'w') as myfile:
    wr = csv.writer(myfile, quoting=csv.QUOTE_ALL)
    wr.writerow(list_of_answers)

If I open 'user_answers.csv' the csv looks as such:

[{'Date/Time': 'February 19, 2020 at 09:49PM', 'Intent':
  'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'Sometimes',
  'Statement 3': 'sometimes', 'Statement 4': 'yes'}, {'Date/Time':
  'February 19, 2020 at 09:50PM', 'Intent': 'poll_completed', 'Statement
  1': 'yes', 'Statement 2': 'never', 'Statement 3': 'never', 'Statement
  4': 'no'}, {'Date/Time': 'February 19, 2020 at 10:48PM', 'Intent':
  'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'often',
  'Statement 3': 'sometimes', 'Statement 4': 'yes'}, {'Date/Time':
  'February 20, 2020 at 12:14AM', 'Intent': 'poll_completed', 'Statement
  1': 'now', 'Statement 2': 'often', 'Statement 3': 'sometimes',
  'Statement 4': 'yes'}]

How can I get this data in a table-format with the columns as such and their respective values:

Date/time,                    Statement 1, Statement 2, Statement 3, Statement 4
February 19, 2020 at 09:49PM.  yes         Sometimes    Sometimes.   no

It's ok if the csv format stays as is. But I want to be able to work with data more effectively in another file. So I want to create I guess a dataframe that considers this new (requested) table-format. Any help is appreciated.

Body:
You have list of dictionares so you should use DictWriter()

first I get keys from first row to have headers

next I create writer which can work with dictionares

finally I write headers and all data

Code:

import csv

data = [{'Date/Time': 'February 19, 2020 at 09:49PM', 'Intent': 'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'Sometimes', 'Statement 3': 'sometimes', 'Statement 4': 'yes'}, {'Date/Time': 'February 19, 2020 at 09:50PM', 'Intent': 'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'never', 'Statement 3': 'never', 'Statement 4': 'no'}, {'Date/Time': 'February 19, 2020 at 10:48PM', 'Intent': 'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'often', 'Statement 3': 'sometimes', 'Statement 4': 'yes'}, {'Date/Time': 'February 20, 2020 at 12:14AM', 'Intent': 'poll_completed', 'Statement 1': 'now', 'Statement 2': 'often', 'Statement 3': 'sometimes', 'Statement 4': 'yes'}]

headers = data[0].keys()

with open('user_answers.csv', 'w') as f:
    csv_writer = csv.DictWriter(f, headers)
    csv_writer.writeheader()
    csv_writer.writerows(data)

You can also use pandas.DataFrame directly

import pandas as pd

data = [{'Date/Time': 'February 19, 2020 at 09:49PM', 'Intent': 'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'Sometimes', 'Statement 3': 'sometimes', 'Statement 4': 'yes'}, {'Date/Time': 'February 19, 2020 at 09:50PM', 'Intent': 'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'never', 'Statement 3': 'never', 'Statement 4': 'no'}, {'Date/Time': 'February 19, 2020 at 10:48PM', 'Intent': 'poll_completed', 'Statement 1': 'yes', 'Statement 2': 'often', 'Statement 3': 'sometimes', 'Statement 4': 'yes'}, {'Date/Time': 'February 20, 2020 at 12:14AM', 'Intent': 'poll_completed', 'Statement 1': 'now', 'Statement 2': 'often', 'Statement 3': 'sometimes', 'Statement 4': 'yes'}]

df = pd.DataFrame(data)
df.to_csv('user_answers.csv', index=False)

print(df)


问:
VSTS "Visual Studio Test" task deletes TRX file after publish
I've inherited a jacked VSTS build process and I'm attempting to integrate SonarQube into the mix.  Jacked, in that it isn't a clean install and I know the previous owner has done some strange and mysterious things with it that I haven't been able to track down yet.

Anyways, the problem I'm having is that the "Visual Studio Test" task step is deleting the .trx file after publishing the results.  I need the .trx file for SonarQube. I can see the trx file is being deleted and after a screen recording of the folder and the active console logging of the VSTS build process pinpointed the publish process where the .trx file disappears.  With system.debug = true here are a subset of the logs (the .trx file disappears somewhere in here):

```<code>Test results remaining: 165. Test run id: 33.
Leaving UpdateTestResultsAsync
Updated test results: 165
Publishing Attachments: 2
Entering CreateTestRunAttachmentsAsync
Leaving CreateTestRunAttachmentsAsync
Uploading test run attachements individually
Completed PublishTestResult
Completed Publish Test Results: 0
</code>```

I've tried a number of things, the latest of which was to install the latest VS 2017 Enterprise IDE to the build machine and am using these settings in the task:

Not sure if this helps but here is an approximation of the vstest call the above makes as shown in the console:

```<code>vstest.console.exe /TestCaseFilter:"FullyQualifiedName=<all the dlls in my solution>"
"C:\agent\_work\2\s\Source\Sln\Project1\bin\Debug\net461\Project1.Tests.dll"
"C:\agent\_work\2\s\Source\Sln\Project2\bin\Debug\net461\Project2.Tests.dll"
"C:\agent\_work\2\s\Source\Sln\Project3\bin\Debug\net461\Project3.Tests.dll"
/EnableCodeCoverage
/InIsolation
/logger:"trx"
/TestAdapterPath:"C:\agent\_work\2\s\Source\Sln"
/diag:"C:\agent\_work\_temp\4acf64a0-4b51-11e8-9bf5-3b4a52af383b.txt"
</code>```

-#############################

If I run vstest.console.exe from the command line, the results aren't published and the .trx file isn't deleted.

-#############################

I'd like the Visual Studio Test task step to publish but not delete the .trx file.

Any help would be appreciated.  Thanks!

-###################

Update 1: Additional logging of the final "Completed Test Execution" section:

```<code>**************** Completed test execution *********************
Current Phase: MS.VS.TestService.VstestConsoleAdapter.ExecuteVsTestPhase Phase Result: MS.VS.TestService.VstestConsoleAdapter.ExecutionVsTestPhaseResults
PERF WARNING: Running the phase MS.VS.TestService.VstestConsoleAdapter.ExecuteVsTestPhase: took 5414.7701 ms
Current phase: MS.VS.TestService.VstestConsoleAdapter.PublishTestResultPhase
Starting Publish Test Results: TIA: False
Starting PublishTestResult
Test results files: C:\agent\_work\2\s\TestResults\SERVERNAME$_SERVERNAME_2018-04-30_07_43_27.trx
Updating Test results: 35
Entering ParseTestResultFiles
runContext.Platform is null
runContext.Configuration is null
runContext.ReleaseURI is null
runContext.ReleaseEnvironmentUri is null
Reading test results from file 'C:\agent\_work\2\s\TestResults\SERVERNAME$_SERVERNAME_2018-04-30_07_43_27.trx'.
Setting run start and finish times.
Attachment location: C:\agent\_work\2\s\TestResults\SERVERNAME$_SERVERNAME_2018-04-30_07_43_27\In.
Adding run level attachment: C:\agent\_work\2\s\TestResults\SERVERNAME$_SERVERNAME_2018-04-30_07_43_27\In\SERVERNAME\SYSTEM_SERVERNAME 2018-04-30 07_43_21.coverage.
Total test results: 168.
Leaving ParseTestResultFiles
pdating test results: 168
Entering UpdateTestResultsAsync
Publishing test results to test run '35'.
PERF: GetTestCaseResults: took 333.1965 ms
PERF WARNING: GetTestCaseResults: took 333.1965 ms
Test results remaining: 165. Test run id: 35.
Leaving UpdateTestResultsAsync
Updated test results: 165
Publishing Attachments: 2
Entering CreateTestRunAttachmentsAsync
Leaving CreateTestRunAttachmentsAsync
Uploading test run attachements individually
Completed PublishTestResult
Completed Publish Test Results: 0
Current Phase: MS.VS.TestService.VstestConsoleAdapter.PublishTestResultPhase Phase Result: MS.VS.TestService.VstestConsoleAdapter.PublishTestResultPhaseResults
PERF WARNING: Running the phase MS.VS.TestService.VstestConsoleAdapter.PublishTestResultPhase: took 1719.7748 ms
Current phase: MS.VS.TestService.VstestConsoleAdapter.RerunValidationPhase
Started RerunValidationPhase for 35
Maximum number of attempts running the failed tests reached: 3
Processed: ##vso[task.logissue type=warning;]Maximum number of attempts running the failed tests reached: 3
Current Phase: MS.VS.TestService.VstestConsoleAdapter.RerunValidationPhase Phase Result: MS.VS.TestService.VstestConsoleAdapter.RerunValidationPhaseResults
PERF: Running the phase MS.VS.TestService.VstestConsoleAdapter.RerunValidationPhase: took 1.1836 ms
Current phase: MS.VS.TestService.VstestConsoleAdapter.CleanupPhase
Started CleanupPhase 35
Test run needs to be marked as complete.
Entering UpdateTestRunAsync
Leaving UpdateTestRunAsync
Completed CleanupPhase 35
Current Phase: MS.VS.TestService.VstestConsoleAdapter.CleanupPhase Phase Result: MS.VS.TestService.VstestConsoleAdapter.CleanupPhaseResults
PERF: Running the phase MS.VS.TestService.VstestConsoleAdapter.CleanupPhase: took 259.2514 ms
Completed the ExecutionStateModel
Completed TestExecution Model...
rc:0
success:true
File exists. Size: 1224675 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.txt
Agent.Version=2.133.3
Agent.TempDirectory=C:\agent\_work\_temp
defaultRoot: 'C:\agent\_work\_temp'
findOptions.followSpecifiedSymbolicLink: 'true'
findOptions.followSymbolicLinks: 'true'
matchOptions.debug: 'false'
matchOptions.nobrace: 'true'
matchOptions.noglobstar: 'false'
matchOptions.dot: 'true'
matchOptions.noext: 'false'
matchOptions.nocase: 'true'
matchOptions.nonull: 'false'
matchOptions.matchBase: 'false'
matchOptions.nocomment: 'false'
matchOptions.nonegate: 'false'
matchOptions.flipNegate: 'false'
pattern: '*host.*.txt'
findPath: 'C:\agent\_work\_temp'
statOnly: 'false'
findPath: 'C:\agent\_work\_temp'
findOptions.followSpecifiedSymbolicLink: 'true'
findOptions.followSymbolicLinks: 'true'
C:\agent\_work\_temp (directory)
C:\agent\_work\_temp\.taskkey (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-43-19_00381_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-25_11343_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-35_20720_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-42_87908_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-43-22_36319_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-25_98843_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-36_03532_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-43_70721_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.txt (file)
C:\agent\_work\_temp\cc80b061-4c84-11e8-87c2-ab8f332e19bd.txt (file)
C:\agent\_work\_temp\cc80b063-4c84-11e8-87c2-ab8f332e19bd.txt (file)
C:\agent\_work\_temp\proxy (file)
14 results
found 14 paths
applying include pattern
adjustedPattern: 'C:\agent\_work\_temp\*host.*.txt'
4 matches
pattern: '*datacollector.*.txt'
findPath: 'C:\agent\_work\_temp'
statOnly: 'false'
findPath: 'C:\agent\_work\_temp'
findOptions.followSpecifiedSymbolicLink: 'true'
findOptions.followSymbolicLinks: 'true'
C:\agent\_work\_temp (directory)
C:\agent\_work\_temp\.taskkey (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-43-19_00381_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-25_11343_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-35_20720_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-42_87908_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-43-22_36319_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-25_98843_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-36_03532_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-43_70721_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.txt (file)
C:\agent\_work\_temp\cc80b061-4c84-11e8-87c2-ab8f332e19bd.txt (file)
C:\agent\_work\_temp\cc80b063-4c84-11e8-87c2-ab8f332e19bd.txt (file)
C:\agent\_work\_temp\proxy (file)
14 results
found 14 paths
applying include pattern
adjustedPattern: 'C:\agent\_work\_temp\*datacollector.*.txt'
4 matches
8 final results
File exists. Size: 11672 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-43-19_00381_1.txt
File exists. Size: 11672 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-25_11343_1.txt
File exists. Size: 11671 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-35_20720_1.txt
File exists. Size: 11582 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-42_87908_1.txt
File exists. Size: 413384 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-43-22_36319_1.txt
File exists. Size: 45500 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-25_98843_1.txt
File exists. Size: 45350 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-36_03532_1.txt
File exists. Size: 45500 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-43_70721_1.txt
task result: Succeeded
Processed: ##vso[task.complete result=Succeeded;]VsTest task succeeded.
Agent.Version=2.133.3
Release.ReleaseUri=undefined
Release.ReleaseId=undefined
Build.BuildUri=vstfs:///Build/Build/745
Build.Buildid=745
Agent.Version=2.133.3
telemetry area: TestExecution feature: TestExecutionTask data: {"builduri":"vstfs:///Build/Build/745","buildid":"745","codeCoverageEnabled":true,"overrideTestrunParameters":"false","pipeline":"build","runTestsInIsolation":true,"task":"VsTestConsoleFlow","runInParallel":false,"result":"Succeeded","settingsType":"none","testSelection":"testAssemblies","tiaEnabled":false,"vsTestVersion":"15.0.27428","consoleOptionsEnabled":"","rerunEnabled":true,"rerunType":"basedOnTestFailurePercentage"}
Processed: ##vso[telemetry.publish area=TestExecution;feature=TestExecutionTask;]{"builduri":"vstfs:///Build/Build/745","buildid":"745","codeCoverageEnabled":true,"overrideTestrunParameters":"false","pipeline":"build","runTestsInIsolation":true,"task":"VsTestConsoleFlow","runInParallel":false,"result":"Succeeded","settingsType":"none","testSelection":"testAssemblies","tiaEnabled":false,"vsTestVersion":"15.0.27428","consoleOptionsEnabled":"","rerunEnabled":true,"rerunType":"basedOnTestFailurePercentage"}
</code>```

答:
I know this is a old post, but people looking for a solution would be benefited by it working with the latest version of the task. You need to add the path to keep results in a different folder than the "$(Agent.TempDirectory)/TestResults" which will be removed at the end of the pipeline run.
   From the information on "Test results folder" of the task...

Folder to store test results. When this input is not specified, results are stored in $(Agent.TempDirectory)/TestResults by default, which is cleaned at the end of a pipeline run. The results directory will always be cleaned up at the start of the vstest task before the tests are run. Relative folder path if provided will be considered relative to $(Agent.TempDirectory)

I have solved it by having the task variable, "Test results folder", pointing to a folder other than the temp directory. With this I could retain trx files after the task is run. In my case, I need trx files for further processing.

Body:
I've inherited a jacked VSTS build process and I'm attempting to integrate SonarQube into the mix.  Jacked, in that it isn't a clean install and I know the previous owner has done some strange and mysterious things with it that I haven't been able to track down yet.

Anyways, the problem I'm having is that the "Visual Studio Test" task step is deleting the .trx file after publishing the results.  I need the .trx file for SonarQube. I can see the trx file is being deleted and after a screen recording of the folder and the active console logging of the VSTS build process pinpointed the publish process where the .trx file disappears.  With system.debug = true here are a subset of the logs (the .trx file disappears somewhere in here):

Test results remaining: 165. Test run id: 33.
Leaving UpdateTestResultsAsync
Updated test results: 165
Publishing Attachments: 2
Entering CreateTestRunAttachmentsAsync
Leaving CreateTestRunAttachmentsAsync
Uploading test run attachements individually
Completed PublishTestResult
Completed Publish Test Results: 0

I've tried a number of things, the latest of which was to install the latest VS 2017 Enterprise IDE to the build machine and am using these settings in the task:

Not sure if this helps but here is an approximation of the vstest call the above makes as shown in the console:

vstest.console.exe /TestCaseFilter:"FullyQualifiedName=<all the dlls in my solution>"
"C:\agent\_work\2\s\Source\Sln\Project1\bin\Debug\net461\Project1.Tests.dll"
"C:\agent\_work\2\s\Source\Sln\Project2\bin\Debug\net461\Project2.Tests.dll"
"C:\agent\_work\2\s\Source\Sln\Project3\bin\Debug\net461\Project3.Tests.dll"
/EnableCodeCoverage
/InIsolation
/logger:"trx"
/TestAdapterPath:"C:\agent\_work\2\s\Source\Sln"
/diag:"C:\agent\_work\_temp\4acf64a0-4b51-11e8-9bf5-3b4a52af383b.txt"

-#############################

If I run vstest.console.exe from the command line, the results aren't published and the .trx file isn't deleted.

-#############################

I'd like the Visual Studio Test task step to publish but not delete the .trx file.

Any help would be appreciated.  Thanks!

-###################

Update 1: Additional logging of the final "Completed Test Execution" section:

**************** Completed test execution *********************
Current Phase: MS.VS.TestService.VstestConsoleAdapter.ExecuteVsTestPhase Phase Result: MS.VS.TestService.VstestConsoleAdapter.ExecutionVsTestPhaseResults
PERF WARNING: Running the phase MS.VS.TestService.VstestConsoleAdapter.ExecuteVsTestPhase: took 5414.7701 ms
Current phase: MS.VS.TestService.VstestConsoleAdapter.PublishTestResultPhase
Starting Publish Test Results: TIA: False
Starting PublishTestResult
Test results files: C:\agent\_work\2\s\TestResults\SERVERNAME$_SERVERNAME_2018-04-30_07_43_27.trx
Updating Test results: 35
Entering ParseTestResultFiles
runContext.Platform is null
runContext.Configuration is null
runContext.ReleaseURI is null
runContext.ReleaseEnvironmentUri is null
Reading test results from file 'C:\agent\_work\2\s\TestResults\SERVERNAME$_SERVERNAME_2018-04-30_07_43_27.trx'.
Setting run start and finish times.
Attachment location: C:\agent\_work\2\s\TestResults\SERVERNAME$_SERVERNAME_2018-04-30_07_43_27\In.
Adding run level attachment: C:\agent\_work\2\s\TestResults\SERVERNAME$_SERVERNAME_2018-04-30_07_43_27\In\SERVERNAME\SYSTEM_SERVERNAME 2018-04-30 07_43_21.coverage.
Total test results: 168.
Leaving ParseTestResultFiles
pdating test results: 168
Entering UpdateTestResultsAsync
Publishing test results to test run '35'.
PERF: GetTestCaseResults: took 333.1965 ms
PERF WARNING: GetTestCaseResults: took 333.1965 ms
Test results remaining: 165. Test run id: 35.
Leaving UpdateTestResultsAsync
Updated test results: 165
Publishing Attachments: 2
Entering CreateTestRunAttachmentsAsync
Leaving CreateTestRunAttachmentsAsync
Uploading test run attachements individually
Completed PublishTestResult
Completed Publish Test Results: 0
Current Phase: MS.VS.TestService.VstestConsoleAdapter.PublishTestResultPhase Phase Result: MS.VS.TestService.VstestConsoleAdapter.PublishTestResultPhaseResults
PERF WARNING: Running the phase MS.VS.TestService.VstestConsoleAdapter.PublishTestResultPhase: took 1719.7748 ms
Current phase: MS.VS.TestService.VstestConsoleAdapter.RerunValidationPhase
Started RerunValidationPhase for 35
Maximum number of attempts running the failed tests reached: 3
Processed: ##vso[task.logissue type=warning;]Maximum number of attempts running the failed tests reached: 3
Current Phase: MS.VS.TestService.VstestConsoleAdapter.RerunValidationPhase Phase Result: MS.VS.TestService.VstestConsoleAdapter.RerunValidationPhaseResults
PERF: Running the phase MS.VS.TestService.VstestConsoleAdapter.RerunValidationPhase: took 1.1836 ms
Current phase: MS.VS.TestService.VstestConsoleAdapter.CleanupPhase
Started CleanupPhase 35
Test run needs to be marked as complete.
Entering UpdateTestRunAsync
Leaving UpdateTestRunAsync
Completed CleanupPhase 35
Current Phase: MS.VS.TestService.VstestConsoleAdapter.CleanupPhase Phase Result: MS.VS.TestService.VstestConsoleAdapter.CleanupPhaseResults
PERF: Running the phase MS.VS.TestService.VstestConsoleAdapter.CleanupPhase: took 259.2514 ms
Completed the ExecutionStateModel
Completed TestExecution Model...
rc:0
success:true
File exists. Size: 1224675 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.txt
Agent.Version=2.133.3
Agent.TempDirectory=C:\agent\_work\_temp
defaultRoot: 'C:\agent\_work\_temp'
findOptions.followSpecifiedSymbolicLink: 'true'
findOptions.followSymbolicLinks: 'true'
matchOptions.debug: 'false'
matchOptions.nobrace: 'true'
matchOptions.noglobstar: 'false'
matchOptions.dot: 'true'
matchOptions.noext: 'false'
matchOptions.nocase: 'true'
matchOptions.nonull: 'false'
matchOptions.matchBase: 'false'
matchOptions.nocomment: 'false'
matchOptions.nonegate: 'false'
matchOptions.flipNegate: 'false'
pattern: '*host.*.txt'
findPath: 'C:\agent\_work\_temp'
statOnly: 'false'
findPath: 'C:\agent\_work\_temp'
findOptions.followSpecifiedSymbolicLink: 'true'
findOptions.followSymbolicLinks: 'true'
C:\agent\_work\_temp (directory)
C:\agent\_work\_temp\.taskkey (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-43-19_00381_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-25_11343_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-35_20720_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-42_87908_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-43-22_36319_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-25_98843_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-36_03532_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-43_70721_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.txt (file)
C:\agent\_work\_temp\cc80b061-4c84-11e8-87c2-ab8f332e19bd.txt (file)
C:\agent\_work\_temp\cc80b063-4c84-11e8-87c2-ab8f332e19bd.txt (file)
C:\agent\_work\_temp\proxy (file)
14 results
found 14 paths
applying include pattern
adjustedPattern: 'C:\agent\_work\_temp\*host.*.txt'
4 matches
pattern: '*datacollector.*.txt'
findPath: 'C:\agent\_work\_temp'
statOnly: 'false'
findPath: 'C:\agent\_work\_temp'
findOptions.followSpecifiedSymbolicLink: 'true'
findOptions.followSymbolicLinks: 'true'
C:\agent\_work\_temp (directory)
C:\agent\_work\_temp\.taskkey (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-43-19_00381_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-25_11343_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-35_20720_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-42_87908_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-43-22_36319_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-25_98843_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-36_03532_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-43_70721_1.txt (file)
C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.txt (file)
C:\agent\_work\_temp\cc80b061-4c84-11e8-87c2-ab8f332e19bd.txt (file)
C:\agent\_work\_temp\cc80b063-4c84-11e8-87c2-ab8f332e19bd.txt (file)
C:\agent\_work\_temp\proxy (file)
14 results
found 14 paths
applying include pattern
adjustedPattern: 'C:\agent\_work\_temp\*datacollector.*.txt'
4 matches
8 final results
File exists. Size: 11672 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-43-19_00381_1.txt
File exists. Size: 11672 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-25_11343_1.txt
File exists. Size: 11671 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-35_20720_1.txt
File exists. Size: 11582 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.datacollector.18-04-30_07-45-42_87908_1.txt
File exists. Size: 413384 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-43-22_36319_1.txt
File exists. Size: 45500 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-25_98843_1.txt
File exists. Size: 45350 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-36_03532_1.txt
File exists. Size: 45500 Bytes
Processed: ##vso[task.uploadfile]C:\agent\_work\_temp\cc80b060-4c84-11e8-87c2-ab8f332e19bd.host.18-04-30_07-45-43_70721_1.txt
task result: Succeeded
Processed: ##vso[task.complete result=Succeeded;]VsTest task succeeded.
Agent.Version=2.133.3
Release.ReleaseUri=undefined
Release.ReleaseId=undefined
Build.BuildUri=vstfs:///Build/Build/745
Build.Buildid=745
Agent.Version=2.133.3
telemetry area: TestExecution feature: TestExecutionTask data: {"builduri":"vstfs:///Build/Build/745","buildid":"745","codeCoverageEnabled":true,"overrideTestrunParameters":"false","pipeline":"build","runTestsInIsolation":true,"task":"VsTestConsoleFlow","runInParallel":false,"result":"Succeeded","settingsType":"none","testSelection":"testAssemblies","tiaEnabled":false,"vsTestVersion":"15.0.27428","consoleOptionsEnabled":"","rerunEnabled":true,"rerunType":"basedOnTestFailurePercentage"}
Processed: ##vso[telemetry.publish area=TestExecution;feature=TestExecutionTask;]{"builduri":"vstfs:///Build/Build/745","buildid":"745","codeCoverageEnabled":true,"overrideTestrunParameters":"false","pipeline":"build","runTestsInIsolation":true,"task":"VsTestConsoleFlow","runInParallel":false,"result":"Succeeded","settingsType":"none","testSelection":"testAssemblies","tiaEnabled":false,"vsTestVersion":"15.0.27428","consoleOptionsEnabled":"","rerunEnabled":true,"rerunType":"basedOnTestFailurePercentage"}