问:
What is a viable local database for Windows Phone 7 right now?
I was wondering what is a viable database solution for local storage on Windows Phone 7 right now. Using search I stumbled upon these 2 threads but they are over a few months old. I was wondering if there are some new development in databases for WP7. And I didn't found any reviews about the databases mentioned in the links below.

windows phone 7 database

Local Sql database support for Windows phone 7

My requirements are:

It should be free for commercial use

Saving/updating a record should only save the actual record and not the entire database (unlike WinPhone7 DB)

Able to fast query on a table with ~1000 records using LINQ.

Should also work in simulator

EDIT:

Just tried Sterling using a simple test app: It looks good, but I have 2 issues.

Creating 1000 records takes 30 seconds using db.Save(myPerson). Person is a simple class with 5 properties.

Then I discovered there is a db.SaveAsync<Person>(IList) method. This is fine because it doesn't block the current thread anymore.

BUT my question is: Is it save to call db.Flush() immediately and do a query on the currently saving IList? (because it takes up to 30 seconds to save the records in synchronous mode). Or do I have to wait until the BackgroundWorker has finished saving?

Query these 1000 records with LINQ and a where clause the first time takes up to 14 sec to load into memory.

Is there a way to speed this up?

Here are some benchmark results: (Unit tests was executed on a HTC Trophy)

```
-----------------------------
purging: 7,59 sec
creating 1000 records: 0,006 sec
saving 1000 records: 32,374 sec
flushing 1000 records: 0,07 sec
-----------------------------
//async
creating 1000 records: 0,04 sec
saving 1000 records: 0,004 sec
flushing 1000 records: 0 sec
-----------------------------
//get all keys
persons list count = 1000 (0,007)
-----------------------------
//get all persons with a where clause
persons list with query count = 26 (14,241)
-----------------------------
//update 1 property of 1 record + save
persons list with query count = 26 (0,003s)
db saved (0,072s)
```

答: Perst is free for non-commercial use.</p>

Body:
I was wondering what is a viable database solution for local storage on Windows Phone 7 right now. Using search I stumbled upon these 2 threads but they are over a few months old. I was wondering if there are some new development in databases for WP7. And I didn't found any reviews about the databases mentioned in the links below.

windows phone 7 database

Local Sql database support for Windows phone 7

My requirements are:

It should be free for commercial use

Saving/updating a record should only save the actual record and not the entire database (unlike WinPhone7 DB)

Able to fast query on a table with ~1000 records using LINQ.

Should also work in simulator

EDIT:

Just tried Sterling using a simple test app: It looks good, but I have 2 issues.

Creating 1000 records takes 30 seconds using db.Save(myPerson). Person is a simple class with 5 properties.

Then I discovered there is a db.SaveAsync<Person>(IList) method. This is fine because it doesn't block the current thread anymore.

BUT my question is: Is it save to call db.Flush() immediately and do a query on the currently saving IList? (because it takes up to 30 seconds to save the records in synchronous mode). Or do I have to wait until the BackgroundWorker has finished saving?

Query these 1000 records with LINQ and a where clause the first time takes up to 14 sec to load into memory.

Is there a way to speed this up?

Here are some benchmark results: (Unit tests was executed on a HTC Trophy)

-----------------------------
purging: 7,59 sec
creating 1000 records: 0,006 sec
saving 1000 records: 32,374 sec
flushing 1000 records: 0,07 sec
-----------------------------
//async
creating 1000 records: 0,04 sec
saving 1000 records: 0,004 sec
flushing 1000 records: 0 sec
-----------------------------
//get all keys
persons list count = 1000 (0,007)
-----------------------------
//get all persons with a where clause
persons list with query count = 26 (14,241)
-----------------------------
//update 1 property of 1 record + save
persons list with query count = 26 (0,003s)
db saved (0,072s)

Body: Perst is free for non-commercial use.


来源: stackexchange

问:
How to Parse contents of HTML tag which is inside an HTML tag with BeautifulSoup?
In a unique case of html found on web there is a html document which has multiple html tags within the parent HTML tag. I want to parse the contents of the html tag. Can anyone point me in the direction to do so ?

Thanks in advance.

Edit 1:
Using BeautifulSoup

```<code>soup = BeautifulSoup(html, "lxml")
</code>```

gives only the parent html and the tags present within it.

However I am assuming if the browser is able to render the html BS should be able to parse it. is that assumption correct?

Edit 2:
Actually the html is a malformed html ( i am assuming here), this is the html I am parsing with beautifulsoup somehow I am only getting the tables  and  and  of 1st (outermost) html. If I manually remove the multiple HTML tags and only keep 1 html tag I am able to parse the table in BS. So the question is "Is there any way to parse the below html and get the data from the innermost or all tables in the file?

```<code><!DOCTYPE html>
<html>
<head>
    <title>Some Title</title>
</head>
<body>
    some html to display the tables.
    <html>
        <head></head>
        <title>Some other title</title>
        <body>
            some html to display even more tables.
        </body>
    </html>
</body>
</html>
</code>```

答:
Here are some sites that are relevant for your question,i think you can find a good answer for what you're looking for.

http://www.compjour.org/warmups/govt-text-releases/intro-to-bs4-lxml-parsing-wh-press-briefings/

Using BeautifulSoup to find a HTML tag that contains certain text

Find index of tag with certain text in beautifulsoup/python

ContentLicense: CC BY-SA 3.0

Body:
In a unique case of html found on web there is a html document which has multiple html tags within the parent HTML tag. I want to parse the contents of the html tag. Can anyone point me in the direction to do so ?

Thanks in advance.

Edit 1:
Using BeautifulSoup

soup = BeautifulSoup(html, "lxml")

gives only the parent html and the tags present within it.

However I am assuming if the browser is able to render the html BS should be able to parse it. is that assumption correct?

Edit 2:
Actually the html is a malformed html ( i am assuming here), this is the html I am parsing with beautifulsoup somehow I am only getting the tables  and  and  of 1st (outermost) html. If I manually remove the multiple HTML tags and only keep 1 html tag I am able to parse the table in BS. So the question is "Is there any way to parse the below html and get the data from the innermost or all tables in the file?

<!DOCTYPE html>

    <title>Some Title</title>

    some html to display the tables.

        <title>Some other title</title>

            some html to display even more tables.


问:
Alter table structure to match copy table
I have 2 tables corporate and corporate_copy. Initially they were same in structure but people started added new columns into corporate and forgot do do so for corporate_copy.

