问:
How to launch a parent iOS App from its App Extension
Does any one know how to launch the parent app from the app extension's view controller?

I just want to launch the main app from its app extension.

答:
it is working in my current working app using action extension

1- in parent app plist add custom URL like

2- add both functions in your extension view controller

```<code>func openURL(url: NSURL) -> Bool {
    do {
        let application = try self.sharedApplication()
        return application.performSelector(inBackground: "openURL:", with: url) != nil
    }
    catch {
        return false
    }
}

func sharedApplication() throws -> UIApplication {
    var responder: UIResponder? = self
    while responder != nil {
        if let application = responder as? UIApplication {
            return application
        }

        responder = responder?.next
    }

    throw NSError(domain: "UIInputViewController+sharedApplication.swift", code: 1, userInfo: nil)
}
</code>```

3- call this function in your button action or somewhere you want to do

```<code>self.openURL(url: NSURL(string:"openPdf://HomeVC")!)
</code>```

here homevc is the class name of your View controller which should be presented

4- in your app delegate implement the method like

```<code>  func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
    let urlPath : String = url.absoluteString
    print(urlPath)
    if urlPath.contains("HomeVC"){
        //here go to firstViewController view controller
        self.window = UIWindow(frame: UIScreen.main.bounds)

        let storyboard = UIStoryboard(name: "Main", bundle: nil)

        let initialViewController = storyboard.instantiateViewController(withIdentifier: "homeVC")

        self.window?.rootViewController = initialViewController
        self.window?.makeKeyAndVisible()
    }
}
</code>```

I hope will work fine, can also share data between extension app and parent app

Body:
it is working in my current working app using action extension

1- in parent app plist add custom URL like

2- add both functions in your extension view controller

func openURL(url: NSURL) -> Bool {
    do {
        let application = try self.sharedApplication()
        return application.performSelector(inBackground: "openURL:", with: url) != nil
    }
    catch {
        return false
    }
}

func sharedApplication() throws -> UIApplication {
    var responder: UIResponder? = self
    while responder != nil {
        if let application = responder as? UIApplication {
            return application
        }

        responder = responder?.next
    }

    throw NSError(domain: "UIInputViewController+sharedApplication.swift", code: 1, userInfo: nil)
}

3- call this function in your button action or somewhere you want to do

self.openURL(url: NSURL(string:"openPdf://HomeVC")!)

here homevc is the class name of your View controller which should be presented

4- in your app delegate implement the method like

  func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
    let urlPath : String = url.absoluteString
    print(urlPath)
    if urlPath.contains("HomeVC"){
        //here go to firstViewController view controller
        self.window = UIWindow(frame: UIScreen.main.bounds)

        let storyboard = UIStoryboard(name: "Main", bundle: nil)

        let initialViewController = storyboard.instantiateViewController(withIdentifier: "homeVC")

        self.window?.rootViewController = initialViewController
        self.window?.makeKeyAndVisible()
    }
}

I hope will work fine, can also share data between extension app and parent app


来源: stackexchange

问:
Wrong axis label while passing column name in ggplot function
In the below example, I am passing a column name of a dataset into a function that uses ggplot.
The function can extract the column name and successfully plot the graph but the axis label is wrong

```<code>library(tidyverse)
attach(mpg)

plot_func <- function(col_name) {
  ggplot(mpg,aes(x = col_name, fill = class)) +
    geom_bar()
}

plot_func(drv)
</code>```

Is there anyway to change the x axis label from col_name to drv. I have tried the below, but it doesn't work.

```<code>plot_func("drv")
</code>```

答:
Passing drv as a string works if you first change it to a symbol then unquote it.

```<code>library(tidyverse)
attach(mpg)

plot_func <- function(col_name) {
  col_name <- rlang::sym(col_name)
  ggplot(mpg,aes(x = !!col_name, fill = class)) +
    geom_bar()
}

plot_func("drv")
</code>```

ContentLicense: CC BY-SA 4.0

Body:
In the below example, I am passing a column name of a dataset into a function that uses ggplot.
The function can extract the column name and successfully plot the graph but the axis label is wrong

library(tidyverse)
attach(mpg)

plot_func <- function(col_name) {
  ggplot(mpg,aes(x = col_name, fill = class)) +
    geom_bar()
}

plot_func(drv)

Is there anyway to change the x axis label from col_name to drv. I have tried the below, but it doesn't work.

plot_func("drv")

Body:
Passing drv as a string works if you first change it to a symbol then unquote it.

library(tidyverse)
attach(mpg)

plot_func <- function(col_name) {
  col_name <- rlang::sym(col_name)
  ggplot(mpg,aes(x = !!col_name, fill = class)) +
    geom_bar()
}

plot_func("drv")


问:
Cross origin error between angular cli and flask
first i post the user id and password from the UI(angular) to flask

```<code>  public send_login(user){
           console.log(user)
           return
     this.http.post(this.apiURL+'/login',JSON.stringify(user),this.httpOptions)
    .pipe(retry(1),catchError(this.
     handleError))
     }
</code>```

next i received it from backend

backend error

all the operations are working properly but at console the cross origin error is raising

Error at UI console

the http option in Ui side is mentioned below

```<code>constructor(private http: HttpClient) { }
  // Http Options
  httpOptions = {
    headers: new HttpHeaders({
      'Content-Type': 'application/json',
      'Access-Control-Allow-Origin': 'http://localhost:9000',
      'Access-Control-Allow-Methods': "GET,POST,OPTIONS,DELETE,PUT",
      'X-Requested-With': 'XMLHttpRequest',
      'MyClientCert': '',        // This is empty
      'MyToken': ''
    })
  }
</code>```

the cors declared at backend is metioned below

```<code>cors = CORS(app, resources={r"/login": {"origins": "*"}})
 @app.route('/login', methods=['GET','POST'])
 def loginForm():
 json_data = ast.literal_eval(request.data.decode('utf-8'))
  print('\n\n\n',json_data,'\n\n\n')
</code>```

im not able to find were is the problem is raising

Note: cross origin arising in the time of login process other wise in the consecutive steps

答:
To me it seems the call is not leaving the front end (at least in my experience it is like this), because the browsers are securing this.

Create a new file proxy.conf.json in src/ folder of your project.

```<code>{
  "/backendApiUrl": {      <--- This needs to reflect the server backend base path
    "target": "http://localhost:9000",    <-- this is the backend server name and port
    "secure": false,
    "logLevel": "debug"    <--- optional, this will give some debug output
  }
}
</code>```

In the file angular.json (CLI configuration file), add the following proxyConfig option to the serve target:

```<code>"projectname": {
  "serve": {
    "builder": "@angular-devkit/build-angular:dev-server",
    "options": {
      "browserTarget": "your-application-name:build",
      "proxyConfig": "src/proxy.conf.json"      <--- this is the important addition
    },
</code>```

Simply call ng serve to run the dev server using this proxy configuration.

You can read the section Proxying to a backend server in https://angular.io/guide/build

Hope this helps.

Body:
first i post the user id and password from the UI(angular) to flask

  public send_login(user){
           console.log(user)
           return
     this.http.post(this.apiURL+'/login',JSON.stringify(user),this.httpOptions)
    .pipe(retry(1),catchError(this.
     handleError))
     }

next i received it from backend

backend error

all the operations are working properly but at console the cross origin error is raising

Error at UI console

the http option in Ui side is mentioned below

constructor(private http: HttpClient) { }
  // Http Options
  httpOptions = {
    headers: new HttpHeaders({
      'Content-Type': 'application/json',
      'Access-Control-Allow-Origin': 'http://localhost:9000',
      'Access-Control-Allow-Methods': "GET,POST,OPTIONS,DELETE,PUT",
      'X-Requested-With': 'XMLHttpRequest',
      'MyClientCert': '',        // This is empty
      'MyToken': ''
    })
  }

the cors declared at backend is metioned below

cors = CORS(app, resources={r"/login": {"origins": "*"}})
 @app.route('/login', methods=['GET','POST'])
 def loginForm():
 json_data = ast.literal_eval(request.data.decode('utf-8'))
  print('\n\n\n',json_data,'\n\n\n')

im not able to find were is the problem is raising

Note: cross origin arising in the time of login process other wise in the consecutive steps

Body:
To me it seems the call is not leaving the front end (at least in my experience it is like this), because the browsers are securing this.

Create a new file proxy.conf.json in src/ folder of your project.

{
  "/backendApiUrl": {      <--- This needs to reflect the server backend base path
    "target": "http://localhost:9000",    <-- this is the backend server name and port
    "secure": false,
    "logLevel": "debug"    <--- optional, this will give some debug output
  }
}

In the file angular.json (CLI configuration file), add the following proxyConfig option to the serve target:

"projectname": {
  "serve": {
    "builder": "@angular-devkit/build-angular:dev-server",
    "options": {
      "browserTarget": "your-application-name:build",
      "proxyConfig": "src/proxy.conf.json"      <--- this is the important addition
    },

Simply call ng serve to run the dev server using this proxy configuration.

You can read the section Proxying to a backend server in https://angular.io/guide/build

Hope this helps.


问:
Django authenticate def not triggering logged_in_success and logged_in_fail signal
When i do authentication by  function

from django.contrib.auth import authenticate

Djnago is not triggering success/fail signal, if i use the function

from django.contrib.auth import login

it will trigger as expected . basically i want to trigger the signal from following function

```<code>user = authenticate(username=username, password=password)
</code>```

now i added extra line to my code

```<code>login(request, user)
</code>```

after adding this , i am getting signal here

```<code>from django.contrib.auth.signals import (
    user_logged_in,
    user_login_failed,
)
</code>```

How can i get signal just from authenticate def ? i am using this for API

答:
Django does not send user_logged_in signal from authenticate. It sends it from login as you can see here. However, you can always trigger signal yourself.

```<code>from django.contrib.auth import authenticate, user_logged_in

user = authenticate(username=username, password=password)
user_logged_in.send(sender=user.__class__, request=request, user=user)
</code>```

Or maybe write a function that does both.

Body:
When i do authentication by  function

from django.contrib.auth import authenticate

Djnago is not triggering success/fail signal, if i use the function

from django.contrib.auth import login

it will trigger as expected . basically i want to trigger the signal from following function

user = authenticate(username=username, password=password)

now i added extra line to my code

login(request, user)

after adding this , i am getting signal here

from django.contrib.auth.signals import (
    user_logged_in,
    user_login_failed,
)

How can i get signal just from authenticate def ? i am using this for API

Body:
Django does not send user_logged_in signal from authenticate. It sends it from login as you can see here. However, you can always trigger signal yourself.

from django.contrib.auth import authenticate, user_logged_in

user = authenticate(username=username, password=password)
user_logged_in.send(sender=user.__class__, request=request, user=user)

Or maybe write a function that does both.


问:
Dynamically change SVG image color in android
I know that using third party library, it is possible to use SVG image in Android.
Library like: svg-android

The code to load SVG image is like below:

```<code> public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Create a new ImageView
    ImageView imageView = new ImageView(this);
    // Set the background color to white
    imageView.setBackgroundColor(Color.WHITE);
    // Parse the SVG file from the resource
    SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.android);
    // Get a drawable from the parsed SVG and set it as the drawable for the ImageView
    imageView.setImageDrawable(svg.createPictureDrawable());
    // Set the ImageView as the content view for the Activity
    setContentView(imageView);
}
</code>```

It's working fine. I'm able to see the image. But now I want to change the color for the svg image at runtime.
For that I tried the code below as mentioned in the same project description.

```<code>  // 0xFF9FBF3B is the hex code for the existing Android green, 0xFF1756c9 is the new blue color
    SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.android, 0xFF9FBF3B, 0xFF1756c9);
</code>```

But with that I am not able to see the change in the color. So I would like to know how it is possible to change the color dynamically in Java file.

答:
what @Antlip Dev said is correct, but that method is deprecated now.
This is the updated version:</p>

```<code>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
    drawable.setColorFilter(new BlendModeColorFilter(color, BlendMode.SRC_ATOP));
} else {
   drawable.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
}
</code>```

ContentLicense: CC BY-SA 3.0

Body:
I know that using third party library, it is possible to use SVG image in Android.
Library like: svg-android

The code to load SVG image is like below:

 public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Create a new ImageView
    ImageView imageView = new ImageView(this);
    // Set the background color to white
    imageView.setBackgroundColor(Color.WHITE);
    // Parse the SVG file from the resource
    SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.android);
    // Get a drawable from the parsed SVG and set it as the drawable for the ImageView
    imageView.setImageDrawable(svg.createPictureDrawable());
    // Set the ImageView as the content view for the Activity
    setContentView(imageView);
}

It's working fine. I'm able to see the image. But now I want to change the color for the svg image at runtime.
For that I tried the code below as mentioned in the same project description.

  // 0xFF9FBF3B is the hex code for the existing Android green, 0xFF1756c9 is the new blue color
    SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.android, 0xFF9FBF3B, 0xFF1756c9);

But with that I am not able to see the change in the color. So I would like to know how it is possible to change the color dynamically in Java file.

Body:
what @Antlip Dev said is correct, but that method is deprecated now.
This is the updated version:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
    drawable.setColorFilter(new BlendModeColorFilter(color, BlendMode.SRC_ATOP));
} else {
   drawable.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
}


问:
Difference between spring.datasource.username and spring.datasource.data-username
I want to know the difference between these properties :

```<code>spring.datasource.username

spring.datasource.data-username
</code>```

same about:

```<code>spring.datasource.password

spring.datasource.data-password
</code>```

How and when to use it in the project ?

答:
The following properties are used for authentication against the database:

spring.datasource.username

spring.datasource.password

And the following properties are used for authentication against the database when executing DML scripts (if they are different from the previous properties):

spring.datasource.data-username

spring.datasource.data-password

These properties are described in the common application properties documentation.

Body:
I want to know the difference between these properties :

spring.datasource.username

spring.datasource.data-username

same about:

spring.datasource.password

spring.datasource.data-password

How and when to use it in the project ?


问:
highcharts - inconsistent number of yAxis gridlines
can someone explain why number of yaxis gridlines is less in exported svg rather than in the browser version? Is this happening because of margin update? if so, why it updates margin, but leaves old number of gridlines, shouldn't it be updated as well?

Here is my fiddle http://jsfiddle.net/sabira/r0zvouyp/

Thank you in advance!

```<code>Highcharts.chart('container', {
    chart:{
    events: {
      load: function(){
      const chart = this;
        const {title, yAxis} = chart;
                setRightDy(title);

      const ticks = chart.yAxis[0].ticks;
      let topTick = null;
      for(let tick in ticks){
        if(ticks[tick].isLast)  {
        topTick = tick;
        }
      }
      const tickY = ticks[topTick].label.xy.y;
      const extraMargin = chart.plotTop-tickY + 10;
      const currentMargin = chart.title.alignOptions.margin;

      chart.title.update({
        margin: currentMargin+extraMargin
      }, true, false, false)
      }
    }
  },
    title: {
        align: 'left',
        text: `
        <span class='titleText' style="font-weight: 500; font-size: 12.6px; font-family: Retina; fill:black"> Lorem ipsum dolor sit amet </span><br>
       <span class='dekText' style="font-size: 8.4px; fill: black; font-weight: 300; font-family: Retina"> Integer quis pharetra tellus. Cras tincidunt libero id dignissim convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</span><br>
<span class='subdekText--strong' style="font-weight: 500; font-size: 8.4px; font-family: Retina; fill:black">Sed aliquam ligula in pretium lobortis.</span>
       <span class='dekText' style="font-size: 8.4px; fill: black; font-weight: 300; font-family: Retina"> Integer quis pharetra tellus. Cras tincidunt libero id dignissim convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</span><br>
<span class='subdekText--strong' style="font-weight: 500; font-size: 8.4px; font-family: Retina; fill:black">Sed aliquam ligula in pretium lobortis.</span>

        `,
        widthAdjust: -40,
        margin: 20,
    },
    exporting: {
    scale: 1
    },
    yAxis: {
      labels: {
        align: 'left',
        x: 0,
        y: -4
      }
    },
    series: [{
        data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
    }],
});

</code>```

答:
The problem which you are struggling to is that you set the new margin after the initial load, which changes and animate the chart. However, the export server renders a new chart with a options which you used to set but without loading the load callback, because there is no delay time to do it.

Why don't you just set the calculated margin as a fixed value in the title.margin object and set the wanted amount of ticks to get it? The visual output is the same.

Demo: https://jsfiddle.net/BlackLabel/owr6f7z2/

```<code>  yAxis: {
    labels: {
      align: 'left',
      x: 0,
      y: -4
    },
    tickAmount: 7
  },
</code>```

API: https://api.highcharts.com/highcharts/yAxis.tickAmount

If this answer wouldn't fit your requirements please describe more precisely what do you want to achieve.

Body:
can someone explain why number of yaxis gridlines is less in exported svg rather than in the browser version? Is this happening because of margin update? if so, why it updates margin, but leaves old number of gridlines, shouldn't it be updated as well?

Here is my fiddle http://jsfiddle.net/sabira/r0zvouyp/

Thank you in advance!

Highcharts.chart('container', {
    chart:{
    events: {
      load: function(){
      const chart = this;
        const {title, yAxis} = chart;
                setRightDy(title);

      const ticks = chart.yAxis[0].ticks;
      let topTick = null;
      for(let tick in ticks){
        if(ticks[tick].isLast)  {
        topTick = tick;
        }
      }
      const tickY = ticks[topTick].label.xy.y;
      const extraMargin = chart.plotTop-tickY + 10;
      const currentMargin = chart.title.alignOptions.margin;

      chart.title.update({
        margin: currentMargin+extraMargin
      }, true, false, false)
      }
    }
  },
    title: {
        align: 'left',
        text: `
         Lorem ipsum dolor sit amet

        Integer quis pharetra tellus. Cras tincidunt libero id dignissim convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

Sed aliquam ligula in pretium lobortis.
        Integer quis pharetra tellus. Cras tincidunt libero id dignissim convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

Sed aliquam ligula in pretium lobortis.

        `,
        widthAdjust: -40,
        margin: 20,
    },
    exporting: {
    scale: 1
    },
    yAxis: {
      labels: {
        align: 'left',
        x: 0,
        y: -4
      }
    },
    series: [{
        data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
    }],
});

Body:
The problem which you are struggling to is that you set the new margin after the initial load, which changes and animate the chart. However, the export server renders a new chart with a options which you used to set but without loading the load callback, because there is no delay time to do it.

Why don't you just set the calculated margin as a fixed value in the title.margin object and set the wanted amount of ticks to get it? The visual output is the same.

Demo: https://jsfiddle.net/BlackLabel/owr6f7z2/

  yAxis: {
    labels: {
      align: 'left',
      x: 0,
      y: -4
    },
    tickAmount: 7
  },

API: https://api.highcharts.com/highcharts/yAxis.tickAmount

If this answer wouldn't fit your requirements please describe more precisely what do you want to achieve.


问:
ASP.NET - Separate validation of two forms on one page?
I have what should be a fairly simple ASP.NET question, and one I thought I had found a workaround for in the past, but this time I'm having no end of bother trying to get a working solution for it.

I have an ASP.NET page with a number of input controls and a series of form validators for them.  I wish the page to have separate forms where only some validators are fired by submit button A and others are fired by submit button B.  An example would be a site that included a site search box with validation, and a comments section or form to fill in on the same page.  When submitting comments you would not want the search validation to fire, and when running a search you would not want the comment form validators to fire.

What I need is a kind of 'validation panel', or separate form tags to enclose these sections in.  Can anyone help?

答:
You can use ValidationGroup property for this.

But don't forget, you can not have more then one form in your asp.net page.

OwnerDisplayName: davemckay

OwnerDisplayName: ScarletGarden

ContentLicense: CC BY-SA 2.5


问:
All possible exact sums from multiple arrays
I've been given the following problem and my code has become a horrible mess and I'm quite stuck.

You are given an allowance to spend at some shops (something like $15, just some positive integer)
You may only spend this money under two conditions:

1) You buy exactly one item from each shop.

2) You spend all of your money (nothing left over, and no debt)

Find all possible ways you could have purchased items to satisfy the above.

In actuality, you're given a budget int and some array like

9 and [[1,2,3],[0,5],[2,3,8]]

where each inner array lists the prices of items in the a shop. There can be arbitrarily many shops with arbitrarily many items. Costs cannot be negative, but they can be free!

The expected solution here would be:

[[1,5,3],[2,5,2],[1,0,8]]

As each array contains one item from each shop, each totals 9, and all possibilities are present.
Just to make it more difficult, speed is paramount.

The following is my code that has descended into madness and a near complete lack of functionality:

def Stepper(bud,LOL):
    n=len(LOL)
    lasts=[]
    indices=[0 for j in range(n)]
    focus=0
    funds=[0 for j in range(n+1)]
    funds[0]=bud
    sols=[]
    moveable=[]
    for j in range(n):
        length=len(LOL[j])
        if(length==0):
            return []
        lasts.append(length-1)
        if(moveable==[]):
            if(length==1):
                funds[j+1]=funds[j]-LOL[j][0]
            else:
                moveable.append(j)
                focus=j
    while(moveable!=[]):
        while(LOL[focus][indices[focus]] > funds[focus]):
            indices[focus]+=1
        if(indices[focus]==lasts[focus]):
            if(moveable[-1]==focus):
                moveable.remove(focus)
            if(moveable==[]):
                if(focus<n-1):
                    moveable.append(focus+1)
        funds[focus+1]=funds[focus]-LOL[focus][indices[focus]]
        #print(n,lasts,indices,focus,moveable,funds,sols)
        if((funds[focus+1]!=0) and (focus<n-1)):
                focus+=1
                indices[focus]=0
        else:
            if(funds[focus+1]==0):
                for j in range(focus+1,n):
                    indices[j]=lasts[j]
                sols.append(list(indices))
            if(moveable[-1]==n-1):
                moveable.remove(n-1)
            if(moveable!=[]):
                focus=moveable[-1]
                indices[focus]+=1
                if(indices[focus]==lasts[focus]):
                    if(moveable[-1]==focus):
                        moveable.remove(focus)
                    if(moveable==[]):
                        if(focus<n-1):
                            moveable.append(focus+1)
                funds[focus+1]=funds[focus]-LOL[focus][indices[focus]]
                focus+=1
                indices[focus]=0
    return(sols)
```

where bud is the budget and LOL is the list of lists (the shops and prices)

答:
Here is a simple, and probably inefficient, way to solve it.

```<code>In [70]: s = [[1,2,3],[0,5],[2,3,8]]
In [71]: n = 9
In [72]: for x in s[0]:
    ...:     for y in s[1]:
    ...:         for z in s[2]:
    ...:             if x+y+z == n:
    ...:                 print(x,y,z)
    ...:
1 0 8
1 5 3
2 5 2
</code>```

Starting from the first shop, for any option, iterate over the next store, then again, for any option of the second store, iterate over the options of the next store. Sum up all the prices and check if the sum is equal to 9.

Body:
I've been given the following problem and my code has become a horrible mess and I'm quite stuck.

You are given an allowance to spend at some shops (something like $15, just some positive integer)
You may only spend this money under two conditions:

1) You buy exactly one item from each shop.

2) You spend all of your money (nothing left over, and no debt)

Find all possible ways you could have purchased items to satisfy the above.

In actuality, you're given a budget int and some array like

9 and [[1,2,3],[0,5],[2,3,8]]

where each inner array lists the prices of items in the a shop. There can be arbitrarily many shops with arbitrarily many items. Costs cannot be negative, but they can be free!

The expected solution here would be:

[[1,5,3],[2,5,2],[1,0,8]]

As each array contains one item from each shop, each totals 9, and all possibilities are present.
Just to make it more difficult, speed is paramount.

The following is my code that has descended into madness and a near complete lack of functionality:

def Stepper(bud,LOL):
    n=len(LOL)
    lasts=[]
    indices=[0 for j in range(n)]
    focus=0
    funds=[0 for j in range(n+1)]
    funds[0]=bud
    sols=[]
    moveable=[]
    for j in range(n):
        length=len(LOL[j])
        if(length==0):
            return []
        lasts.append(length-1)
        if(moveable==[]):
            if(length==1):
                funds[j+1]=funds[j]-LOL[j][0]
            else:
                moveable.append(j)
                focus=j
    while(moveable!=[]):
        while(LOL[focus][indices[focus]] > funds[focus]):
            indices[focus]+=1
        if(indices[focus]==lasts[focus]):
            if(moveable[-1]==focus):
                moveable.remove(focus)
            if(moveable==[]):
                if(focus<n-1):
                    moveable.append(focus+1)
        funds[focus+1]=funds[focus]-LOL[focus][indices[focus]]
        #print(n,lasts,indices,focus,moveable,funds,sols)
        if((funds[focus+1]!=0) and (focus<n-1)):
                focus+=1
                indices[focus]=0
        else:
            if(funds[focus+1]==0):
                for j in range(focus+1,n):
                    indices[j]=lasts[j]
                sols.append(list(indices))
            if(moveable[-1]==n-1):
                moveable.remove(n-1)
            if(moveable!=[]):
                focus=moveable[-1]
                indices[focus]+=1
                if(indices[focus]==lasts[focus]):
                    if(moveable[-1]==focus):
                        moveable.remove(focus)
                    if(moveable==[]):
                        if(focus<n-1):
                            moveable.append(focus+1)
                funds[focus+1]=funds[focus]-LOL[focus][indices[focus]]
                focus+=1
                indices[focus]=0
    return(sols)

where bud is the budget and LOL is the list of lists (the shops and prices)

Body:
Here is a simple, and probably inefficient, way to solve it.

In [70]: s = [[1,2,3],[0,5],[2,3,8]]
In [71]: n = 9
In [72]: for x in s[0]:
    ...:     for y in s[1]:
    ...:         for z in s[2]:
    ...:             if x+y+z == n:
    ...:                 print(x,y,z)
    ...:
1 0 8
1 5 3
2 5 2

Starting from the first shop, for any option, iterate over the next store, then again, for any option of the second store, iterate over the options of the next store. Sum up all the prices and check if the sum is equal to 9.


问:
How do I replace a character in a string in Java?
Using Java, I want to go through the lines of a text and replace all ampersand symbols (&) with the XML entity reference &.

I scan the lines of the text and then each word in the text with the Scanner class. Then I use the CharacterIterator to iterate over each characters of the word.  However, how can I replace the character?  First, Strings are immutable objects.  Second, I want to replace a character (&) with several characters(amp&;).  How should I approach this?

```<code>CharacterIterator it = new StringCharacterIterator(token);
for(char ch = it.first(); ch != CharacterIterator.DONE; ch = it.next()) {
       if(ch == '&') {

       }
}
</code>```

答:
```<code>String taskLatLng = task.getTask_latlng().replaceAll( "\\(","").replaceAll("\\)","").replaceAll("lat/lng:", "").trim();
</code>```

Body:
Using Java, I want to go through the lines of a text and replace all ampersand symbols (&) with the XML entity reference &.

I scan the lines of the text and then each word in the text with the Scanner class. Then I use the CharacterIterator to iterate over each characters of the word.  However, how can I replace the character?  First, Strings are immutable objects.  Second, I want to replace a character (&) with several characters(amp&;).  How should I approach this?

CharacterIterator it = new StringCharacterIterator(token);
for(char ch = it.first(); ch != CharacterIterator.DONE; ch = it.next()) {
       if(ch == '&') {

       }
}


答:
You just need to use get() in your function, so that it can be recognized as a variable in aes(), while being recognized as a character string in xlab():

```<code>library(tidyverse)
attach(mpg)

plot_func <- function(col_name) {
  ggplot(mpg,aes(x = get(col_name), fill = class)) +
    geom_bar() +
    xlab(col_name)
}

plot_func("drv")
</code>```

Title: Wrong axis label while passing column name in ggplot function

Body:
You just need to use get() in your function, so that it can be recognized as a variable in aes(), while being recognized as a character string in xlab():

library(tidyverse)
attach(mpg)

plot_func <- function(col_name) {
  ggplot(mpg,aes(x = get(col_name), fill = class)) +
    geom_bar() +
    xlab(col_name)
}

plot_func("drv")


答:
If you are allowed to use itertools

```<code>import itertools
x =  [[1,2,3],[0,5],[2,3,8]]
combinations = list(itertools.product(*x))
for o in combinations:
    if sum(o) == 9:
        print(o)
</code>```

Output:

```<code>(1, 0, 8)
(1, 5, 3)
(2, 5, 2)
</code>```

Depends on this question.

Title: All possible exact sums from multiple arrays

Body:
If you are allowed to use itertools

import itertools
x =  [[1,2,3],[0,5],[2,3,8]]
combinations = list(itertools.product(*x))
for o in combinations:
    if sum(o) == 9:
        print(o)

Output:

(1, 0, 8)
(1, 5, 3)
(2, 5, 2)

Depends on this question.


问:
Parallel task takes longer than single task
I'm trying to create parallel task. The task call same method. Method is processing some values.

Here is the sample code:

```<code>private OpcClient client = new OpcClient();

    private void starttask()
    {
        client = new OpcClient("opc.tcp://172.16.100.1:55105");
        client.Connect();

        List<string> mytask = new List<string>();
        mytask.Add("process1");
        mytask.Add("process2");

        Parallel.For(0, 2, new ParallelOptions { MaxDegreeOfParallelism = 2 }, i =>
        {
            mymethod(mytask[i]);

        });

    }

    private string mymethod(string node)
    {
           OpcNodeInfo machineNode = client.BrowseNode(node);
            string val = "";
            foreach (var childNode in machineNode.Children())
            {
                string _node = childNode.NodeId.ValueAsString;
               val = client.ReadNode("ns=6;s=" + _node).ToString();
                Console.WriteLine("Value = " + val);
            }

            return val;
    }