Somewhere in the application there is less used functionality that copies data from corporate to corporate_copy and that kept failing without anyone noticing. Now I have to add 28 columns (ofcourse with same type and length and constraints etc....).

I know it can be done in one ALTER TABLE statement but I still feel it is lengthy task.

Do we have any luxury that will make copy table same as main table by keeping data and adding default values in newly added columns?

I am asking much but is there anything like that?

答:
generate CREATE script in SSMS (right-click on table, then "script table as...")

Delete all things that already exists. Usually they are in the begining and it's a simple

change CREATE to ALTER ... ADD


问:
Why do we need a generic here? Isn't the protocol enough?
I found the following example on the web about using generics together with protocols, however I don't understand why do we need generics at all, when all we need is to use a protocol.

We define a protocol:

```<code>protocol Healthy {
    mutating func setAlive(status: Bool)
    var health: Int { get }
}
</code>```

And then a function using a generic adotping that protocol

```<code>func check<T:Healthy>(inout object: T) {
    if (object.health <= 0) {
        object.setAlive(false)
    }
}
</code>```

I've changed the code as below and everything is still fine.

```<code>func check( object: inout Healthy) {
    if (object.health <= 0) {
        object.setAlive(status: false)
    }
}
</code>```

Or not?

The only reason I could think of to use a generic there, if it's a protocol has an associatedtype and it can't used as an instance.

答:
They express different things. With

```<code>func check(object: inout Healthy) {
</code>```

The object argument can be any Healthy conforming instance. Therefore, you could do this:

```<code>protocol Healthy {}

struct Foo : Healthy {}
struct Bar : Healthy {}

func check(object: inout Healthy) {
    object = Bar()
}

var h: Healthy = Foo()
check(object: &h)
print(h) // Bar()
</code>```

We called check(object:) and passed h (which holds a Foo instance) as the inout argument, but ended up with h holding a Bar instance.

You'll note that this means we cannot simply call check(object:) with a concrete-typed inout argument. The following doesn't compile:

```<code>var h = Foo()

// compiler error: Cannot pass immutable value as inout argument:
// implicit conversion from 'Foo' to 'Healthy' requires a temporary
check(object: &h)
</code>```

Because check(object:) could assign an arbitrary Healthy conforming instance to the object argument, which is not assignable to a Foo variable.

However, with

```<code>func check<T : Healthy>(object: inout T) {
</code>```

The object argument is a single specific concrete type that conforms to Healthy (and this type is satisfied at the call-site). You cannot just assign an arbitrary Healthy conforming instance to it, as it might not be compatible with the variable type being passed as the inout argument.

This therefore now allows you to call it with a concrete-typed inout argument. We can now say:

```<code>protocol Healthy {
    var alive: Bool { get set }
}

struct Foo : Healthy {
    var alive: Bool
}
struct Bar : Healthy {
    var alive: Bool
}

func check<T : Healthy>(object: inout T) {

    object.alive = false

    // illegal
    // object = Bar()
}

var h = Foo(alive: true)
check(object: &h)
</code>```

(note h is able to be typed as Foo)

So in most cases, you'll likely want to make the method generic rather than having a protocol-typed inout parameter, as you'll likely want to be dealing with concrete types.

Body:
I found the following example on the web about using generics together with protocols, however I don't understand why do we need generics at all, when all we need is to use a protocol.

We define a protocol:

protocol Healthy {
    mutating func setAlive(status: Bool)
    var health: Int { get }
}

And then a function using a generic adotping that protocol

func check<T:Healthy>(inout object: T) {
    if (object.health <= 0) {
        object.setAlive(false)
    }
}

I've changed the code as below and everything is still fine.

func check( object: inout Healthy) {
    if (object.health <= 0) {
        object.setAlive(status: false)
    }
}

Or not?

The only reason I could think of to use a generic there, if it's a protocol has an associatedtype and it can't used as an instance.

Body:
They express different things. With