</code>```

Problem is when I call this method without task the processing takes let's say 7 seconds, but calling in parallel this takes little bit more than double, so let's say 15 seconds. The method is processing same data for task1 and task2 but from different place (address)...

Why is that? Shouldn't be that both tasks are done in the same time or I'm missing something?

答:
This seems to be IO Bound.

Does the PLC support concurrent reading well? Sounds like it's bottlenecking.

Try reading from two different PLCs and you might get faster results as well.

If you just add some dummy calculation (or Thread.Sleep()) in mymethod(), you will see that it runs faster in parallel.

Body:
I'm trying to create parallel task. The task call same method. Method is processing some values.

Here is the sample code:

private OpcClient client = new OpcClient();

    private void starttask()
    {
        client = new OpcClient("opc.tcp://172.16.100.1:55105");
        client.Connect();

        List<string> mytask = new List<string>();
        mytask.Add("process1");
        mytask.Add("process2");

        Parallel.For(0, 2, new ParallelOptions { MaxDegreeOfParallelism = 2 }, i =>
        {
            mymethod(mytask[i]);

        });

    }

    private string mymethod(string node)
    {
           OpcNodeInfo machineNode = client.BrowseNode(node);
            string val = "";
            foreach (var childNode in machineNode.Children())
            {
                string _node = childNode.NodeId.ValueAsString;
               val = client.ReadNode("ns=6;s=" + _node).ToString();
                Console.WriteLine("Value = " + val);
            }

            return val;
    }

Problem is when I call this method without task the processing takes let's say 7 seconds, but calling in parallel this takes little bit more than double, so let's say 15 seconds. The method is processing same data for task1 and task2 but from different place (address)...

Why is that? Shouldn't be that both tasks are done in the same time or I'm missing something?


问:
Is there a way to provide custom value other than ClientIP for sessionAffinity in kubernetes?
First of all request goes to proxy service that i've implemented, service forwards request to pods randomly without using sessionAffinity. I want to send requests to same pod based on custom value that i've set in request parameters using post method. I've used sessionAffinity with my service yml.

Here's service yml with sessionAffinity:

```<code>apiVersion: v1
metadata:
  name: abcd-service
  namespace: ab-services
spec:
  ports:
  - name: http
    protocol: TCP
    port: ****
    targetPort: ****
    nodePort: *****
  selector:
    app: abcd-pod
  sessionAffinity: ClientIP
  sessionAffinityConfig:
    clientIP:
      timeoutSeconds: 600
  type: NodePort

</code>```

Now problem is that when request are send by multiple client's from same ip address all requests are directed to single pod and not to other replicas, causing uneven load balancing. But I don't want requests to be forwarded randomly either. i want all request's from same client or different client to be forwarded based on custom value that i set in post request and not by clientIP considering clientIP resolves to source ip of each request.

答:
As you can read here, it currently supports only ClientIP and None values.

sessionAffinity string Supports "ClientIP" and "None". Used to maintain session affinity. Enable client IP based session affinity.
  Must be ClientIP or None. Defaults to None. More info:
  https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies

Unfortunatelly there are no other values allowed.

Body:
First of all request goes to proxy service that i've implemented, service forwards request to pods randomly without using sessionAffinity. I want to send requests to same pod based on custom value that i've set in request parameters using post method. I've used sessionAffinity with my service yml.

Here's service yml with sessionAffinity:

apiVersion: v1
metadata:
  name: abcd-service
  namespace: ab-services
spec:
  ports:
  - name: http
    protocol: TCP
    port: ****
    targetPort: ****
    nodePort: *****
  selector:
    app: abcd-pod
  sessionAffinity: ClientIP
  sessionAffinityConfig:
    clientIP:
      timeoutSeconds: 600
  type: NodePort

Now problem is that when request are send by multiple client's from same ip address all requests are directed to single pod and not to other replicas, causing uneven load balancing. But I don't want requests to be forwarded randomly either. i want all request's from same client or different client to be forwarded based on custom value that i set in post request and not by clientIP considering clientIP resolves to source ip of each request.


问:
How to keep different content of one file in my local and github repository?
I have a database.php. I want to keep it in my github repository without any sensitive information.

First I pushed to my repository without any sensitive info.

Now I added my database info so that I can use it locally.

I added to .gitignore. And I did rm --cached database.php. But it deleted the database.php from my github repository after a push.

How can I keep different content in my local and github repository?

Thanks in advance.

答:
You should use a filter driver able to:

on checkout, in the smudge script, detect the content (those 'filter driver' scripts don't have the name of the files they are filtering) of a database.template

generate the private, always ignored, database.php, based on the values of a:

database.private.value file (also always ignored)

or, if database.private.value isn't found (which is the case for your user cloning your repo), a database.public.value file (which is pushed to the remote repo)

no need to do anything on the commit (script clean) step.


问:
Troupbles with creating apk with React Native
I'm new too React Native and just created an app with this command
    react-native init rnapp
It's ouputed many warnings:

```<code>npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","a
rch":"x64"})
npm WARN react-native@0.61.5 requires a peer of react@16.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: abbrev@1.1.1 (node_modules\fsevents\node_modules\abbrev):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\abbrev' -> 'D:\rn
app\node_modules\fsevents\node_modules\.abbrev.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ansi-regex@2.1.1 (node_modules\fsevents\node_modules\ansi-regex):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\ansi-regex' -> 'D
:\rnapp\node_modules\fsevents\node_modules\.ansi-regex.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: aproba@1.2.0 (node_modules\fsevents\node_modules\aproba):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\aproba' -> 'D:\rn
app\node_modules\fsevents\node_modules\.aproba.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: balanced-match@1.0.0 (node_modules\fsevents\node_modules\balanced-match):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\balanced-match' -
> 'D:\rnapp\node_modules\fsevents\node_modules\.balanced-match.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: chownr@1.1.3 (node_modules\fsevents\node_modules\chownr):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\chownr' -> 'D:\rn
app\node_modules\fsevents\node_modules\.chownr.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: code-point-at@1.1.0 (node_modules\fsevents\node_modules\code-point-at):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\code-point-at' ->
 'D:\rnapp\node_modules\fsevents\node_modules\.code-point-at.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: concat-map@0.0.1 (node_modules\fsevents\node_modules\concat-map):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\concat-map' -> 'D