func check(object: inout Healthy) {

The object argument can be any Healthy conforming instance. Therefore, you could do this:

protocol Healthy {}

struct Foo : Healthy {}
struct Bar : Healthy {}

func check(object: inout Healthy) {
    object = Bar()
}

var h: Healthy = Foo()
check(object: &h)
print(h) // Bar()

We called check(object:) and passed h (which holds a Foo instance) as the inout argument, but ended up with h holding a Bar instance.

You'll note that this means we cannot simply call check(object:) with a concrete-typed inout argument. The following doesn't compile:

var h = Foo()

// compiler error: Cannot pass immutable value as inout argument:
// implicit conversion from 'Foo' to 'Healthy' requires a temporary
check(object: &h)

Because check(object:) could assign an arbitrary Healthy conforming instance to the object argument, which is not assignable to a Foo variable.

However, with

func check<T : Healthy>(object: inout T) {

The object argument is a single specific concrete type that conforms to Healthy (and this type is satisfied at the call-site). You cannot just assign an arbitrary Healthy conforming instance to it, as it might not be compatible with the variable type being passed as the inout argument.

This therefore now allows you to call it with a concrete-typed inout argument. We can now say:

protocol Healthy {
    var alive: Bool { get set }
}

struct Foo : Healthy {
    var alive: Bool
}
struct Bar : Healthy {
    var alive: Bool
}

func check<T : Healthy>(object: inout T) {

    object.alive = false

    // illegal
    // object = Bar()
}

var h = Foo(alive: true)
check(object: &h)

(note h is able to be typed as Foo)

So in most cases, you'll likely want to make the method generic rather than having a protocol-typed inout parameter, as you'll likely want to be dealing with concrete types.


问:
c#.NET and sprintf syntax
How would this code be translated into C#, specifically how would sprintf be implemented in C#?

```<code>string output = "The user %s logged in";
string loggedIn = "is";
string loggedOut = "isn't";

if (TheUser.CheckStatus())
{
    output = sprintf(output, loggedIn);
}
else
{
    output = sprintf(output, loggedOut);
}

return output;
</code>```

I'm expecting to see "The user isn't logged in" if TheUser.CheckStatus() is false.

答:
Anirudha already wrote the solution but I cannot add comments so I am posting it as an answer. It needs to be int i=-1; or it will throw an exception.

```<code>string sprintf(string input,params object[] inpVars)
{
    int i=-1;
    input=Regex.Replace(input,"%.",m=>("{"+ ++i +"}"));
    return string.Format(input,inpVars);
}
</code>```

Title: c#.NET and sprintf syntax

Body:
How would this code be translated into C#, specifically how would sprintf be implemented in C#?

string output = "The user %s logged in";
string loggedIn = "is";
string loggedOut = "isn't";

if (TheUser.CheckStatus())
{
    output = sprintf(output, loggedIn);
}
else
{
    output = sprintf(output, loggedOut);
}

return output;

I'm expecting to see "The user isn't logged in" if TheUser.CheckStatus() is false.

Body:
Anirudha already wrote the solution but I cannot add comments so I am posting it as an answer. It needs to be int i=-1; or it will throw an exception.

string sprintf(string input,params object[] inpVars)
{
    int i=-1;
    input=Regex.Replace(input,"%.",m=>("{"+ ++i +"}"));
    return string.Format(input,inpVars);
}

ContentLicense: CC BY-SA 4.0


问:
How expensive is to copy an std::function?
While std::function is movable, in some cases it's not possible or not convenient. Is there a significant penalty for copying it?

Does it possibly depend on the size of the captured variables (if it was created using a lambda expression)? Is it implementation dependent?

答:
std::function is typically implemented as a value-semantics, small-buffer optimized, virtual-dispatch, type-erasing class.

This means if your state is small, a copy will involve no heap allocation (other than within the copy ctor of the state) and some indirection (to find how to copy this particular state).

If your state is large (larger than two std::strings on current MSVC, for example), it requires an additional heap allocation to store the state.

This is not something you want to do on a per-pixel per-frame basis, but it isn't insanely expensive.

How your particular compiler and library version implements std::function could vary, but I am unaware of any that differs significantly from the above.

So, in the following code:

```<code>std::function<std::string()> f = [s = "hello"s]{ return s; };
</code>```

copying f will involve 0 heap allocations on MSVC.

Whereas, this code:

```<code>std::function<std::string()> g = [a = "a"s, b = "b"s, c = "c"s]{ return a+b+c; };
</code>```

does require a heap allocation to copy g.

(And yes, both of these are really dumb function objects.)

There is an effective requirement that the small buffer optimization (SBO) be applied for certain cases (function pointers, member function pointers) in std::function by the fact that they are expected not to fail at allocating memory.  Once you have written one SBO case, making it more general isn't hard, so most std::function implementations store small objects "inside themselves" and larger objects on the heap.

However, this threshold is not specified by the standard, and it is important for the performance cost, so if performance is really important, you'll have to profile to ensure that your implementation does it.

Body:
std::function is typically implemented as a value-semantics, small-buffer optimized, virtual-dispatch, type-erasing class.

This means if your state is small, a copy will involve no heap allocation (other than within the copy ctor of the state) and some indirection (to find how to copy this particular state).

If your state is large (larger than two std::strings on current MSVC, for example), it requires an additional heap allocation to store the state.

This is not something you want to do on a per-pixel per-frame basis, but it isn't insanely expensive.

How your particular compiler and library version implements std::function could vary, but I am unaware of any that differs significantly from the above.

So, in the following code:

std::function<std::string()> f = [s = "hello"s]{ return s; };

copying f will involve 0 heap allocations on MSVC.

Whereas, this code:

std::function<std::string()> g = [a = "a"s, b = "b"s, c = "c"s]{ return a+b+c; };

does require a heap allocation to copy g.

(And yes, both of these are really dumb function objects.)

There is an effective requirement that the small buffer optimization (SBO) be applied for certain cases (function pointers, member function pointers) in std::function by the fact that they are expected not to fail at allocating memory.  Once you have written one SBO case, making it more general isn't hard, so most std::function implementations store small objects "inside themselves" and larger objects on the heap.

However, this threshold is not specified by the standard, and it is important for the performance cost, so if performance is really important, you'll have to profile to ensure that your implementation does it.


问:
Laravel - Sum values between two dates
I need to sum values using Laravel db::table and get the result between two dates, example:

Date: 05/30/2016 Sold: 1
 Date: 05/31/2016 Sold: 2

So result should be Sold: 3

This is a search result given by a filter by date, i have done something like this with no results:

```<code>DB::table('sales')
 ->where('date',$date_from)
 ->where('date',$date_to)
 ->selectRaw('sum(price)')
 ->selectRaw('id')
 ->groupBy('id')
 ->get();
</code>```

答:
Use < and > to filter results by a date:

```<code>->where('date', '>', $date_from)
->where('date', '<', $date_to)
</code>```

Or use whereBetween():

```<code>->whereBetween('date', [$date_from, $date_to])
</code>```

Title: Laravel - Sum values between two dates

Body:
I need to sum values using Laravel db::table and get the result between two dates, example:

Date: 05/30/2016 Sold: 1
 Date: 05/31/2016 Sold: 2

So result should be Sold: 3

This is a search result given by a filter by date, i have done something like this with no results:

DB::table('sales')
 ->where('date',$date_from)
 ->where('date',$date_to)
 ->selectRaw('sum(price)')
 ->selectRaw('id')
 ->groupBy('id')
 ->get();

Body:
Use < and > to filter results by a date:

->where('date', '>', $date_from)
->where('date', '<', $date_to)

Or use whereBetween():

->whereBetween('date', [$date_from, $date_to])


问:
way to extract details like name , ph no from resume(ms word)
i am trying to extract details such as name , address , qualification etc from resume(ms
word).....

i know resume are usually in different formats.....

so any ideas can be helpful.....

thank you

答:
Its more easier to do this with excel. So ask for resumes in excel format if possible otherwise:

You need to create a Word object (there's a template for this in Visual Studio 2008 and 2010) and read the document text and analyze it. This method is very error-prone since different users may use different syntaxes. So again you need to force them adopt a unique syntax and we are back to the same position (Excel format).

ContentLicense: CC BY-SA 2.5

OwnerDisplayName: Tomas Van Joseph


问:
Need to copy text file from one folder to another in windows using jmeter
My requirement is to copy text file from one folder to another in  windows OS using jmeter. So how can we achieve this using jmeter?

Please help!

Thanks,
Abhishek

答:
You can do it in at least 2 ways:

Using OS Process Sampler configured like:

The faster (and cross-platform) way would be using JSR223 Sampler and the code like:

```<code>def sourceFile = new File('c:/somefolder/source_file.txt')
def destinationFile = new File('c:/someotherfolder/destination_file.txt')
destinationFile << sourceFile.text
</code>```

See Groovy is the New Black for more information on using Groovy scripting in Jmeter tests.

Body:
You can do it in at least 2 ways:

Using OS Process Sampler configured like:

The faster (and cross-platform) way would be using JSR223 Sampler and the code like:

def sourceFile = new File('c:/somefolder/source_file.txt')
def destinationFile = new File('c:/someotherfolder/destination_file.txt')
destinationFile << sourceFile.text

See Groovy is the New Black for more information on using Groovy scripting in Jmeter tests.


问:
How to recreate java classes from .class?
I have a few package with a lot of .class java classes, can I somehow recreate with idea? Or maven?

Or what can I do to work my main class which is use this .classes but dont' see it because of the .class extension?

I tried to change the .class extension to .java but the encoding will be wrong...cannot read it after rename to .java..

Or may be make a dependency from it? Or what is the best solution?

I have this main:

```<code>public class Main {
    public static void main(String[] args) {
        Snake snake = new Snake();
        snake.addAI(new MintaAi(), Color.red.darker());
        snake.addAI(new MintaAi(), Color.blue.darker());
        snake.start();
    }
}
</code>```

And I have to run it but everything what I need is .class extension.

答:
Assuming that you are talking about some 3rd party input that comes as .class files; one easy way to view the Java source code is to put those class files into a JAR file; and add that JAR file to your project setup in IntelliJ. When you know press "F3" on a class coming out of that library, IntelliJ will decompile the class file content and show it to you.

Alternatively, you can look into command line tools doing that for you, for example jd-gui. You have to understand that all such technology is limited to a certain degree. When the byte code was touched by an obfuscator for example, a decompiler might have a very hard time showing you anything useful.

But the real answer is: you want to step back and learn a bit about the concepts you intend to use. Like ".java" means Java source code; and .class means "bytecode, compiled from Java source code".

And of course: when Snake, or MintaAi are classes that you wrote; then you should have the source code somewhere.

Body:
I have a few package with a lot of .class java classes, can I somehow recreate with idea? Or maven?

Or what can I do to work my main class which is use this .classes but dont' see it because of the .class extension?

I tried to change the .class extension to .java but the encoding will be wrong...cannot read it after rename to .java..

Or may be make a dependency from it? Or what is the best solution?

I have this main:

public class Main {
    public static void main(String[] args) {
        Snake snake = new Snake();
        snake.addAI(new MintaAi(), Color.red.darker());
        snake.addAI(new MintaAi(), Color.blue.darker());
        snake.start();
    }
}

And I have to run it but everything what I need is .class extension.


问:
Rest API attachment error
I've problems sending attachments through a Skype channel using the bot framework REST API.

I'm able to correctly send images using a json message like this:

```<code>{
   "type":"message",
   "timestamp":"2017-05-22T11:31:36.2281894Z",
   "from":{
      "name":"MyBot"
   },
   "recipient":{
      "id":"29:1-Dl1xMx6G2qGya5O5BgTZJhc0fUKOiQLctt74CmwJ3PVJNgkocpf3LY626py9UIO"
   },
   "text":"It works!",
   "attachments": [
        {
            "contentType": "image/jpg",
            "contentUrl": "https://g87a2173.ngrok.io/content/attachments/65f2be10-e61e-424e-9ea1-e05f1002fd19",
            "name": "image.jpg"
        }
    ]
}
</code>```

But if I send files with any content type other than image I have an error.

For example, if I send

```<code>{
   "type":"message",
   "timestamp":"2017-05-22T11:31:36.2281894Z",
   "from":{
      "name":"MyBot"
   },
   "recipient":{
      "id":"29:1-Dl1xMx6G2qGya5O5BgTZJhc0fUKOiQLctt74CmwJ3PVJNgkocpf3LY626py9UIO"
   },
   "text":"Not working!",
   "attachments": [
        {
            "contentType": "audio/wav",
            "contentUrl": "https://g87a2173.ngrok.io/content/attachments/e58bcefa-7060-464f-96ee-78d2795ec80f",
            "name": "audio.wav"
        }
    ]
}
</code>```

I get a 400 error

```<code>{
    "error": {
        "code": "BadArgument",
        "message": "Unknown attachment type"
    }
}
</code>```

The rest endpoint used for these tests is
https://smba.trafficmanager.net/apis/v3/conversations/29%3A1-Dl1xMx6G2qGya5O5BgTZJhc0fUKOiQLctt74CmwJ3PVJNgkocpf3LY626py9UIO/activities

The API reference documentation states that

An attachment may be a media file (e.g., audio, video, image, file) or
  a rich card

so where am I wrong?

Thank you

答:
I tried the same with C# code and got the same conclusion: on Skype Channel, we got an Unknown attachment type exception for this.
Working on emulator and Slack (got a link to download the wav file)

There must be a channel limitation yes, or a bug.

Anyway you may try to use AudioCard: I tested it (in C# code) and it's working on Skype:

Sample code here: https://github.com/Microsoft/BotBuilder-Samples/tree/master/CSharp/cards-RichCards

Title: Rest API attachment error

Body:
I've problems sending attachments through a Skype channel using the bot framework REST API.

I'm able to correctly send images using a json message like this:

{
   "type":"message",
   "timestamp":"2017-05-22T11:31:36.2281894Z",
   "from":{
      "name":"MyBot"
   },
   "recipient":{
      "id":"29:1-Dl1xMx6G2qGya5O5BgTZJhc0fUKOiQLctt74CmwJ3PVJNgkocpf3LY626py9UIO"
   },
   "text":"It works!",
   "attachments": [
        {
            "contentType": "image/jpg",
            "contentUrl": "https://g87a2173.ngrok.io/content/attachments/65f2be10-e61e-424e-9ea1-e05f1002fd19",
            "name": "image.jpg"
        }
    ]
}

But if I send files with any content type other than image I have an error.

For example, if I send

{
   "type":"message",
   "timestamp":"2017-05-22T11:31:36.2281894Z",
   "from":{
      "name":"MyBot"
   },
   "recipient":{
      "id":"29:1-Dl1xMx6G2qGya5O5BgTZJhc0fUKOiQLctt74CmwJ3PVJNgkocpf3LY626py9UIO"
   },
   "text":"Not working!",
   "attachments": [
        {
            "contentType": "audio/wav",
            "contentUrl": "https://g87a2173.ngrok.io/content/attachments/e58bcefa-7060-464f-96ee-78d2795ec80f",
            "name": "audio.wav"
        }
    ]
}

I get a 400 error

{
    "error": {
        "code": "BadArgument",
        "message": "Unknown attachment type"
    }
}

The rest endpoint used for these tests is
https://smba.trafficmanager.net/apis/v3/conversations/29%3A1-Dl1xMx6G2qGya5O5BgTZJhc0fUKOiQLctt74CmwJ3PVJNgkocpf3LY626py9UIO/activities

The API reference documentation states that

An attachment may be a media file (e.g., audio, video, image, file) or
  a rich card

so where am I wrong?

Thank you


问:
How can I get firebase items in descending order in Java / Android
Let's say I have some data as follow:

```<code>"teilnehmer" : {
      "ATYFdfNRThzrEC83" : {
        "score" : 2500,
        "teamname" : "Was ist mit Karsten los?"
      },
      "VMT9hp65Tui55J2" : {
        "score" : 12500,
        "teamname" : "Team Zombie.de"
      },
      "dPkdf233dbMjCA2" : {
        "score" : 21635,
        "teamname" : "Bielefeld zwei"
      },
      "U1xTtKJa0wdZ13"  : {
        "score" : 500,
        "teamname"  : "Max der Eugen"
      }.............
</code>```

And this Java Code:

```<code>    mDatabase.child("rallye").child("teilnehmer").orderByChild("score").addChildEventListener(new ChildEventListener() {
            @Override
            public void onChildAdded(DataSnapshot dataSnapshot, String s) {
                // teamname, Platzierung, Punkte
                Teilnehmer teilnehmer = new Teilnehmer(((String) dataSnapshot.child("teamname").getValue()), "Platz x", (dataSnapshot.child("score").getValue())+" Punkte");
                teilnehmerList.add(teilnehmer);     // add to recyclerview
                mAdapter.notifyDataSetChanged();    // save
            }

            @Override
            public void onChildChanged(DataSnapshot dataSnapshot, String s) { }

            @Override
            public void onChildRemoved(DataSnapshot dataSnapshot) {
                //adapter.remove((String) dataSnapshot.child("teamname").getValue());
                //teilnehmerList.remove();
                mAdapter.notifyDataSetChanged();
            }

            @Override
            public void onChildMoved(DataSnapshot dataSnapshot, String s) { }

            @Override
            public void onCancelled(DatabaseError databaseError) {}

        });
</code>```

This doesn't work

```<code>.orderByChild("score")
</code>```

Screenshot here : i.stack.imgur.com/Y8NlW.png

I get the teamname and the teamscore in a Rallygame. But the order is ascending, not descending :/

```<code>Output:
Teamname ----------- Score
Team Zombie            50
Team xyz               1500
Team foo              16000
</code>```

Wrong order :/

And then I have a second question, how can I output the current Position in Ranking?

For example:

My List show something like this:

```<code>Rank     Teamname      Points
1        "Team 1"       25.000
2        "Team red"     12.000
3        "Team google"   9.500
4        "Team yellow"   1.250
</code>```

My Firebase contain:

```<code>"ATYFdfNRThzrEC83" : {
            "score" : 2500,
            "teamname" : "Was ist mit Karsten los?"
          },
</code>```

I have only 2 columns, score and teamname

In my first Question i solve the problem with the Order (most Points -> first place)

My layout file:

```<code><TextView
        android:id="@+id/teamName"
        android:textColor="@color/teamTitle"
        android:textSize="16dp"
        android:textStyle="bold"
        android:layout_alignParentTop="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/teamRank"
        android:layout_below="@id/title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/teamScore"
        android:textColor="@color/teamScore"
        android:layout_width="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_height="wrap_content" />
</code>```

3 Output TextViews, but only 2 Datacolumns in Firebase.
The Team with the Most points will be on Rank / Place 1 (i dont know the correct english word for my German "Platz n"). Than  Rank 2, Rank 3....

My first Try:

```<code>int i = 1;
while(dataSnapshot.child("teamname").getValue()) {

Teilnehmer teilnehmer = new Teilnehmer(((String) dataSnapshot.child("teamname").getValue()), "Platz "+i, (dataSnapshot.child("score").getValue())+" Punkte");
                teilnehmerList.add(0,   teilnehmer);     // add to recyclerview: add(0, teilnehmer) gebe in desc aus von 0 zum n. eintrag
                mAdapter.notifyDataSetChanged();    // save
i++;
}
</code>```

I would like three ouputs in one row. Teamname, Rank in Ranking and the current score in the Game.

but my while Loop does not work.

答:
In this function:

```<code>@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
    // teamname, Platzierung, Punkte
    Teilnehmer teilnehmer = new Teilnehmer(((String) dataSnapshot.child("teamname").getValue()), "Platz x", (dataSnapshot.child("score").getValue())+" Punkte");
    teilnehmerList.add(teilnehmer);     // add to recyclerview
    mAdapter.notifyDataSetChanged();    // save
}
</code>```

I assume you are adding to an array list. Instead of adding to the end, add to the beginning because orderByChild is working, its in ascending order. Firebase does not support descending order.

```<code>teilnehmerList.add(0, teilnehmer); // <--- add 0 as 1st parameter
</code>```

Your second question is lacking detail. Create another question.

Body:
Let's say I have some data as follow:

"teilnehmer" : {
      "ATYFdfNRThzrEC83" : {
        "score" : 2500,
        "teamname" : "Was ist mit Karsten los?"
      },
      "VMT9hp65Tui55J2" : {
        "score" : 12500,
        "teamname" : "Team Zombie.de"
      },
      "dPkdf233dbMjCA2" : {
        "score" : 21635,
        "teamname" : "Bielefeld zwei"
      },
      "U1xTtKJa0wdZ13"  : {
        "score" : 500,
        "teamname"  : "Max der Eugen"
      }.............

And this Java Code:

    mDatabase.child("rallye").child("teilnehmer").orderByChild("score").addChildEventListener(new ChildEventListener() {
            @Override
            public void onChildAdded(DataSnapshot dataSnapshot, String s) {
                // teamname, Platzierung, Punkte
                Teilnehmer teilnehmer = new Teilnehmer(((String) dataSnapshot.child("teamname").getValue()), "Platz x", (dataSnapshot.child("score").getValue())+" Punkte");
                teilnehmerList.add(teilnehmer);     // add to recyclerview
                mAdapter.notifyDataSetChanged();    // save
            }

            @Override
            public void onChildChanged(DataSnapshot dataSnapshot, String s) { }

            @Override
            public void onChildRemoved(DataSnapshot dataSnapshot) {
                //adapter.remove((String) dataSnapshot.child("teamname").getValue());
                //teilnehmerList.remove();
                mAdapter.notifyDataSetChanged();
            }

            @Override
            public void onChildMoved(DataSnapshot dataSnapshot, String s) { }

            @Override
            public void onCancelled(DatabaseError databaseError) {}

        });

This doesn't work

.orderByChild("score")

Screenshot here : i.stack.imgur.com/Y8NlW.png

I get the teamname and the teamscore in a Rallygame. But the order is ascending, not descending :/

Output:
Teamname ----------- Score
Team Zombie            50
Team xyz               1500
Team foo              16000

Wrong order :/

And then I have a second question, how can I output the current Position in Ranking?

For example:

My List show something like this:

Rank     Teamname      Points
1        "Team 1"       25.000
2        "Team red"     12.000
3        "Team google"   9.500
4        "Team yellow"   1.250

My Firebase contain:

"ATYFdfNRThzrEC83" : {
            "score" : 2500,
            "teamname" : "Was ist mit Karsten los?"
          },

I have only 2 columns, score and teamname

In my first Question i solve the problem with the Order (most Points -> first place)

My layout file:

<TextView
        android:id="@+id/teamName"
        android:textColor="@color/teamTitle"
        android:textSize="16dp"
        android:textStyle="bold"
        android:layout_alignParentTop="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/teamRank"
        android:layout_below="@id/title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/teamScore"
        android:textColor="@color/teamScore"
        android:layout_width="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_height="wrap_content" />

3 Output TextViews, but only 2 Datacolumns in Firebase.
The Team with the Most points will be on Rank / Place 1 (i dont know the correct english word for my German "Platz n"). Than  Rank 2, Rank 3....

My first Try:

int i = 1;
while(dataSnapshot.child("teamname").getValue()) {

Teilnehmer teilnehmer = new Teilnehmer(((String) dataSnapshot.child("teamname").getValue()), "Platz "+i, (dataSnapshot.child("score").getValue())+" Punkte");
                teilnehmerList.add(0,   teilnehmer);     // add to recyclerview: add(0, teilnehmer) gebe in desc aus von 0 zum n. eintrag
                mAdapter.notifyDataSetChanged();    // save
i++;
}

I would like three ouputs in one row. Teamname, Rank in Ranking and the current score in the Game.

but my while Loop does not work.

Body:
In this function:

@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
    // teamname, Platzierung, Punkte
    Teilnehmer teilnehmer = new Teilnehmer(((String) dataSnapshot.child("teamname").getValue()), "Platz x", (dataSnapshot.child("score").getValue())+" Punkte");
    teilnehmerList.add(teilnehmer);     // add to recyclerview
    mAdapter.notifyDataSetChanged();    // save
}

I assume you are adding to an array list. Instead of adding to the end, add to the beginning because orderByChild is working, its in ascending order. Firebase does not support descending order.

teilnehmerList.add(0, teilnehmer); // <--- add 0 as 1st parameter

Your second question is lacking detail. Create another question.


问:
Which protobuf optimization?
Using google's protocol buffer compiler for c++ its not clear which is faster: optimize for speed:

```<code>option optimize_for = SPEED;
</code>```

or optimize for light runtime:

```<code>option optimize_for = LITE_RUNTIME;
</code>```

if speed is faster, what makes it faster?
does anyone have hard data on the subject?

答:
The way I read the documentation,

optimize for CODE_SIZE does not generate fast accessor methods for everything, but relies on slow reflection,

optimize for SPEED will give you the fast accessors

and optimize for LITE_RUNTIME will also give you fast accessors, but does not support the full functionality of protobuf, but only the lighter subset protobuf-lite. Basically, this means descriptors or reflection are not available.

So I guess, LITE_RUNTIME is not slower than SPEED, and you should choose depending on which runtime library you want to require (lite or full).

if speed is faster, what makes it faster?

SPEED is faster compared to CODE_SIZE, because it uses autogenerated code instead of runtime reflection.

Title: Which protobuf optimization?

Body:
Using google's protocol buffer compiler for c++ its not clear which is faster: optimize for speed:

option optimize_for = SPEED;

or optimize for light runtime:

option optimize_for = LITE_RUNTIME;

if speed is faster, what makes it faster?
does anyone have hard data on the subject?


问:
reversing an array using pointer c
I am trying to write a code that receives the number of input numbers and integers, then reverses those order and prints them out. When I run this code it freezes from the for loop in input_integer function. What am I doing wrong?</p>

```<code># include <stdio.h>
# include <stdlib.h>

void input_integer (int *arr, int *arrSize);
void inverse_reorder (int *arr, int *arrSize);

int main (void){
    int* arrSize;
    int* arr;
    int i;

    input_integer(arr, arrSize);
    printf("inputted data : ");
    for ( i = 0; i < *arrSize ; i++ ){
        printf("%d, ", *(arr + i));
    }
    inverse_reorder(arr, arrSize);
    printf("reversed data : ");
    for ( i = 0; i < *arrSize ; i++ ){
        printf("%d, ", *(arr + i));
    }

    return 0;
}

void input_integer (int* arr, int *arrSize){
    printf("Array size = ? ");
    scanf("%d", arrSize);
    int i;
    for( i = 0; i < *arrSize ; i++ ){
        scanf("%d", *(arr + i));
    }
}

void inverse_reorder (int * arr, int *arrSize){
    int i;
    int temp = 0;
    for ( i = 0; i < *arrSize ; i++ ){
        temp = *(arr+i);
        *(arr+i) = *(arr + *arrSize - i);
        *(arr + *arrSize - i) = temp;
    }
}
</code>```

答:
Variables arrSize and arr are not initialized and have indeterminate values

```<code>int* arrSize;
int* arr;
</code>```

However inside for example the function input_integer  their indeterminate values are used.

As result the program in whole has undefined behavior.

There is no need to declare the variable arrSize as a pointer.

The variable arr must be passed to the function input_integer by reference. Otherwise the function will deal with a copy of the value of the variable and the original value of the variable will not be changed.

So the function should be declared at least like

```<code>void input_integer (int **arr, int *arrSize);
                        ^^^^^
</code>```

The function inverse_reorder  in fact does not reverse the order of the elements of the array. That is it reverse the order twice keeping the original order as the result.

You need also to free the allocated array.

The program and the functions can look the following way

```<code>#include <stdio.h>
#include <stdlib.h>

void input_integer( int **a, size_t *n );
void inverse_reorder( int *a, size_t n );

int main(void)
{
    int *a;
    size_t n;

    input_integer( &a, &n );

    if ( n )
    {
        printf( "inputted data : " );

        for ( size_t i = 0; i < n ; i++ )
        {
            printf( "%d, ", *( a + i ) );
        }
        putchar( '\n' );

        inverse_reorder( a, n );

        printf( "reversed data : " );

        for ( size_t i = 0; i < n ; i++ )
        {
            printf( "%d, ", *( a + i ) );
        }
        putchar( '\n' );

        free( a );
    }

    return 0;
}

void input_integer( int **a, size_t *n )
{
    *a = NULL;
    *n = 0;

    printf( "Array size = ? " );

    if ( scanf( "%zu", n ) == 1 && *n != 0 )
    {
        *a = malloc( *n * sizeof( int ) );

        printf( "enter %zu integers: ", *n );
        for ( size_t i = 0; i < *n; i++ ) scanf( "%d", *a + i );
    }
}

void inverse_reorder( int *a, size_t n )
{
    for ( size_t i = 0; i < n / 2; i++ )
    {
        int tmp = *( a + i );
        *( a + i ) = *( a + n - i - 1 );
        *( a + n - i - 1 ) = tmp;
    }
}
</code>```

The program output is

```<code>Array size = ? 10
enter 10 integers: 0 1 2 3 4 5 6 7 8 9
inputted data : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
reversed data : 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
</code>```

You may add a check that the memory was allocated successfully by yourself.

Title: reversing an array using pointer c

Body:
I am trying to write a code that receives the number of input numbers and integers, then reverses those order and prints them out. When I run this code it freezes from the for loop in input_integer function. What am I doing wrong?

# include <stdio.h>
# include <stdlib.h>

void input_integer (int *arr, int *arrSize);
void inverse_reorder (int *arr, int *arrSize);

int main (void){
    int* arrSize;
    int* arr;
    int i;

    input_integer(arr, arrSize);
    printf("inputted data : ");
    for ( i = 0; i < *arrSize ; i++ ){
        printf("%d, ", *(arr + i));
    }
    inverse_reorder(arr, arrSize);
    printf("reversed data : ");
    for ( i = 0; i < *arrSize ; i++ ){
        printf("%d, ", *(arr + i));
    }

    return 0;
}

void input_integer (int* arr, int *arrSize){
    printf("Array size = ? ");
    scanf("%d", arrSize);
    int i;
    for( i = 0; i < *arrSize ; i++ ){
        scanf("%d", *(arr + i));
    }
}

void inverse_reorder (int * arr, int *arrSize){
    int i;
    int temp = 0;
    for ( i = 0; i < *arrSize ; i++ ){
        temp = *(arr+i);
        *(arr+i) = *(arr + *arrSize - i);
        *(arr + *arrSize - i) = temp;
    }
}

Body:
Variables arrSize and arr are not initialized and have indeterminate values

int* arrSize;
int* arr;

However inside for example the function input_integer  their indeterminate values are used.

As result the program in whole has undefined behavior.

There is no need to declare the variable arrSize as a pointer.

The variable arr must be passed to the function input_integer by reference. Otherwise the function will deal with a copy of the value of the variable and the original value of the variable will not be changed.

So the function should be declared at least like

void input_integer (int **arr, int *arrSize);
                        ^^^^^

The function inverse_reorder  in fact does not reverse the order of the elements of the array. That is it reverse the order twice keeping the original order as the result.

You need also to free the allocated array.

The program and the functions can look the following way

#include <stdio.h>
#include <stdlib.h>

void input_integer( int **a, size_t *n );
void inverse_reorder( int *a, size_t n );

int main(void)
{
    int *a;
    size_t n;

    input_integer( &a, &n );

    if ( n )
    {
        printf( "inputted data : " );

        for ( size_t i = 0; i < n ; i++ )
        {
            printf( "%d, ", *( a + i ) );
        }
        putchar( '\n' );

        inverse_reorder( a, n );

        printf( "reversed data : " );

        for ( size_t i = 0; i < n ; i++ )
        {
            printf( "%d, ", *( a + i ) );
        }
        putchar( '\n' );

        free( a );
    }

    return 0;
}

void input_integer( int **a, size_t *n )
{
    *a = NULL;
    *n = 0;

    printf( "Array size = ? " );

    if ( scanf( "%zu", n ) == 1 && *n != 0 )
    {
        *a = malloc( *n * sizeof( int ) );

        printf( "enter %zu integers: ", *n );
        for ( size_t i = 0; i < *n; i++ ) scanf( "%d", *a + i );
    }
}

void inverse_reorder( int *a, size_t n )
{
    for ( size_t i = 0; i < n / 2; i++ )
    {
        int tmp = *( a + i );
        *( a + i ) = *( a + n - i - 1 );
        *( a + n - i - 1 ) = tmp;
    }
}

The program output is

Array size = ? 10
enter 10 integers: 0 1 2 3 4 5 6 7 8 9
inputted data : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
reversed data : 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,

You may add a check that the memory was allocated successfully by yourself.


答:
Use bytecodeview http://bytecodeviewer.com/. It contains several types of decompilers. You can change decompiler and see preview of quality of decompiled code. In case if code amount small and is not compicated it works well.

Bad parts are: generics (type erasure), very bad parts is reflections(proxy invocations), really bad parts is there is bytecode injections used in class files.

Title: How to recreate java classes from .class?


问:
jQuery - Calculate sum of two numbers inside one td and display inside new td?
Hello Stackoverflowers,

I have this code:

```<code>    <table class="table">
        <tbody>
            <tr>
                <td><a href="#">New thing</a></td>
                <td>2017/06/04 08:00</td>
                <td><a href="#">One Thing</a><span>Another thing</span></td>
                <td class="random">R</td>
                <td><a href="#">12-11      </a></td>
            </tr>
            <tr>
                <td><a href="#">New thing</a></td>
                <td>2017/06/04 08:00</td>
                <td><a href="#">One Thing</a><span>Another thing</span></td>
                <td class="random">R</td>
                <td><a href="#">22-23      </a></td>
            </tr>
        </tbody>
    </table>
</code>```

In the result I want to use jQuery to get a sum of numbers inside last table TD and display it into new TD. Like in the following code:

```<code><table class="table">
    <tbody>
        <tr>
            <td><a href="#">New thing</a></td>
            <td>2017/06/04 08:00</td>
            <td><a href="#">One Thing</a><span>Another thing</span></td>
            <td class="random">R</td>
            <td><a href="#">12-11      </a></td>
            <td>[ 23 ]</td>
        </tr>
        <tr>
            <td><a href="#">New thing</a></td>
            <td>2017/06/04 08:00</td>
            <td><a href="#">One Thing</a><span>Another thing</span></td>
            <td class="random">R</td>
            <td><a href="#">22-23      </a></td>
            <td>[ 45 ]</td>
        </tr>
    </tbody>
</table>
</code>```

thank you in advance.

答:
It can be done in this simple approach by using Vanilla JavaScript in 3 steps:

```<code>// 1.Get last td element from each tr element
var trsCollection = document.getElementsByTagName("tr");
var lastTd = [];
var tdSum = [];
var trs = Array.from(trsCollection)
trs.forEach(function(tr){
   var tds = tr.getElementsByTagName("td");
   lastTd.push(tds[tds.length-1]);
});

// 2.Calculate the sum of each last td element
lastTd.forEach(function(ltd){
   var tdNumbers = ltd.textContent.trim().split("-");
   var sum = 0;
       tdNumbers.forEach(function(num){
          sum = sum + Number(num);
       });
   tdSum.push(sum);
});

// 3.Add new td element to each tr parent
for (var i = 0; i < tdSum.length; i++) {
    var newTd = document.createElement("td");
    newTd.append(tdSum[i]);
    trs[i].append(newTd);
};
</code>```

I hope this would help solve your problem.

Body:
Hello Stackoverflowers,

I have this code:

                New thing
                2017/06/04 08:00
                One ThingAnother thing
                R
                12-11

                New thing
                2017/06/04 08:00
                One ThingAnother thing
                R
                22-23

In the result I want to use jQuery to get a sum of numbers inside last table TD and display it into new TD. Like in the following code:

            New thing
            2017/06/04 08:00
            One ThingAnother thing
            R
            12-11
            [ 23 ]

            New thing
            2017/06/04 08:00
            One ThingAnother thing
            R
            22-23
            [ 45 ]

thank you in advance.

Body:
It can be done in this simple approach by using Vanilla JavaScript in 3 steps:

// 1.Get last td element from each tr element
var trsCollection = document.getElementsByTagName("tr");
var lastTd = [];
var tdSum = [];
var trs = Array.from(trsCollection)
trs.forEach(function(tr){
   var tds = tr.getElementsByTagName("td");
   lastTd.push(tds[tds.length-1]);
});

// 2.Calculate the sum of each last td element
lastTd.forEach(function(ltd){
   var tdNumbers = ltd.textContent.trim().split("-");
   var sum = 0;
       tdNumbers.forEach(function(num){
          sum = sum + Number(num);
       });
   tdSum.push(sum);
});

// 3.Add new td element to each tr parent
for (var i = 0; i < tdSum.length; i++) {
    var newTd = document.createElement("td");
    newTd.append(tdSum[i]);
    trs[i].append(newTd);
};

I hope this would help solve your problem.


答:
You Should use whereBetween(), Try this one</p>

```<code>DB::table('sales')
->whereBetween('date', [$date_from, $date_to])
->selectRaw('sum(price)')
->selectRaw('id')
->groupBy('id')
->get();
</code>```

Title: Laravel - Sum values between two dates

Body:
You Should use whereBetween(), Try this one

DB::table('sales')
->whereBetween('date', [$date_from, $date_to])
->selectRaw('sum(price)')
->selectRaw('id')
->groupBy('id')
->get();


问:
Is it possible to maintain a parameter table in loadrunner?
Lets assume I've defined a key/value pair in loadrunner parameters
section called mytable.dat (Parameter type: Table)

Does loadrunner have a built in function to update this table?
Can I access a value according to key?

In other words, lets say this table consists of user name which will be the key
and email address as value - I would like to ask get the address of a certain user and update his email so when I run the test again tomorrow, loadrunner will load an updated version of mytable.dat

I would like to avoid programming it in c, if there is no built in way to do it in loadrunner than I would much prefer to handle it using javascript.

答:
Here is your core problem with dynamic update.  The table you update on disk is not the table which is used by your virtual users.  At the beginning of the test the parameter table is loaded into RAM to lessen disk access.   So, any writes you make to the table are only going to be available at the next test execution.

The next problem is not trivial and is the core reason that database management solutions exist, how will you manage the read/write access for tens/hundreds/thousands of users to a given file for updates?  This is a difficult programming challenge.  Get it wrong and you will lock your file system on your load generators...even worse if the file is on a common file server where you now have access across a network involved.   This will result in slowed virtual users as everyone waits for exclusive lock to update the table.

Using a queue is really the best option to feed your virtual users where you have one business process which needs to update the data table which is used by a second business process.  Noted in this same thread is VTS, which ships as a part of LoadRunner to address this very issue.   My preference is RabbitMQ, as it has a build in HTTP interface to push and pop values from the queues.  You could also leverage any of the serverless computing queues from Amazon, Cloud Azure, IBM Cloud, Rackspace, etc... for this type of event.

Some people want to use a database server for this feed.  I recommend against this option as when implemented the form most often in place is to use the same database for feeding data as the application under test.  This places load on the AUT which is not present in production. This load is also never optimized on the queries to return the one row of data needed, so the load is disproportionate to the number of users then directly connected to the database which doesn't happen in prod.


问:
ForEach() : Why can't use break/continue inside
Since ForEach() method loop through all list members, Why can't I use a break/continue clause while I can use them inside a normal foreach loop

```<code>lstTemp.ForEach(i=>
 {
   if (i == 3)
   break;
   //do sth
 }
);
</code>```

Error:

"No enclosing loop out of which to
break or continue"

答: Presumably because you're using a lambda and the contents of the lambda are ignorant to the fact that it's being used inside a loop.</p>

Body:
Since ForEach() method loop through all list members, Why can't I use a break/continue clause while I can use them inside a normal foreach loop

lstTemp.ForEach(i=>
 {
   if (i == 3)
   break;
   //do sth
 }
);

Error:

"No enclosing loop out of which to
break or continue"