:\rnapp\node_modules\fsevents\node_modules\.concat-map.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: console-control-strings@1.1.0 (node_modules\fsevents\node_modules\console-control-strings):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\console-control-s
trings' -> 'D:\rnapp\node_modules\fsevents\node_modules\.console-control-strings.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: core-util-is@1.0.2 (node_modules\fsevents\node_modules\core-util-is):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\core-util-is' ->
'D:\rnapp\node_modules\fsevents\node_modules\.core-util-is.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: deep-extend@0.6.0 (node_modules\fsevents\node_modules\deep-extend):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\deep-extend' -> '
D:\rnapp\node_modules\fsevents\node_modules\.deep-extend.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: delegates@1.0.0 (node_modules\fsevents\node_modules\delegates):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\delegates' -> 'D:
\rnapp\node_modules\fsevents\node_modules\.delegates.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: detect-libc@1.0.3 (node_modules\fsevents\node_modules\detect-libc):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\detect-libc' -> '
D:\rnapp\node_modules\fsevents\node_modules\.detect-libc.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs.realpath@1.0.0 (node_modules\fsevents\node_modules\fs.realpath):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\fs.realpath' -> '
D:\rnapp\node_modules\fsevents\node_modules\.fs.realpath.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: has-unicode@2.0.1 (node_modules\fsevents\node_modules\has-unicode):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\has-unicode' -> '
D:\rnapp\node_modules\fsevents\node_modules\.has-unicode.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: inherits@2.0.4 (node_modules\fsevents\node_modules\inherits):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\inherits' -> 'D:\
rnapp\node_modules\fsevents\node_modules\.inherits.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ini@1.3.5 (node_modules\fsevents\node_modules\ini):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\ini' -> 'D:\rnapp
\node_modules\fsevents\node_modules\.ini.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: isarray@1.0.0 (node_modules\fsevents\node_modules\isarray):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\isarray' -> 'D:\r
napp\node_modules\fsevents\node_modules\.isarray.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: minimist@0.0.8 (node_modules\fsevents\node_modules\minimist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\minimist' -> 'D:\
rnapp\node_modules\fsevents\node_modules\.minimist.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ms@2.1.2 (node_modules\fsevents\node_modules\ms):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\ms' -> 'D:\rnapp\
node_modules\fsevents\node_modules\.ms.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: npm-normalize-package-bin@1.0.1 (node_modules\fsevents\node_modules\npm-normalize-package-bin):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\npm-normalize-pac
kage-bin' -> 'D:\rnapp\node_modules\fsevents\node_modules\.npm-normalize-package-bin.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: number-is-nan@1.0.1 (node_modules\fsevents\node_modules\number-is-nan):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\number-is-nan' ->
 'D:\rnapp\node_modules\fsevents\node_modules\.number-is-nan.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: object-assign@4.1.1 (node_modules\fsevents\node_modules\object-assign):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\object-assign' ->
 'D:\rnapp\node_modules\fsevents\node_modules\.object-assign.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: os-homedir@1.0.2 (node_modules\fsevents\node_modules\os-homedir):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\os-homedir' -> 'D
:\rnapp\node_modules\fsevents\node_modules\.os-homedir.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: os-tmpdir@1.0.2 (node_modules\fsevents\node_modules\os-tmpdir):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\os-tmpdir' -> 'D:
\rnapp\node_modules\fsevents\node_modules\.os-tmpdir.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: path-is-absolute@1.0.1 (node_modules\fsevents\node_modules\path-is-absolute):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\path-is-absolute'
 -> 'D:\rnapp\node_modules\fsevents\node_modules\.path-is-absolute.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: process-nextick-args@2.0.1 (node_modules\fsevents\node_modules\process-nextick-args):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\process-nextick-a
rgs' -> 'D:\rnapp\node_modules\fsevents\node_modules\.process-nextick-args.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: minimist@1.2.0 (node_modules\fsevents\node_modules\rc\node_modules\minimist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\rc\node_modules\m
inimist' -> 'D:\rnapp\node_modules\fsevents\node_modules\rc\node_modules\.minimist.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: safe-buffer@5.1.2 (node_modules\fsevents\node_modules\safe-buffer):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\safe-buffer' -> '
D:\rnapp\node_modules\fsevents\node_modules\.safe-buffer.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: safer-buffer@2.1.2 (node_modules\fsevents\node_modules\safer-buffer):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\safer-buffer' ->
'D:\rnapp\node_modules\fsevents\node_modules\.safer-buffer.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sax@1.2.4 (node_modules\fsevents\node_modules\sax):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\sax' -> 'D:\rnapp
\node_modules\fsevents\node_modules\.sax.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: semver@5.7.1 (node_modules\fsevents\node_modules\semver):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\semver' -> 'D:\rn
app\node_modules\fsevents\node_modules\.semver.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: set-blocking@2.0.0 (node_modules\fsevents\node_modules\set-blocking):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\set-blocking' ->
'D:\rnapp\node_modules\fsevents\node_modules\.set-blocking.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: signal-exit@3.0.2 (node_modules\fsevents\node_modules\signal-exit):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\signal-exit' -> '
D:\rnapp\node_modules\fsevents\node_modules\.signal-exit.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: strip-json-comments@2.0.1 (node_modules\fsevents\node_modules\strip-json-comments):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\strip-json-commen
ts' -> 'D:\rnapp\node_modules\fsevents\node_modules\.strip-json-comments.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: util-deprecate@1.0.2 (node_modules\fsevents\node_modules\util-deprecate):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\util-deprecate' -
> 'D:\rnapp\node_modules\fsevents\node_modules\.util-deprecate.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: wrappy@1.0.2 (node_modules\fsevents\node_modules\wrappy):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\wrappy' -> 'D:\rn
app\node_modules\fsevents\node_modules\.wrappy.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: yallist@3.1.1 (node_modules\fsevents\node_modules\yallist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\yallist' -> 'D:\r
napp\node_modules\fsevents\node_modules\.yallist.DELETE'
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN eslint-plugin-react-native@3.6.0 requires a peer of eslint@^3.17.0 || ^4 || ^5 but none is installed. You must install peer dependencies your
self.
npm WARN eslint-plugin-react@7.12.4 requires a peer of eslint@^3.0.0 || ^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies you
rself.
npm WARN @typescript-eslint/eslint-plugin@1.13.0 requires a peer of eslint@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @typescript-eslint/parser@1.13.0 requires a peer of eslint@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.
6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","a
rch":"x64"})
</code>```

Then I went to android folder and ran this command:

```<code>gradlew assemblerelease
</code>```

But then I get this:

*> Task :app:bundleReleaseJsAndAssets warning: the transform cache was reset. Loading dependency graph, done. info Writing bundle output to:,
  D:\rnapp\android\app\build\generated\assets\react\release\index.android.bundle
  info Writing sourcemap output to:,
  D:\rnapp\android\app\build\generated\sourcemaps\react\release\index.android.bundle.map
  info Done writing sourcemap output info Done writing bundle output
  info Copying 2 asset files info Done copying assets
  Task :app:mergeReleaseResources FAILED
  FAILURE: Build failed with an exception.
  * What went wrong:
  Execution failed for task ':app:mergeReleaseResources'.
  8 exceptions were raised by workers:
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #0: Daemon startup failed
    This should not happen under normal circumstances, please file an issue if it does.
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #1: Daemon startup failed
    This should not happen under normal circumstances, please file an issue if it does.
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #2: Daemon startup failed
    This should not happen under normal circumstances, please file an issue if it does.
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #3: Daemon startup failed
    This should not happen under normal circumstances, please file an issue if it does.
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #4: Daemon startup failed
    This should not happen under normal circumstances, please file an issue if it does.
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #5: Daemon startup failed
    This should not happen under normal circumstances, please file an issue if it does.
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #6: Daemon startup failed
    This should not happen under normal circumstances, please file an issue if it does.
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #7: Daemon startup failed*

Anyone knows how to fix that and build apk file for Android on that empty application?

答: First of all, you can clean your Gradle file, then use this command ./gradlew assembleRelease.

Body:
I'm new too React Native and just created an app with this command
    react-native init rnapp
It's ouputed many warnings:

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","a
rch":"x64"})
npm WARN react-native@0.61.5 requires a peer of react@16.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: abbrev@1.1.1 (node_modules\fsevents\node_modules\abbrev):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\abbrev' -> 'D:\rn
app\node_modules\fsevents\node_modules\.abbrev.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ansi-regex@2.1.1 (node_modules\fsevents\node_modules\ansi-regex):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\ansi-regex' -> 'D
:\rnapp\node_modules\fsevents\node_modules\.ansi-regex.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: aproba@1.2.0 (node_modules\fsevents\node_modules\aproba):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\aproba' -> 'D:\rn
app\node_modules\fsevents\node_modules\.aproba.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: balanced-match@1.0.0 (node_modules\fsevents\node_modules\balanced-match):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\balanced-match' -
> 'D:\rnapp\node_modules\fsevents\node_modules\.balanced-match.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: chownr@1.1.3 (node_modules\fsevents\node_modules\chownr):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\chownr' -> 'D:\rn
app\node_modules\fsevents\node_modules\.chownr.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: code-point-at@1.1.0 (node_modules\fsevents\node_modules\code-point-at):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\code-point-at' ->
 'D:\rnapp\node_modules\fsevents\node_modules\.code-point-at.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: concat-map@0.0.1 (node_modules\fsevents\node_modules\concat-map):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\concat-map' -> 'D
:\rnapp\node_modules\fsevents\node_modules\.concat-map.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: console-control-strings@1.1.0 (node_modules\fsevents\node_modules\console-control-strings):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\console-control-s
trings' -> 'D:\rnapp\node_modules\fsevents\node_modules\.console-control-strings.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: core-util-is@1.0.2 (node_modules\fsevents\node_modules\core-util-is):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\core-util-is' ->
'D:\rnapp\node_modules\fsevents\node_modules\.core-util-is.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: deep-extend@0.6.0 (node_modules\fsevents\node_modules\deep-extend):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\deep-extend' -> '
D:\rnapp\node_modules\fsevents\node_modules\.deep-extend.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: delegates@1.0.0 (node_modules\fsevents\node_modules\delegates):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\delegates' -> 'D:
\rnapp\node_modules\fsevents\node_modules\.delegates.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: detect-libc@1.0.3 (node_modules\fsevents\node_modules\detect-libc):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\detect-libc' -> '
D:\rnapp\node_modules\fsevents\node_modules\.detect-libc.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs.realpath@1.0.0 (node_modules\fsevents\node_modules\fs.realpath):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\fs.realpath' -> '
D:\rnapp\node_modules\fsevents\node_modules\.fs.realpath.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: has-unicode@2.0.1 (node_modules\fsevents\node_modules\has-unicode):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\has-unicode' -> '
D:\rnapp\node_modules\fsevents\node_modules\.has-unicode.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: inherits@2.0.4 (node_modules\fsevents\node_modules\inherits):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\inherits' -> 'D:\
rnapp\node_modules\fsevents\node_modules\.inherits.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ini@1.3.5 (node_modules\fsevents\node_modules\ini):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\ini' -> 'D:\rnapp
\node_modules\fsevents\node_modules\.ini.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: isarray@1.0.0 (node_modules\fsevents\node_modules\isarray):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\isarray' -> 'D:\r
napp\node_modules\fsevents\node_modules\.isarray.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: minimist@0.0.8 (node_modules\fsevents\node_modules\minimist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\minimist' -> 'D:\
rnapp\node_modules\fsevents\node_modules\.minimist.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ms@2.1.2 (node_modules\fsevents\node_modules\ms):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\ms' -> 'D:\rnapp\
node_modules\fsevents\node_modules\.ms.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: npm-normalize-package-bin@1.0.1 (node_modules\fsevents\node_modules\npm-normalize-package-bin):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\npm-normalize-pac
kage-bin' -> 'D:\rnapp\node_modules\fsevents\node_modules\.npm-normalize-package-bin.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: number-is-nan@1.0.1 (node_modules\fsevents\node_modules\number-is-nan):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\number-is-nan' ->
 'D:\rnapp\node_modules\fsevents\node_modules\.number-is-nan.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: object-assign@4.1.1 (node_modules\fsevents\node_modules\object-assign):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\object-assign' ->
 'D:\rnapp\node_modules\fsevents\node_modules\.object-assign.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: os-homedir@1.0.2 (node_modules\fsevents\node_modules\os-homedir):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\os-homedir' -> 'D
:\rnapp\node_modules\fsevents\node_modules\.os-homedir.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: os-tmpdir@1.0.2 (node_modules\fsevents\node_modules\os-tmpdir):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\os-tmpdir' -> 'D:
\rnapp\node_modules\fsevents\node_modules\.os-tmpdir.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: path-is-absolute@1.0.1 (node_modules\fsevents\node_modules\path-is-absolute):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\path-is-absolute'
 -> 'D:\rnapp\node_modules\fsevents\node_modules\.path-is-absolute.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: process-nextick-args@2.0.1 (node_modules\fsevents\node_modules\process-nextick-args):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\process-nextick-a
rgs' -> 'D:\rnapp\node_modules\fsevents\node_modules\.process-nextick-args.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: minimist@1.2.0 (node_modules\fsevents\node_modules\rc\node_modules\minimist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\rc\node_modules\m
inimist' -> 'D:\rnapp\node_modules\fsevents\node_modules\rc\node_modules\.minimist.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: safe-buffer@5.1.2 (node_modules\fsevents\node_modules\safe-buffer):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\safe-buffer' -> '
D:\rnapp\node_modules\fsevents\node_modules\.safe-buffer.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: safer-buffer@2.1.2 (node_modules\fsevents\node_modules\safer-buffer):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\safer-buffer' ->
'D:\rnapp\node_modules\fsevents\node_modules\.safer-buffer.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sax@1.2.4 (node_modules\fsevents\node_modules\sax):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\sax' -> 'D:\rnapp
\node_modules\fsevents\node_modules\.sax.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: semver@5.7.1 (node_modules\fsevents\node_modules\semver):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\semver' -> 'D:\rn
app\node_modules\fsevents\node_modules\.semver.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: set-blocking@2.0.0 (node_modules\fsevents\node_modules\set-blocking):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\set-blocking' ->
'D:\rnapp\node_modules\fsevents\node_modules\.set-blocking.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: signal-exit@3.0.2 (node_modules\fsevents\node_modules\signal-exit):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\signal-exit' -> '
D:\rnapp\node_modules\fsevents\node_modules\.signal-exit.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: strip-json-comments@2.0.1 (node_modules\fsevents\node_modules\strip-json-comments):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\strip-json-commen
ts' -> 'D:\rnapp\node_modules\fsevents\node_modules\.strip-json-comments.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: util-deprecate@1.0.2 (node_modules\fsevents\node_modules\util-deprecate):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\util-deprecate' -
> 'D:\rnapp\node_modules\fsevents\node_modules\.util-deprecate.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: wrappy@1.0.2 (node_modules\fsevents\node_modules\wrappy):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\wrappy' -> 'D:\rn
app\node_modules\fsevents\node_modules\.wrappy.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: yallist@3.1.1 (node_modules\fsevents\node_modules\yallist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'D:\rnapp\node_modules\fsevents\node_modules\yallist' -> 'D:\r
napp\node_modules\fsevents\node_modules\.yallist.DELETE'
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN eslint-plugin-react-native@3.6.0 requires a peer of eslint@^3.17.0 || ^4 || ^5 but none is installed. You must install peer dependencies your
self.
npm WARN eslint-plugin-react@7.12.4 requires a peer of eslint@^3.0.0 || ^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies you
rself.
npm WARN @typescript-eslint/eslint-plugin@1.13.0 requires a peer of eslint@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @typescript-eslint/parser@1.13.0 requires a peer of eslint@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.
6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","a
rch":"x64"})

Then I went to android folder and ran this command:

gradlew assemblerelease

But then I get this:

*> Task :app:bundleReleaseJsAndAssets warning: the transform cache was reset. Loading dependency graph, done. info Writing bundle output to:,
  D:\rnapp\android\app\build\generated\assets\react\release\index.android.bundle
  info Writing sourcemap output to:,
  D:\rnapp\android\app\build\generated\sourcemaps\react\release\index.android.bundle.map
  info Done writing sourcemap output info Done writing bundle output
  info Copying 2 asset files info Done copying assets
  Task :app:mergeReleaseResources FAILED
  FAILURE: Build failed with an exception.
  * What went wrong:
  Execution failed for task ':app:mergeReleaseResources'.
  8 exceptions were raised by workers:
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #0: Daemon startup failed
    This should not happen under normal circumstances, please file an issue if it does.
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #1: Daemon startup failed
    This should not happen under normal circumstances, please file an issue if it does.
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #2: Daemon startup failed
    This should not happen under normal circumstances, please file an issue if it does.
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #3: Daemon startup failed
    This should not happen under normal circumstances, please file an issue if it does.
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #4: Daemon startup failed
    This should not happen under normal circumstances, please file an issue if it does.
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #5: Daemon startup failed
    This should not happen under normal circumstances, please file an issue if it does.
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #6: Daemon startup failed
    This should not happen under normal circumstances, please file an issue if it does.
    com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-windows Daemon #7: Daemon startup failed*

Anyone knows how to fix that and build apk file for Android on that empty application?


问:
Tweepy returns inconsistent and not complete results for realDonaldTrump
```<code>import tweepy
import csv
import json
import nltk
import re

def scrub_text(string):
    nltk.download('words')
    words = set(nltk.corpus.words.words())

    string=re.sub(r'[^a-zA-Z]+', ' ', string).lower()
    string=" ".join(w for w in nltk.wordpunct_tokenize(string)
                if w.lower() in words or not w.isalpha())
    return string

def get_all_tweets():
    with open('twitter_credentials.json') as cred_data:
        info=json.load(cred_data)
        consumer_key=info['API_KEY']
        consumer_secret=info['API_SECRET']
        access_key=info['ACCESS_TOKEN']
        access_secret=info['ACCESS_SECRET']

    screen_name = input("Enter twitter Handle: ")

    auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
    api=tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True,
                   timeout=500000, retry_count=10, retry_delay=100)

    all_the_tweets=[]

    new_tweets=api.user_timeline(screen_name=screen_name, count=200)

    all_the_tweets.extend(new_tweets)

    oldest_tweet=all_the_tweets[-1].id - 1

    while len(new_tweets) > 0:
        new_tweets=api.user_timeline(screen_name=screen_name, count=200,
                                     max_id=oldest_tweet)
        all_the_tweets.extend(new_tweets)
        oldest_tweet=all_the_tweets[-1].id -1

        print('...%s tweets downloaded' %len(all_the_tweets))

    outtweets=[[tweet.text.encode('utf-8')] for tweet in all_the_tweets]
    outtweets=scrub_text(str(outtweets))

    with open('tweets.txt', 'w') as f:
        f.write(outtweets)
        f.close()
</code>```

<p>The above python code should download all the tweets from a particular user.
It seems to work for most handles, but when I use it for @realDonaldTrump I sometimes get 800, sometimes I get 1. I never get even close to all of the tweets.
I am assuming that there is a problem due to how active the account is, but I think there should be a way to get around this. </p>

答:
The Twitter timelines API only supports a maximum of 3200 Tweets (source), and this may also depend on age of the Tweet / how far back in time you are paging. Unfortunately, you will not be able to use the API to get all of these Tweets. You would need to use the commercial Full Archive search API to retrieve all of the Tweets from the account.

Regarding the inconsistent number of results, that sounds like a glitch, as it shouldn't vary by that much.

Body:
import tweepy
import csv
import json
import nltk
import re

def scrub_text(string):
    nltk.download('words')
    words = set(nltk.corpus.words.words())

    string=re.sub(r'[^a-zA-Z]+', ' ', string).lower()
    string=" ".join(w for w in nltk.wordpunct_tokenize(string)
                if w.lower() in words or not w.isalpha())
    return string

def get_all_tweets():
    with open('twitter_credentials.json') as cred_data:
        info=json.load(cred_data)
        consumer_key=info['API_KEY']
        consumer_secret=info['API_SECRET']
        access_key=info['ACCESS_TOKEN']
        access_secret=info['ACCESS_SECRET']

    screen_name = input("Enter twitter Handle: ")

    auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
    api=tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True,
                   timeout=500000, retry_count=10, retry_delay=100)

    all_the_tweets=[]

    new_tweets=api.user_timeline(screen_name=screen_name, count=200)

    all_the_tweets.extend(new_tweets)

    oldest_tweet=all_the_tweets[-1].id - 1

    while len(new_tweets) > 0:
        new_tweets=api.user_timeline(screen_name=screen_name, count=200,
                                     max_id=oldest_tweet)
        all_the_tweets.extend(new_tweets)
        oldest_tweet=all_the_tweets[-1].id -1

        print('...%s tweets downloaded' %len(all_the_tweets))

    outtweets=[[tweet.text.encode('utf-8')] for tweet in all_the_tweets]
    outtweets=scrub_text(str(outtweets))

    with open('tweets.txt', 'w') as f:
        f.write(outtweets)
        f.close()

The above python code should download all the tweets from a particular user.
It seems to work for most handles, but when I use it for @realDonaldTrump I sometimes get 800, sometimes I get 1. I never get even close to all of the tweets.
I am assuming that there is a problem due to how active the account is, but I think there should be a way to get around this.


问:
How to Increment count based on condition
I'm trying to extract a new column based on a condition so the new column will act as a counter and it will just count if (MessageDate1- MessageDate2).TotalMinutes > 10.

For example if i've the following input:

```<code>╔════════════════╦═══════════════════════╦═══════════════════════╗
║ ConversationId ║     MessageDate1      ║     MessageDate2      ║
╠════════════════╬═══════════════════════╬═══════════════════════╣
║              1 ║ 2/15/2012 11:53:16 AM ║ 1/1/0001 12:00:00 AM  ║
║              1 ║ 2/16/2012 11:53:20 AM ║ 2/15/2012 11:53:16 AM ║
║              1 ║ 2/16/2012 11:54:01 AM ║ 2/16/2012 11:53:20 AM ║
║              1 ║ 2/16/2012 11:05:03 PM ║ 2/16/2012 11:54:01 AM ║
║              1 ║ 2/16/2012 11:09:03 PM ║ 2/16/2012 11:05:03 PM ║
║              1 ║ 2/16/2012 11:11:03 PM ║ 2/16/2012 11:09:03 PM ║
║              1 ║ 2/16/2012 11:11:04 PM ║ 2/16/2012 11:11:03 PM ║
║              1 ║ 2/16/2012 11:11:05 PM ║ 2/16/2012 11:11:04 PM ║
║              1 ║ 2/16/2012 11:22:06 PM ║ 2/16/2012 11:11:05 PM ║
║              1 ║ 2/17/2012 11:05:03 PM ║ 2/16/2012 11:22:06 PM ║
║              1 ║ 2/17/2012 11:09:03 PM ║ 2/17/2012 11:05:03 PM ║
║              1 ║ 2/17/2012 11:11:03 PM ║ 2/17/2012 11:09:03 PM ║
║              2 ║ 2/15/2012 11:53:18 AM ║ 1/1/0001 12:00:00 AM  ║
║              2 ║ 2/16/2012 11:54:01 AM ║ 2/15/2012 11:53:18 AM ║
║              2 ║ 2/16/2012 11:54:02 AM ║ 2/16/2012 11:54:01 AM ║
║              3 ║ 2/16/2012 11:53:50 AM ║ 1/1/0001 12:00:00 AM  ║
║              3 ║ 2/16/2012 11:54:50 AM ║ 2/16/2012 11:53:50 AM ║
║              4 ║ 2/16/2012 11:54:04 AM ║ 1/1/0001 12:00:00 AM  ║
╚════════════════╩═══════════════════════╩═══════════════════════╝
</code>```

So the output would be:

```<code>╔════════════════╦═══════════════════════╦═══════════════════════╦═════════╗
║ ConversationID ║     MessageDate1      ║     MessageDate2      ║ Counter ║
╠════════════════╬═══════════════════════╬═══════════════════════╬═════════╣
║              1 ║ 2/15/2012 11:53:16 AM ║ 1/1/0001 12:00:00 AM  ║       1 ║
║              1 ║ 2/16/2012 11:53:20 AM ║ 2/15/2012 11:53:16 AM ║       2 ║
║              1 ║ 2/16/2012 11:54:01 AM ║ 2/16/2012 11:53:20 AM ║       2 ║
║              1 ║ 2/16/2012 11:05:03 PM ║ 2/16/2012 11:54:01 AM ║       3 ║
║              1 ║ 2/16/2012 11:09:03 PM ║ 2/16/2012 11:05:03 PM ║       3 ║
║              1 ║ 2/16/2012 11:11:03 PM ║ 2/16/2012 11:09:03 PM ║       3 ║
║              1 ║ 2/16/2012 11:11:04 PM ║ 2/16/2012 11:11:03 PM ║       3 ║
║              1 ║ 2/16/2012 11:11:05 PM ║ 2/16/2012 11:11:04 PM ║       3 ║
║              1 ║ 2/16/2012 11:22:06 PM ║ 2/16/2012 11:11:05 PM ║       4 ║
║              1 ║ 2/17/2012 11:05:03 PM ║ 2/16/2012 11:22:06 PM ║       5 ║
║              1 ║ 2/17/2012 11:09:03 PM ║ 2/17/2012 11:05:03 PM ║       5 ║
║              1 ║ 2/17/2012 11:11:03 PM ║ 2/17/2012 11:09:03 PM ║       5 ║
║              2 ║ 2/15/2012 11:53:18 AM ║ 1/1/0001 12:00:00 AM  ║       6 ║
║              2 ║ 2/16/2012 11:54:01 AM ║ 2/15/2012 11:53:18 AM ║       7 ║
║              2 ║ 2/16/2012 11:54:02 AM ║ 2/16/2012 11:54:01 AM ║       7 ║
║              3 ║ 2/16/2012 11:53:50 AM ║ 1/1/0001 12:00:00 AM  ║       8 ║
║              3 ║ 2/16/2012 11:54:50 AM ║ 2/16/2012 11:53:50 AM ║       8 ║
║              4 ║ 2/16/2012 11:54:04 AM ║ 1/1/0001 12:00:00 AM  ║       9 ║
╚════════════════╩═══════════════════════╩═══════════════════════╩═════════╝
</code>```

答:
Assuming you have a column that specifies the ordering, then you can use lag() and a cumulative sum():

```<code>select t.*,
       sum(case when prev_md2 > dateadd(minute, -10, messagedate1) and
                     prev_md2 < dateadd(minute, 10, messagedate1)
                then 0 else 1
           end) over (order by <ordering col>) as grp
from (select t.*,
             lag(messagedate2) over (order by <ordering col>) as prev_md2
      from t
     ) t;
</code>```

Body:
I'm trying to extract a new column based on a condition so the new column will act as a counter and it will just count if (MessageDate1- MessageDate2).TotalMinutes > 10.

For example if i've the following input:

╔════════════════╦═══════════════════════╦═══════════════════════╗
║ ConversationId ║     MessageDate1      ║     MessageDate2      ║
╠════════════════╬═══════════════════════╬═══════════════════════╣
║              1 ║ 2/15/2012 11:53:16 AM ║ 1/1/0001 12:00:00 AM  ║
║              1 ║ 2/16/2012 11:53:20 AM ║ 2/15/2012 11:53:16 AM ║
║              1 ║ 2/16/2012 11:54:01 AM ║ 2/16/2012 11:53:20 AM ║
║              1 ║ 2/16/2012 11:05:03 PM ║ 2/16/2012 11:54:01 AM ║
║              1 ║ 2/16/2012 11:09:03 PM ║ 2/16/2012 11:05:03 PM ║
║              1 ║ 2/16/2012 11:11:03 PM ║ 2/16/2012 11:09:03 PM ║
║              1 ║ 2/16/2012 11:11:04 PM ║ 2/16/2012 11:11:03 PM ║
║              1 ║ 2/16/2012 11:11:05 PM ║ 2/16/2012 11:11:04 PM ║
║              1 ║ 2/16/2012 11:22:06 PM ║ 2/16/2012 11:11:05 PM ║
║              1 ║ 2/17/2012 11:05:03 PM ║ 2/16/2012 11:22:06 PM ║
║              1 ║ 2/17/2012 11:09:03 PM ║ 2/17/2012 11:05:03 PM ║
║              1 ║ 2/17/2012 11:11:03 PM ║ 2/17/2012 11:09:03 PM ║
║              2 ║ 2/15/2012 11:53:18 AM ║ 1/1/0001 12:00:00 AM  ║
║              2 ║ 2/16/2012 11:54:01 AM ║ 2/15/2012 11:53:18 AM ║
║              2 ║ 2/16/2012 11:54:02 AM ║ 2/16/2012 11:54:01 AM ║
║              3 ║ 2/16/2012 11:53:50 AM ║ 1/1/0001 12:00:00 AM  ║
║              3 ║ 2/16/2012 11:54:50 AM ║ 2/16/2012 11:53:50 AM ║
║              4 ║ 2/16/2012 11:54:04 AM ║ 1/1/0001 12:00:00 AM  ║
╚════════════════╩═══════════════════════╩═══════════════════════╝

So the output would be:

╔════════════════╦═══════════════════════╦═══════════════════════╦═════════╗
║ ConversationID ║     MessageDate1      ║     MessageDate2      ║ Counter ║
╠════════════════╬═══════════════════════╬═══════════════════════╬═════════╣
║              1 ║ 2/15/2012 11:53:16 AM ║ 1/1/0001 12:00:00 AM  ║       1 ║
║              1 ║ 2/16/2012 11:53:20 AM ║ 2/15/2012 11:53:16 AM ║       2 ║
║              1 ║ 2/16/2012 11:54:01 AM ║ 2/16/2012 11:53:20 AM ║       2 ║
║              1 ║ 2/16/2012 11:05:03 PM ║ 2/16/2012 11:54:01 AM ║       3 ║
║              1 ║ 2/16/2012 11:09:03 PM ║ 2/16/2012 11:05:03 PM ║       3 ║
║              1 ║ 2/16/2012 11:11:03 PM ║ 2/16/2012 11:09:03 PM ║       3 ║
║              1 ║ 2/16/2012 11:11:04 PM ║ 2/16/2012 11:11:03 PM ║       3 ║
║              1 ║ 2/16/2012 11:11:05 PM ║ 2/16/2012 11:11:04 PM ║       3 ║
║              1 ║ 2/16/2012 11:22:06 PM ║ 2/16/2012 11:11:05 PM ║       4 ║
║              1 ║ 2/17/2012 11:05:03 PM ║ 2/16/2012 11:22:06 PM ║       5 ║
║              1 ║ 2/17/2012 11:09:03 PM ║ 2/17/2012 11:05:03 PM ║       5 ║
║              1 ║ 2/17/2012 11:11:03 PM ║ 2/17/2012 11:09:03 PM ║       5 ║
║              2 ║ 2/15/2012 11:53:18 AM ║ 1/1/0001 12:00:00 AM  ║       6 ║
║              2 ║ 2/16/2012 11:54:01 AM ║ 2/15/2012 11:53:18 AM ║       7 ║
║              2 ║ 2/16/2012 11:54:02 AM ║ 2/16/2012 11:54:01 AM ║       7 ║
║              3 ║ 2/16/2012 11:53:50 AM ║ 1/1/0001 12:00:00 AM  ║       8 ║
║              3 ║ 2/16/2012 11:54:50 AM ║ 2/16/2012 11:53:50 AM ║       8 ║
║              4 ║ 2/16/2012 11:54:04 AM ║ 1/1/0001 12:00:00 AM  ║       9 ║
╚════════════════╩═══════════════════════╩═══════════════════════╩═════════╝

Body:
Assuming you have a column that specifies the ordering, then you can use lag() and a cumulative sum():

select t.*,
       sum(case when prev_md2 > dateadd(minute, -10, messagedate1) and
                     prev_md2 < dateadd(minute, 10, messagedate1)
                then 0 else 1
           end) over (order by <ordering col>) as grp
from (select t.*,
             lag(messagedate2) over (order by <ordering col>) as prev_md2
      from t
     ) t;


问:
Transfer data from C# Class to XML File
I want to transfer a variable containing DateTime string to the XML file. Is there any way to access data from C# Class in XML File.

Here's my C# Code:

```<code>DateTime dt = DateTime.Today.AddHours(17);
string datetime = dt.ToString("yyyy-MM-ddTHH:mm:ss");
</code>```

Here's my XML Code where I need to access this data string:

```<code><ProductLastModifiedDate>2020-02-21T09:00:00+05:30</ProductLastModifiedDate>
</code>```

In the above XML Code I want to set dateTime retrieved from C# class file.

答:
Use xml linq :</p>

```<code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
namespace XML
{
    class Program
    {
        const string FILENAME = @"c:\temp\test.xml";
        static void Main(string[] args)
        {
            DateTime dt = DateTime.Today.AddHours(17);
            string datetime = dt.ToString("yyyy-MM-ddTHH:mm:ss");

            XDocument doc = XDocument.Load(FILENAME);

            XElement date = doc.Descendants("ProductLastModifiedDate").FirstOrDefault();
            date.SetValue(datetime);
            doc.Save(FILENAME);

        }
    }
}
</code>```

Title: Transfer data from C# Class to XML File

Body:
I want to transfer a variable containing DateTime string to the XML file. Is there any way to access data from C# Class in XML File.

Here's my C# Code:

DateTime dt = DateTime.Today.AddHours(17);
string datetime = dt.ToString("yyyy-MM-ddTHH:mm:ss");

Here's my XML Code where I need to access this data string:

<ProductLastModifiedDate>2020-02-21T09:00:00+05:30</ProductLastModifiedDate>

In the above XML Code I want to set dateTime retrieved from C# class file.

Body:
Use xml linq :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
namespace XML
{
    class Program
    {
        const string FILENAME = @"c:\temp\test.xml";
        static void Main(string[] args)
        {
            DateTime dt = DateTime.Today.AddHours(17);
            string datetime = dt.ToString("yyyy-MM-ddTHH:mm:ss");

            XDocument doc = XDocument.Load(FILENAME);

            XElement date = doc.Descendants("ProductLastModifiedDate").FirstOrDefault();
            date.SetValue(datetime);
            doc.Save(FILENAME);

        }
    }
}


问:
Is there a way to make aptana 3 autoreload when i make changes to a py file in a django project?
Aptana makes it open in --noreload mode automatically because not doing so causes python instances to remain open or something like that, is there anyway to bypass this problem?</p>

答: As far as I know, it's not possible to auto-reload .py files within an Aptana Python run/debug configuration (which is what I'm assuming you're doing to get access to the call stack for debugging). I've been using Aptana for Python development for a couple of years, and I've yet to see a way to do this. if someone knows how, please share!</p>


问:
Label on top on input that uses flex
Im using flex to format input on a row format. But right now im trying to put label on top of those inputs and its not working. Im tried using display block and floating left or right but still remains on the left side. How should i style label so it floats to the top of those inputs?

This is the snippet:

.box {
        padding-top: 1rem;
    }

    .inside-box {
        max-width: 51rem;
        margin: 0 auto;
    }

    .form-group {
        display: flex;
        flex-direction: column;
    }

    .row {
        display: flex;
    }

    .razao-social-content {
        flex: 2 1 auto;
        /* grow shrink basis */
    }

    .rua-content {
        flex: 6 1 auto;
    }

    .municipio-content {
        flex: 4 1 auto;
    }

    .numero-content {
        flex: auto 1 auto;
    }

    .bairro-content {
        flex: 4 1 auto;
    }

    .telefone-content {
        flex: 1 1 auto;
    }

    .email-content {
        flex: 1 1 auto;
    }

    .categoria-content {
        flex: 2 1 auto;
    }

    .controlador-content {
        flex: 2 1 auto;
    }

    label {}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="box">
    <div class="inside-box">
        <form action="" class="form-group">
            <div class="row">
                <label class="lb" for="name">Razão Social</label>
                <input class="razao-social-content" type="text" id="name" placeholder="Informe o seu nome" required>
                <label class="lb" for="cnpj_distribuidor">CNPJ</label>
                <input class="cnpj-content" type="text" id="cnpj_distribuidor" placeholder="CNPJ" required>
            </div>
            <div class="row">
                <label for="rua">Rua</label>
                <input class="rua-content" type="text" id="rua" placeholder="Nome da rua" required>
                <label for="municipio">Município</label>
                <input class="municipio-content" type="text" id="municipio" placeholder="Nome do Município" required>
                <label for="numero">Número</label>
                <input class="numero-content" type="text" id="numero" placeholder="Número da Residência" required>
            </div>
            <div class="row">
                <label for="bairro">Bairro</label>
                <input class="bairro-content" type="text" id="bairro" placeholder="Nome do Bairro" required>
                <label for="uf">Estado</label>
                <input class="uf" type="text" id="uf" placeholder="Estado" required>
                <label for="cep">CEP</label>
                <input class="cep-content" type="text" id="cep" placeholder="CEP" required>
            </div>
            <div class="row">
                <label for="telefone1">Telefone</label>
                <input class="telefone-content" type="text" id="telefone1" placeholder="Telefone" required>
                <input class="telefone-content" type="text" id="telefone2" placeholder="Telefone" required>
                <input class="telefone-content" type="text" id="telefone3" placeholder="Telefone" required>
                <input class="telefone-content" type="text" id="telefone4" placeholder="Telefone" required>
            </div>
            <div class="row">
                <label for="email1">Email</label>
                <input class="email-content" type="text" id="email1" placeholder="Email" required>
                <input class="email-content" type="text" id="email2" placeholder="Email" required>
                <input class="email-content" type="text" id="email3" placeholder="Email" required>
                <input class="email-content" type="text" id="email4" placeholder="Email" required>
            </div>

            <div class="row">
                <label for="categoria">Categorias</label>
                <input class="categoria-content" type="text" id="categoria" placeholder="Informe as Categorias" required>
                <label for="data_constituicao">Data Da Constituição</label>
                <input class="data-content" type="date" id="data_constituicao" placeholder="Data da Constituição" required>
                <label for="data_cvm">Data da CVM</label>
                <input class="data-content" type="date" id="data_cvm" placeholder="Data do CVM" required>
            </div>
            <div class="row">
                <label for="controlador">Controlador</label>
                <input class="controlador-content" type="text" id="controlador" placeholder="Nome do Controlador" required>
                <label for="cnpj_controlador">CNPJ</label>
                <input class="cnpj-content" type="text" id="cnpj_controlador" placeholder="CNPJ" required>
            </div>
        </form>
    </div>
</div></code>```

This image link shows how I want it to be

https://www.figma.com/file/nuLJYzwr2LtoJxt4rPKDaI/Untitled?node-id=0%3A1

答:
Just wrap label and input inside a div and add : </p>

```<code>.row > div {
    display: flex;
    flex-direction: column;
}
</code>```

Title: Label on top on input that uses flex

Body:
Im using flex to format input on a row format. But right now im trying to put label on top of those inputs and its not working. Im tried using display block and floating left or right but still remains on the left side. How should i style label so it floats to the top of those inputs?

This is the snippet:

.box {
        padding-top: 1rem;
    }

    .inside-box {
        max-width: 51rem;
        margin: 0 auto;
    }

    .form-group {
        display: flex;
        flex-direction: column;
    }

    .row {
        display: flex;
    }

    .razao-social-content {
        flex: 2 1 auto;
        /* grow shrink basis */
    }

    .rua-content {
        flex: 6 1 auto;
    }

    .municipio-content {
        flex: 4 1 auto;
    }

    .numero-content {
        flex: auto 1 auto;
    }

    .bairro-content {
        flex: 4 1 auto;
    }

    .telefone-content {
        flex: 1 1 auto;
    }

    .email-content {
        flex: 1 1 auto;
    }

    .categoria-content {
        flex: 2 1 auto;
    }

    .controlador-content {
        flex: 2 1 auto;
    }

    label {}

        <form action="" class="form-group">

                Razão Social
                <input class="razao-social-content" type="text" id="name" placeholder="Informe o seu nome" required>
                CNPJ
                <input class="cnpj-content" type="text" id="cnpj_distribuidor" placeholder="CNPJ" required>

                Rua
                <input class="rua-content" type="text" id="rua" placeholder="Nome da rua" required>
                Município
                <input class="municipio-content" type="text" id="municipio" placeholder="Nome do Município" required>
                Número
                <input class="numero-content" type="text" id="numero" placeholder="Número da Residência" required>

                Bairro
                <input class="bairro-content" type="text" id="bairro" placeholder="Nome do Bairro" required>
                Estado
                <input class="uf" type="text" id="uf" placeholder="Estado" required>
                CEP
                <input class="cep-content" type="text" id="cep" placeholder="CEP" required>

                Telefone
                <input class="telefone-content" type="text" id="telefone1" placeholder="Telefone" required>
                <input class="telefone-content" type="text" id="telefone2" placeholder="Telefone" required>
                <input class="telefone-content" type="text" id="telefone3" placeholder="Telefone" required>
                <input class="telefone-content" type="text" id="telefone4" placeholder="Telefone" required>

                Email
                <input class="email-content" type="text" id="email1" placeholder="Email" required>
                <input class="email-content" type="text" id="email2" placeholder="Email" required>
                <input class="email-content" type="text" id="email3" placeholder="Email" required>
                <input class="email-content" type="text" id="email4" placeholder="Email" required>

                Categorias
                <input class="categoria-content" type="text" id="categoria" placeholder="Informe as Categorias" required>
                Data Da Constituição
                <input class="data-content" type="date" id="data_constituicao" placeholder="Data da Constituição" required>
                Data da CVM
                <input class="data-content" type="date" id="data_cvm" placeholder="Data do CVM" required>

                Controlador
                <input class="controlador-content" type="text" id="controlador" placeholder="Nome do Controlador" required>
                CNPJ
                <input class="cnpj-content" type="text" id="cnpj_controlador" placeholder="CNPJ" required>

        </form>

This image link shows how I want it to be

https://www.figma.com/file/nuLJYzwr2LtoJxt4rPKDaI/Untitled?node-id=0%3A1

Body:
Just wrap label and input inside a div and add :

.row > div {
    display: flex;
    flex-direction: column;
}


问:
Open connections to database
I have an old Winforms application, it works with PostgreSQL in RDS.
It used old npgsql provider.
But I have modified the app and replaced the old Npgsql with the newest one.
It works ok, 10 users work,  but sometimes I exec

```<code>select pg_stat_activity
</code>```

and see about 30  connections.
I do not use pooling explicitly.
What is pooling parameter values (use and max size) by default?
How to fix it?

答:
Shay Rojansky has answered in the  github.com/npgsql/npgsql/issues/2855(see his comment here).

But anyway: it looks like if user does not use pool in the connection string the npgsql uses it by default.

Title: Open connections to database

Body:
I have an old Winforms application, it works with PostgreSQL in RDS.
It used old npgsql provider.
But I have modified the app and replaced the old Npgsql with the newest one.
It works ok, 10 users work,  but sometimes I exec

select pg_stat_activity

and see about 30  connections.
I do not use pooling explicitly.
What is pooling parameter values (use and max size) by default?
How to fix it?