问:
How to build a group of groups with pattern in an ansible inventory?
I want to build up a target host list of hosts which are in both groups DC-North and DC-South and which are not a DB Server.

This was my approach which unfortunately fails:

```<code>[DC-North]
host1
host2

[DC-South]
host3
host4

[dbservers]
host3
host1

[target:children]
DC-North:&DC-South:!dbservers
</code>```

How would I define this correct?

答:
It is impossible to use patterns, but you can use YAML anchors or reference groups with children syntax:

```<code>apps_web_a:
  hosts: &apps_web_a
    prod-api-1:
    prod-admin-1:

apps_web_b:
  hosts: &apps_web_b
    prod-api-2:
    prod-admin-2:

# YAML anchors:
# apps_web:
#   hosts:
#     <<: *apps_web_a
#     <<: *apps_web_b

apps_web:
  children:
    apps_web_a:
    apps_web_b:
</code>```

Read small note about group of groups: https://docs.ansible.com/ansible/2.7/user_guide/intro_inventory.html

It is also possible to make groups of groups using the :children suffix in INI or the children: entry in YAML. You can apply variables using :vars or vars:...

That way only algebraic UNION set operation is possible...

Follow my question here: https://www.reddit.com/r/ansible/comments/f68yse/is_there_syntax_for_creating_group_from_other/

Body:
I want to build up a target host list of hosts which are in both groups DC-North and DC-South and which are not a DB Server.

This was my approach which unfortunately fails:

[DC-North]
host1
host2

[DC-South]
host3
host4

[dbservers]
host3
host1

[target:children]
DC-North:&DC-South:!dbservers

How would I define this correct?

Body:
It is impossible to use patterns, but you can use YAML anchors or reference groups with children syntax:

apps_web_a:
  hosts: &apps_web_a
    prod-api-1:
    prod-admin-1:

apps_web_b:
  hosts: &apps_web_b
    prod-api-2:
    prod-admin-2:

# YAML anchors:
# apps_web:
#   hosts:
#     <<: *apps_web_a
#     <<: *apps_web_b

apps_web:
  children:
    apps_web_a:
    apps_web_b:

Read small note about group of groups: https://docs.ansible.com/ansible/2.7/user_guide/intro_inventory.html

It is also possible to make groups of groups using the :children suffix in INI or the children: entry in YAML. You can apply variables using :vars or vars:...

That way only algebraic UNION set operation is possible...

Follow my question here: https://www.reddit.com/r/ansible/comments/f68yse/is_there_syntax_for_creating_group_from_other/


来源: stackexchange

问:
What is the gradle equivalent of maven repository mirrors?
When working with Maven projects, I like to configure a local mirror (e.g. Artifactory) for various 3rd party repositories.  I do this via the settings.xml file in my home directory.

I cannot find a similar setting for Gradle - all documentation seems to suggest adding a new repository, rather than proxying/mirroring calls to repos which are already defined.  This does not have the same effect.  Is there a simple way to proxy remote Maven or Ivy repositories in Gradle?

答:
We have an internal Artifactory repository which is configured with separate paths for libraries and plugins, release and snapshot versions.
As an equivalent to ~/.m2/settings.xml I used the following ~/.gradle/init.gradle file:-

```<code>allprojects {
    buildscript {
        repositories {
            mavenLocal()
            maven { url "https://internal.example.com/artifactory/libs-releases" }
            maven { url "https://internal.example.com/artifactory/libs-snapshots" }
            maven { url "https://internal.example.com/artifactory/atlassian-cache" }
        }
    }

    repositories {
        mavenLocal()
        maven { url "https://internal.example.com/artifactory/plugins-releases" }
        maven { url "https://internal.example.com/artifactory/plugins-snapshots" }
        maven { url "https://internal.example.com/artifactory/atlassian-cache" }
    }
}
</code>```

the buildscript block refers to search locations for gradle plugins used by your build.

the second repositories block refers to search locations for dependencies of your project.

mavenLocal() refers to the local filesystem repo ~/.m2/repository.

More info:

https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies

https://docs.gradle.org/current/userguide/init_scripts.html

ContentLicense: CC BY-SA 3.0

Body:
We have an internal Artifactory repository which is configured with separate paths for libraries and plugins, release and snapshot versions.
As an equivalent to ~/.m2/settings.xml I used the following ~/.gradle/init.gradle file:-

allprojects {
    buildscript {
        repositories {
            mavenLocal()
            maven { url "https://internal.example.com/artifactory/libs-releases" }
            maven { url "https://internal.example.com/artifactory/libs-snapshots" }
            maven { url "https://internal.example.com/artifactory/atlassian-cache" }
        }
    }

    repositories {
        mavenLocal()
        maven { url "https://internal.example.com/artifactory/plugins-releases" }
        maven { url "https://internal.example.com/artifactory/plugins-snapshots" }
        maven { url "https://internal.example.com/artifactory/atlassian-cache" }
    }
}

the buildscript block refers to search locations for gradle plugins used by your build.

the second repositories block refers to search locations for dependencies of your project.

mavenLocal() refers to the local filesystem repo ~/.m2/repository.

More info:

https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies

https://docs.gradle.org/current/userguide/init_scripts.html

ContentLicense: CC BY-SA 4.0


问:
SQL adding new column
I would be happy to ask my first question on StackOverflow.

I have two tables (employees and salaries) within my database (employees).

Employees table looks like this:

```<code>+------------+---------------+------+-----+---------+-------+
| Field      | Type          | Null | Key | Default | Extra |
+------------+---------------+------+-----+---------+-------+
| emp_no     | int           | NO   | PRI | NULL    |       |
| first_name | varchar(14)   | NO   |     | NULL    |       |
| last_name  | varchar(16)   | NO   |     | NULL    |       |
+------------+---------------+------+-----+---------+-------+
</code>```

Salaries table looks like this:

```<code>+-----------+------+------+-----+---------+-------+
| Field     | Type | Null | Key | Default | Extra |
+-----------+------+------+-----+---------+-------+
| emp_no    | int  | NO   | PRI | NULL    |       |
| salary    | int  | NO   |     | NULL    |       |
| from_date | date | NO   | PRI | NULL    |       |
| to_date   | date | NO   |     | NULL    |       |
+-----------+------+------+-----+---------+-------+
</code>```

I want to return values for a specific date interval. For instance, I want to know what salary an employee had for an interval in a dynamic view, for the 1990-1991 years for 1991-1992 years, etc.

I wrote the following query:

```<code>SELECT
    e.emp_no,
    e.first_name,
    e.last_name,
    s.salary AS Salary_for_1990
FROM
    employees e
        JOIN
    salaries s ON e.emp_no = s.emp_no
WHERE
    from_date BETWEEN '1990-01-01' AND '1990-12-31'
GROUP BY e.emp_no
ORDER BY e.emp_no ASC
LIMIT 10;
</code>```

I got the following result:

```<code>+--------+------------+-----------+-----------------+
| emp_no | first_name | last_name | Salary_for_1990 |
+--------+------------+-----------+-----------------+
|  10001 | Georgi     | Facello   |           66961 |
|  10004 | Christian  | Koblick   |           48271 |
|  10005 | Kyoichi    | Maliniak  |           82621 |
|  10006 | Anneke     | Preusig   |           40000 |
|  10007 | Tzvetan    | Zielinski |           60740 |
|  10009 | Sumant     | Peace     |           70889 |
|  10011 | Mary       | Sluis     |           42365 |
|  10013 | Eberhardt  | Terkki    |           46305 |
|  10018 | Kazuhide   | Peha      |           61648 |
|  10021 | Ramzi      | Erde      |           59700 |
+--------+------------+-----------+-----------------+
</code>```

So it works for a single value '1990-1991' years, however, I seek for a possibility to add in the query additional column for '1991-1992', '1992-1993' years, etc to be able to see the dynamic growth of employee's salaries.

I thought about variables, however, I don't have an idea how to query it within the context.

Look forward to your answers.
 Thank you in advance.

答:
People have a salary as of a date not as of a range of dates.

For your problem, you can use conditional aggregation:

```<code>SELECT e.emp_no, e.first_name, e.last_name,
       MAX(CASE WHEN from_date <= '1990-01-01' AND to_date > '1990-01-01' THEN salary END) as salary_19900101,
       MAX(CASE WHEN from_date <= '1991-01-01' AND to_date > '1991-01-01' THEN salary END) as salary_19910101,
       MAX(CASE WHEN from_date <= '1992-01-01' AND to_date > '1991-02-01' THEN salary END) as salary_19910101
FROM employees e JOIN
     salaries s
     ON e.emp_no = s.emp_no
GROUP BY e.emp_no, e.first_name, e.last_name
ORDER BY e.emp_no ASC
LIMIT 10;
</code>```

Notes:

This has the salary as of the first day of the year.  You can have the salary as of any particular day (say De 31 or Jul 1).

If an employee has no salary for a particular year, the value is NULL.

The GROUP BY clause has all the unaggregated columns.  Although this is not formally required if emp_no is the primary key, it is a good habit if you are learning SQL.

Title: SQL adding new column

Body:
I would be happy to ask my first question on StackOverflow.

I have two tables (employees and salaries) within my database (employees).

Employees table looks like this:

+------------+---------------+------+-----+---------+-------+
| Field      | Type          | Null | Key | Default | Extra |
+------------+---------------+------+-----+---------+-------+
| emp_no     | int           | NO   | PRI | NULL    |       |
| first_name | varchar(14)   | NO   |     | NULL    |       |
| last_name  | varchar(16)   | NO   |     | NULL    |       |
+------------+---------------+------+-----+---------+-------+

Salaries table looks like this:

+-----------+------+------+-----+---------+-------+
| Field     | Type | Null | Key | Default | Extra |
+-----------+------+------+-----+---------+-------+
| emp_no    | int  | NO   | PRI | NULL    |       |
| salary    | int  | NO   |     | NULL    |       |
| from_date | date | NO   | PRI | NULL    |       |
| to_date   | date | NO   |     | NULL    |       |
+-----------+------+------+-----+---------+-------+

I want to return values for a specific date interval. For instance, I want to know what salary an employee had for an interval in a dynamic view, for the 1990-1991 years for 1991-1992 years, etc.

I wrote the following query:

SELECT
    e.emp_no,
    e.first_name,
    e.last_name,
    s.salary AS Salary_for_1990
FROM
    employees e
        JOIN
    salaries s ON e.emp_no = s.emp_no
WHERE
    from_date BETWEEN '1990-01-01' AND '1990-12-31'
GROUP BY e.emp_no
ORDER BY e.emp_no ASC
LIMIT 10;

I got the following result:

+--------+------------+-----------+-----------------+
| emp_no | first_name | last_name | Salary_for_1990 |
+--------+------------+-----------+-----------------+
|  10001 | Georgi     | Facello   |           66961 |
|  10004 | Christian  | Koblick   |           48271 |
|  10005 | Kyoichi    | Maliniak  |           82621 |
|  10006 | Anneke     | Preusig   |           40000 |
|  10007 | Tzvetan    | Zielinski |           60740 |
|  10009 | Sumant     | Peace     |           70889 |
|  10011 | Mary       | Sluis     |           42365 |
|  10013 | Eberhardt  | Terkki    |           46305 |
|  10018 | Kazuhide   | Peha      |           61648 |
|  10021 | Ramzi      | Erde      |           59700 |
+--------+------------+-----------+-----------------+

So it works for a single value '1990-1991' years, however, I seek for a possibility to add in the query additional column for '1991-1992', '1992-1993' years, etc to be able to see the dynamic growth of employee's salaries.

I thought about variables, however, I don't have an idea how to query it within the context.

Look forward to your answers.
 Thank you in advance.

Body:
People have a salary as of a date not as of a range of dates.

For your problem, you can use conditional aggregation:

SELECT e.emp_no, e.first_name, e.last_name,
       MAX(CASE WHEN from_date <= '1990-01-01' AND to_date > '1990-01-01' THEN salary END) as salary_19900101,
       MAX(CASE WHEN from_date <= '1991-01-01' AND to_date > '1991-01-01' THEN salary END) as salary_19910101,
       MAX(CASE WHEN from_date <= '1992-01-01' AND to_date > '1991-02-01' THEN salary END) as salary_19910101
FROM employees e JOIN
     salaries s
     ON e.emp_no = s.emp_no
GROUP BY e.emp_no, e.first_name, e.last_name
ORDER BY e.emp_no ASC
LIMIT 10;

Notes:

This has the salary as of the first day of the year.  You can have the salary as of any particular day (say De 31 or Jul 1).

If an employee has no salary for a particular year, the value is NULL.

The GROUP BY clause has all the unaggregated columns.  Although this is not formally required if emp_no is the primary key, it is a good habit if you are learning SQL.


问:
Tips of coding java programs in multicore scenario
There seems to be a lot of fuss about multicore and java. While some people say that java support is not good enough, it definitely seems to be an area to look forward to. There seems to be many techniques to improve performance of concurrent programs.

Any tips/advices about programming in a multi core scenario is appreciated.

答: As an alternative to Java's own shared-memory approach to concurrency you could also look into Actor-based concurrency using Scala on top of Java, which provides an easier model for concurrent programming.</p>

ContentLicense: CC BY-SA 2.5

OwnerDisplayName: Fabian Steeg

LastEditorDisplayName: Fabian Steeg


问:
Removing Un needed Whitespacing
I have a view with 2 Listview's one for a Overall Invoice and one holding all the details of the items that were on the invoice(Cart items)

You'll notice theres this huge white space between the main order and the items list, I cant seem to get rid of the spacing, Without setting hard value's which I'd like to avoid. Anyone got any idea's?

Is the Listview just taking up space for another item but only contains one maybe?

Just to elaborate a little I can give the top Listview a HeightRequest of lets say around 310 to get the spacing right but I'm looking for a way that doesnt require me to set. a hard value that might distort on certain phones

```<code>  <ContentPage.Content>
        <StackLayout BackgroundColor="Transparent" Spacing="0" Opacity="1" HorizontalOptions="FillAndExpand"
                     Margin="4,0,4,0" VerticalOptions="StartAndExpand">
            <Label Text="Main Order" TextColor="White" HeightRequest="30" HorizontalOptions="Center"
                   VerticalOptions="Center" FontSize="Title" FontAttributes="Bold" />

            <ListView x:Name="SingleOrderList"
                      BackgroundColor="Transparent"
                      HasUnevenRows="True"

                      VerticalOptions="Start"
                      HorizontalOptions="FillAndExpand"
                      SeparatorVisibility="Default">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <ViewCell.View>
                                <Frame CornerRadius="20" BackgroundColor="White" Margin="4,0,4,0" Padding="27">
                                    <StackLayout BackgroundColor="Transparent" Orientation="Vertical" Spacing="0">

                                        <Label HorizontalTextAlignment="Center" TextColor="Black">
                                            <Label.FormattedText>
                                                <FormattedString>
                                                    <Span Text="ID:" FontAttributes="Bold" FontSize="Large" />
                                                    <Span Text="{ Binding id }" FontAttributes="Bold" FontSize="Large" />
                                                </FormattedString>
                                            </Label.FormattedText>
                                        </Label>
                                        <Label HorizontalTextAlignment="Center" TextColor="Black">
                                            <Label.FormattedText>
                                                <FormattedString>
                                                    <Span Text="Mail:" />
                                                    <Span Text="{ Binding billing.email }" FontAttributes="Bold"
                                                          FontSize="Medium" />
                                                </FormattedString>
                                            </Label.FormattedText>
                                        </Label>
                                        <Label HorizontalTextAlignment="Center" TextColor="Black">
                                            <Label.FormattedText>
                                                <FormattedString>
                                                    <Span Text="Date:" />
                                                    <Span Text="{ Binding date_created }" FontAttributes="Bold"
                                                          FontSize="Medium" />
                                                </FormattedString>
                                            </Label.FormattedText>
                                        </Label>
                                        <Label HorizontalTextAlignment="Center" TextColor="Black">
                                            <Label.FormattedText>
                                                <FormattedString>
                                                    <Span Text="Status:" />
                                                    <Span Text="{ Binding status }" FontAttributes="Bold"
                                                          FontSize="Medium" />
                                                </FormattedString>
                                            </Label.FormattedText>
                                        </Label>
                                        <Label HorizontalTextAlignment="Center" TextColor="Black">
                                            <Label.FormattedText>
                                                <FormattedString>

                                                    <Span Text="{ Binding total, StringFormat='Total R:{0,5:#,0.00}' }"
                                                          FontAttributes="Bold" FontSize="Medium" />
                                                </FormattedString>
                                            </Label.FormattedText>
                                        </Label>
                                    </StackLayout>
                                </Frame>
                            </ViewCell.View>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
            <Label Text="ITEMS" TextColor="White" HeightRequest="30" HorizontalOptions="Center"
                   VerticalOptions="Center" FontSize="Title" FontAttributes="Bold" />
            <ListView BackgroundColor="Transparent"
                      x:Name="Lineorders"
                      HasUnevenRows="True"
                      VerticalOptions="FillAndExpand"
                      HorizontalOptions="FillAndExpand"
                      SeparatorVisibility="Default">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <ViewCell.View>
                                <Frame CornerRadius="20" BackgroundColor="White" Margin="10" Padding="20">
                                    <StackLayout
                                        Spacing="0"
                                        BackgroundColor="Transparent"
                                        VerticalOptions="FillAndExpand"
                                        HorizontalOptions="FillAndExpand">
                                        <Label HorizontalTextAlignment="Center" TextColor="Black">
                                            <Label.FormattedText>
                                                <FormattedString>
                                                    <Span Text="Product:" FontAttributes="Bold" FontSize="Large" />
                                                    <Span Text="{ Binding name }" FontAttributes="Bold"
                                                          FontSize="Large" />
                                                </FormattedString>
                                            </Label.FormattedText>
                                        </Label>
                                        <Label HorizontalTextAlignment="Center" TextColor="Black">
                                            <Label.FormattedText>
                                                <FormattedString>
                                                    <Span Text="Price:" />
                                                    <Span
                                                        Text="{ Binding price,StringFormat={}{0:0.####################}}"
                                                        FontAttributes="Bold" FontSize="Medium" />
                                                </FormattedString>
                                            </Label.FormattedText>
                                        </Label>
                                        <Label HorizontalTextAlignment="Center" TextColor="Black">
                                            <Label.FormattedText>
                                                <FormattedString>
                                                    <Span Text="Sku:" />
                                                    <Span Text="{ Binding sku }" FontAttributes="Bold"
                                                          FontSize="Medium" />
                                                </FormattedString>
                                            </Label.FormattedText>
                                        </Label>
                                        <Label HorizontalTextAlignment="Center" TextColor="Black">
                                            <Label.FormattedText>
                                                <FormattedString>

                                                    <Span
                                                        Text="{ Binding total , StringFormat='Total R:{0,5:#,0.00}' }"
                                                        FontAttributes="Bold" FontSize="Medium" />
                                                </FormattedString>
                                            </Label.FormattedText>
                                        </Label>
                                        <Label HorizontalTextAlignment="Center" TextColor="Black">
                                            <Label.FormattedText>
                                                <FormattedString>
                                                    <Span Text="Quantity:" />
                                                    <Span Text="{ Binding quantity }" FontAttributes="Bold"
                                                          FontSize="Medium" />
                                                </FormattedString>
                                            </Label.FormattedText>
                                        </Label>
                                    </StackLayout>
                                </Frame>
                            </ViewCell.View>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </StackLayout>
    </ContentPage.Content>
</code>```

What im looking for without HeightRequest

答:
```<code><ContentPage.Content>
            <StackLayout
                Margin="4,0,4,0"
                BackgroundColor="Transparent"
                HorizontalOptions="FillAndExpand"
                Opacity="1"
                Spacing="0"
                VerticalOptions="StartAndExpand">
                <Label
                    FontAttributes="Bold"
                    FontSize="Title"
                    HeightRequest="30"
                    HorizontalOptions="Center"
                    Text="Main Order"
                    TextColor="White"
                    VerticalOptions="Center" />

                <ListView
                    x:Name="SingleOrderList"
                    BackgroundColor="Transparent"
                    HasUnevenRows="True"
                    HorizontalOptions="FillAndExpand"
                    SeparatorVisibility="Default"
                    VerticalOptions="FillAndExpand">
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <ViewCell>
                                <ViewCell.View>
                                    <Frame
                                        Margin="4,0,4,0"
                                        Padding="5,10,5,5"
                                        BackgroundColor="White"
                                        CornerRadius="20">
                                        <StackLayout
                                            BackgroundColor="LightSeaGreen"
                                            Orientation="Vertical"
                                            Spacing="0">
                                            <Label HorizontalTextAlignment="Center" TextColor="Black">
                                                <Label.FormattedText>
                                                    <FormattedString>
                                                        <Span
                                                            FontAttributes="Bold"
                                                            FontSize="Large"
                                                            Text="ID:" />
                                                        <Span
                                                            FontAttributes="Bold"
                                                            FontSize="Large"
                                                            Text="23" />
                                                    </FormattedString>
                                                </Label.FormattedText>
                                            </Label>
                                            <Label HorizontalTextAlignment="Center" TextColor="Black">
                                                <Label.FormattedText>
                                                    <FormattedString>
                                                        <Span Text="Mail:" />
                                                        <Span
                                                            FontAttributes="Bold"
                                                            FontSize="Medium"
                                                            Text="{Binding billing.email}" />
                                                    </FormattedString>
                                                </Label.FormattedText>
                                            </Label>
                                            <Label HorizontalTextAlignment="Center" TextColor="Black">
                                                <Label.FormattedText>
                                                    <FormattedString>
                                                        <Span Text="Date:" />
                                                        <Span
                                                            FontAttributes="Bold"
                                                            FontSize="Medium"
                                                            Text="{Binding date_created}" />
                                                    </FormattedString>
                                                </Label.FormattedText>
                                            </Label>
                                            <Label HorizontalTextAlignment="Center" TextColor="Black">
                                                <Label.FormattedText>
                                                    <FormattedString>
                                                        <Span Text="Status:" />
                                                        <Span
                                                            FontAttributes="Bold"
                                                            FontSize="Medium"
                                                            Text="{Binding status}" />
                                                    </FormattedString>
                                                </Label.FormattedText>
                                            </Label>
                                            <Label HorizontalTextAlignment="Center" TextColor="Black">
                                                <Label.FormattedText>
                                                    <FormattedString>

                                                        <Span
                                                            FontAttributes="Bold"
                                                            FontSize="Medium"
                                                            Text="{Binding total, StringFormat='Total R:{0,5:#,0.00}'}" />
                                                    </FormattedString>
                                                </Label.FormattedText>
                                            </Label>
                                        </StackLayout>
                                    </Frame>
                                </ViewCell.View>
                            </ViewCell>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
                <Label
                    FontAttributes="Bold"
                    FontSize="Title"
                    HeightRequest="30"
                    HorizontalOptions="Center"
                    Text="ITEMS"
                    TextColor="Black"
                    VerticalOptions="Center" />
                <ListView
                    x:Name="Lineorders"
                    BackgroundColor="Transparent"
                    HasUnevenRows="True"
                    HorizontalOptions="FillAndExpand"
                    SeparatorVisibility="Default"
                    VerticalOptions="FillAndExpand">
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <ViewCell>
                                <ViewCell.View>
                                    <Frame
                                        Margin="10"
                                        Padding="5,10,5,5"
                                        BackgroundColor="White"
                                        CornerRadius="20">
                                        <StackLayout
                                            BackgroundColor="Red"
                                            HorizontalOptions="FillAndExpand"
                                            Spacing="0"
                                            VerticalOptions="FillAndExpand">
                                            <Label HorizontalTextAlignment="Center" TextColor="Black">
                                                <Label.FormattedText>
                                                    <FormattedString>
                                                        <Span
                                                            FontAttributes="Bold"
                                                            FontSize="Large"
                                                            Text="Product:" />
                                                        <Span
                                                            FontAttributes="Bold"
                                                            FontSize="Large"
                                                            Text="{Binding name}" />
                                                    </FormattedString>
                                                </Label.FormattedText>
                                            </Label>
                                            <Label HorizontalTextAlignment="Center" TextColor="Black">
                                                <Label.FormattedText>
                                                    <FormattedString>
                                                        <Span Text="Price:" />
                                                        <Span
                                                            FontAttributes="Bold"
                                                            FontSize="Medium"
                                                            Text="{Binding price, StringFormat={}{0:0.####################}}" />
                                                    </FormattedString>
                                                </Label.FormattedText>
                                            </Label>
                                            <Label HorizontalTextAlignment="Center" TextColor="Black">
                                                <Label.FormattedText>
                                                    <FormattedString>
                                                        <Span Text="Sku:" />
                                                        <Span
                                                            FontAttributes="Bold"
                                                            FontSize="Medium"
                                                            Text="{Binding sku}" />
                                                    </FormattedString>
                                                </Label.FormattedText>
                                            </Label>
                                            <Label HorizontalTextAlignment="Center" TextColor="Black">
                                                <Label.FormattedText>
                                                    <FormattedString>

                                                        <Span
                                                            FontAttributes="Bold"
                                                            FontSize="Medium"
                                                            Text="{Binding total, StringFormat='Total R:{0,5:#,0.00}'}" />
                                                    </FormattedString>
                                                </Label.FormattedText>
                                            </Label>
                                            <Label HorizontalTextAlignment="Center" TextColor="Black">
                                                <Label.FormattedText>
                                                    <FormattedString>
                                                        <Span Text="Quantity:" />
                                                        <Span
                                                            FontAttributes="Bold"
                                                            FontSize="Medium"
                                                            Text="{Binding quantity}" />
                                                    </FormattedString>
                                                </Label.FormattedText>
                                            </Label>
                                        </StackLayout>
                                    </Frame>
                                </ViewCell.View>
                            </ViewCell>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
            </StackLayout>
        </ContentPage.Content>
</code>```

Title: Removing Un needed Whitespacing

Body:
I have a view with 2 Listview's one for a Overall Invoice and one holding all the details of the items that were on the invoice(Cart items)

You'll notice theres this huge white space between the main order and the items list, I cant seem to get rid of the spacing, Without setting hard value's which I'd like to avoid. Anyone got any idea's?

Is the Listview just taking up space for another item but only contains one maybe?

Just to elaborate a little I can give the top Listview a HeightRequest of lets say around 310 to get the spacing right but I'm looking for a way that doesnt require me to set. a hard value that might distort on certain phones

  <ContentPage.Content>
        <StackLayout BackgroundColor="Transparent" Spacing="0" Opacity="1" HorizontalOptions="FillAndExpand"
                     Margin="4,0,4,0" VerticalOptions="StartAndExpand">

            <ListView x:Name="SingleOrderList"
                      BackgroundColor="Transparent"
                      HasUnevenRows="True"

                      VerticalOptions="Start"
                      HorizontalOptions="FillAndExpand"
                      SeparatorVisibility="Default">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <ViewCell.View>
                                <Frame CornerRadius="20" BackgroundColor="White" Margin="4,0,4,0" Padding="27">
                                    <StackLayout BackgroundColor="Transparent" Orientation="Vertical" Spacing="0">

                                                <FormattedString>

                                                </FormattedString>

                                                <FormattedString>

                                                </FormattedString>

                                                <FormattedString>

                                                </FormattedString>

                                                <FormattedString>

                                                </FormattedString>

                                                <FormattedString>

                                                </FormattedString>

                                    </StackLayout>
                                </Frame>
                            </ViewCell.View>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>

            <ListView BackgroundColor="Transparent"
                      x:Name="Lineorders"
                      HasUnevenRows="True"
                      VerticalOptions="FillAndExpand"
                      HorizontalOptions="FillAndExpand"
                      SeparatorVisibility="Default">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <ViewCell.View>
                                <Frame CornerRadius="20" BackgroundColor="White" Margin="10" Padding="20">
                                    <StackLayout
                                        Spacing="0"
                                        BackgroundColor="Transparent"
                                        VerticalOptions="FillAndExpand"
                                        HorizontalOptions="FillAndExpand">

                                                <FormattedString>

                                                </FormattedString>

                                                <FormattedString>

                                                </FormattedString>

                                                <FormattedString>

                                                </FormattedString>

                                                <FormattedString>

                                                </FormattedString>

                                                <FormattedString>

                                                </FormattedString>

                                    </StackLayout>
                                </Frame>
                            </ViewCell.View>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </StackLayout>
    </ContentPage.Content>

What im looking for without HeightRequest


问:
Hybris Synchronization error for custom attribute
I have added a new attribute OOTB (BundleTemplate) to Product (this attribute is catalog aware) and everytime I  try to synchronize a product I get this error:

```<code>ERROR [000001KN::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (000001KN) [CatalogVersionSyncMaster] sync ended with 4 unfinished items - see last sync media for details
ERROR [000001KN::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (000001KN) [CatalogVersionSyncJob] Finished synchronization in 0d 00h:00m:00s:999ms. There were errors during the synchronization!
</code>```

With this info I just can't find the reason why the sync isn't working , is there any way to debug this to get a better LOG ?

答:
de.hybris.platform.catalog.jalo.synchronization.ItemCopyCreator#copy() Line 166

Solved!

Body:
I have added a new attribute OOTB (BundleTemplate) to Product (this attribute is catalog aware) and everytime I  try to synchronize a product I get this error:

ERROR [000001KN::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (000001KN) [CatalogVersionSyncMaster] sync ended with 4 unfinished items - see last sync media for details
ERROR [000001KN::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (000001KN) [CatalogVersionSyncJob] Finished synchronization in 0d 00h:00m:00s:999ms. There were errors during the synchronization!

With this info I just can't find the reason why the sync isn't working , is there any way to debug this to get a better LOG ?


问:
dotnet core 3 - Getting System.NullReferenceException maybe because I have not loaded the correct related entities
I am getting the following error:

System.NullReferenceException: 'Object reference not set to an
  instance of an object.'

I am getting it on the following method:

```<code>    private ClientIndexViewModel MapClientToVm(Client client) {
        ClientDATARepository.RelatedSuburbEntities(client.Suburb); // Bring all the related entities for "Suburb" down.

        var model = new ClientIndexViewModel {
            Id = client.Id,
            ClientNo = client.ClientNo,
            Company = client.Company,
            IsWarrantyCompany = client.IsWarrantyCompany,
            ClientFirstName = client.ClientFirstName,
            ClientLastName = client.ClientLastName,
            CompanyName = client.CompanyName,
            MobilePhone = client.MobilePhone,
            Active = client.Active,
            DeActivated = client.DateDeActivated != null
                ? client.DateDeActivated.Value.ToString("dd/MM/yyyy", CultureInfo.CurrentCulture)
                : "n/a",
            Activity = client.Activity,
            Address = new AddressViewModel {
                Address1 = client.Address1,
                Address2 = client.Address2,
                Suburb = new SuburbViewModel {
                    SuburbName = client.Suburb.SuburbName,
                    PostCode = client.Suburb.PostCode,
                    State = new StateViewModel {
                        Id = client.Suburb.State.Id,
                        StateName = client.Suburb.State.StateName,
                        StateShortName = client.Suburb.State.StateShortName
                    }
                }
            },
            NumberOfJobs = client.Jobs.Count.ToString(CultureInfo.CurrentCulture)
        };

        // Obtain any jobs the client has including any visits for those jobs.
        if (client.Jobs.Count > 0) {
            JobDATARepository
                .RelatedJobEntities(client.Jobs); // Bring all the related entities for "Jobs" collection down.

            foreach (var job in client.Jobs) {
                var jobViewModel = new ClientJobListingViewModel {
                    Id = job.Id,
                    AgentJobNo = job.AgentJobNo,
                    JobNo = job.JobNo,
                    Type = job.Type.Name,
                    Status = job.Status.StatusName,
                    WarrantyCompany = job.WarrantyCompany.CompanyName,
                    NumberOfVisits = job.Visits.Count.ToString(CultureInfo.CurrentCulture)
                };

                if (job.Visits.Count > 0)
                    foreach (var visit in job.Visits) {
                        var visitModel = new VisitViewModel {
                            Id = visit.Id,
                            VisitDate = visit.VisitDate.ToString("dd/MM/yyyy", CultureInfo.CurrentCulture),
                            StartTime = visit.StartTime.ToString("hh:mm", CultureInfo.CurrentCulture),
                            EndTime = visit.EndTime.ToString("hh:mm", CultureInfo.CurrentCulture)
                        };
                        jobViewModel.Visits.Add(visitModel);
                    }

                model.Jobs.Add(jobViewModel);
            }
        }

        return model;
    }
</code>```

and specifically on this section:

```<code>foreach (var job in client.Jobs)
{
    var jobViewModel = new ClientJobListingViewModel {
        Id = job.Id,
        AgentJobNo = job.AgentJobNo,
        JobNo = job.JobNo,
        Type = job.Type.Name,
        Status = job.Status.StatusName,
        WarrantyCompany = job.WarrantyCompany.CompanyName,
        NumberOfVisits = job.Visits.Count.ToString(CultureInfo.CurrentCulture)
};
</code>```

The issue is with:

```<code>        WarrantyCompany = job.WarrantyCompany.CompanyName,
</code>```

The thing is that WarrantyCompany in jobs is set to allow nulls. Here is the job entity and you will note that it has warrantyCompany set to allow nulls:

```<code>public class Job : IEntityBase, IAuditedEntityBase
    {
        public Job()
        {
            Visits = new List<Visit>();
        }

        public string? JobNo { get; set; }
        public string? AgentJobNo { get; set; }

        public int ClientId { get; set; } = default!;
        public Client Client { get; set; } = default!;

        public int? BrandId { get; set; }
        public Brand? Brand { get; set; }

        public int? TypeId { get; set; }
        public JobType? Type { get; set; }

        public int? StatusId { get; set; }
        public Status? Status { get; set; }

        public int? WarrantyCompanyId { get; set; }
        public Client? WarrantyCompany { get; set; }

        public string? Model { get; set; }
        public string? Serial { get; set; }
        public string? ProblemDetails { get; set; }
        public string? SolutionDetails { get; set; }
        public string? Notes { get; set; }

        public virtual ICollection<Visit> Visits { get; }

        public int Id { get; set; }
    }
#nullable disable
</code>```

Specifically,

```<code>        public int? WarrantyCompanyId { get; set; }
        public Client? WarrantyCompany { get; set; }
</code>```

So Job has WarrantyCompany able to take nulls... and it does in a lot of cases. The ViewModel that I am putting the jobs too is as follows:

```<code>public class ClientJobListingViewModel {
    public ClientJobListingViewModel() {
        Visits = new List<VisitViewModel>();
    }

    public int Id { get; set; }
    public string JobNo { get; set; }
    public string? AgentJobNo { get; set; }
    public string Type { get; set; }
    public string Status { get; set; }
    public string? WarrantyCompany { get; set; }
    public string NumberOfVisits { get; set; }

    public ICollection<VisitViewModel> Visits { get; }
}
</code>```

and you will note that the WarrantyCompany in this view model can also take nulls...

```<code>    public string? WarrantyCompany { get; set; }
</code>```

When the job is not a warranty job the warrantyId and warrantyCompany - a client - is null:

The error displays like this:

So how can I get it to set a null to this without throwing the above error?

答:
PLEASE ENABLE LAZY LOAD IN STARTUP.CS for navigation

```<code> services.AddDbContext<AppDbObjectContext>(options =>
        {
            options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")).UseLazyLoadingProxies();

        });
</code>```

refer to microsoft url "https://learn.microsoft.com/en-us/ef/core/querying/related-data"

Also add virtual in navigation property

```<code> public virtual Client? WarrantyCompany { get; set; }
</code>```

Body:
I am getting the following error:

System.NullReferenceException: 'Object reference not set to an
  instance of an object.'

I am getting it on the following method:

    private ClientIndexViewModel MapClientToVm(Client client) {
        ClientDATARepository.RelatedSuburbEntities(client.Suburb); // Bring all the related entities for "Suburb" down.

        var model = new ClientIndexViewModel {
            Id = client.Id,
            ClientNo = client.ClientNo,
            Company = client.Company,
            IsWarrantyCompany = client.IsWarrantyCompany,
            ClientFirstName = client.ClientFirstName,
            ClientLastName = client.ClientLastName,
            CompanyName = client.CompanyName,
            MobilePhone = client.MobilePhone,
            Active = client.Active,
            DeActivated = client.DateDeActivated != null
                ? client.DateDeActivated.Value.ToString("dd/MM/yyyy", CultureInfo.CurrentCulture)
                : "n/a",
            Activity = client.Activity,
            Address = new AddressViewModel {
                Address1 = client.Address1,
                Address2 = client.Address2,
                Suburb = new SuburbViewModel {
                    SuburbName = client.Suburb.SuburbName,
                    PostCode = client.Suburb.PostCode,
                    State = new StateViewModel {
                        Id = client.Suburb.State.Id,
                        StateName = client.Suburb.State.StateName,
                        StateShortName = client.Suburb.State.StateShortName
                    }
                }
            },
            NumberOfJobs = client.Jobs.Count.ToString(CultureInfo.CurrentCulture)
        };

        // Obtain any jobs the client has including any visits for those jobs.
        if (client.Jobs.Count > 0) {
            JobDATARepository
                .RelatedJobEntities(client.Jobs); // Bring all the related entities for "Jobs" collection down.

            foreach (var job in client.Jobs) {
                var jobViewModel = new ClientJobListingViewModel {
                    Id = job.Id,
                    AgentJobNo = job.AgentJobNo,
                    JobNo = job.JobNo,
                    Type = job.Type.Name,
                    Status = job.Status.StatusName,
                    WarrantyCompany = job.WarrantyCompany.CompanyName,
                    NumberOfVisits = job.Visits.Count.ToString(CultureInfo.CurrentCulture)
                };

                if (job.Visits.Count > 0)
                    foreach (var visit in job.Visits) {
                        var visitModel = new VisitViewModel {
                            Id = visit.Id,
                            VisitDate = visit.VisitDate.ToString("dd/MM/yyyy", CultureInfo.CurrentCulture),
                            StartTime = visit.StartTime.ToString("hh:mm", CultureInfo.CurrentCulture),
                            EndTime = visit.EndTime.ToString("hh:mm", CultureInfo.CurrentCulture)
                        };
                        jobViewModel.Visits.Add(visitModel);
                    }

                model.Jobs.Add(jobViewModel);
            }
        }

        return model;
    }

and specifically on this section:

foreach (var job in client.Jobs)
{
    var jobViewModel = new ClientJobListingViewModel {
        Id = job.Id,
        AgentJobNo = job.AgentJobNo,
        JobNo = job.JobNo,
        Type = job.Type.Name,
        Status = job.Status.StatusName,
        WarrantyCompany = job.WarrantyCompany.CompanyName,
        NumberOfVisits = job.Visits.Count.ToString(CultureInfo.CurrentCulture)
};

The issue is with:

        WarrantyCompany = job.WarrantyCompany.CompanyName,

The thing is that WarrantyCompany in jobs is set to allow nulls. Here is the job entity and you will note that it has warrantyCompany set to allow nulls:

public class Job : IEntityBase, IAuditedEntityBase
    {
        public Job()
        {
            Visits = new List<Visit>();
        }

        public string? JobNo { get; set; }
        public string? AgentJobNo { get; set; }

        public int ClientId { get; set; } = default!;
        public Client Client { get; set; } = default!;

        public int? BrandId { get; set; }
        public Brand? Brand { get; set; }

        public int? TypeId { get; set; }
        public JobType? Type { get; set; }

        public int? StatusId { get; set; }
        public Status? Status { get; set; }

        public int? WarrantyCompanyId { get; set; }
        public Client? WarrantyCompany { get; set; }

        public string? Model { get; set; }
        public string? Serial { get; set; }
        public string? ProblemDetails { get; set; }
        public string? SolutionDetails { get; set; }
        public string? Notes { get; set; }

        public virtual ICollection<Visit> Visits { get; }

        public int Id { get; set; }
    }
#nullable disable

Specifically,

        public int? WarrantyCompanyId { get; set; }
        public Client? WarrantyCompany { get; set; }

So Job has WarrantyCompany able to take nulls... and it does in a lot of cases. The ViewModel that I am putting the jobs too is as follows:

public class ClientJobListingViewModel {
    public ClientJobListingViewModel() {
        Visits = new List<VisitViewModel>();
    }

    public int Id { get; set; }
    public string JobNo { get; set; }
    public string? AgentJobNo { get; set; }
    public string Type { get; set; }
    public string Status { get; set; }
    public string? WarrantyCompany { get; set; }
    public string NumberOfVisits { get; set; }

    public ICollection<VisitViewModel> Visits { get; }
}

and you will note that the WarrantyCompany in this view model can also take nulls...

    public string? WarrantyCompany { get; set; }

When the job is not a warranty job the warrantyId and warrantyCompany - a client - is null:

The error displays like this:

So how can I get it to set a null to this without throwing the above error?

Body:
PLEASE ENABLE LAZY LOAD IN STARTUP.CS for navigation

 services.AddDbContext<AppDbObjectContext>(options =>
        {
            options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")).UseLazyLoadingProxies();

        });

refer to microsoft url "https://learn.microsoft.com/en-us/ef/core/querying/related-data"

Also add virtual in navigation property

 public virtual Client? WarrantyCompany { get; set; }


问:
How to extract the orderconfirmedoid from from the current url using Selenium and Python
I have created an automation script to place an order, My main objective was to get the order id from the URL. I am storing my whole URL in a string this URL has my order id. Now, how I can only get order id from URL.
This is my URL which I am getting as a string I have also bold out the specific string (order id) which I want:

https://www.fitotouch.com/checkout/orderconfirmedoid=5e4d212fadda911b34f8862c&authCode=NWU0ZDIxMmZhZGRhOTExYjM0Zjg4NjJjOjIwMjAtMDItMTlUMTE6NTE6MDkuNDE2WnqeukQEbFNV8aOXKuJtXpOsH_DpTTGB7zCdbXlrhZOR

Below is my code

```<code>import time
import self as self
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

# declare variable to store the URL to be visited
base_url="https://www.fitotouch.com"

driver = webdriver.Chrome('E:/Chrome driver/chromedriver.exe')
driver.maximize_window()
#function of our 'driver' object.
driver.implicitly_wait(10) #10 is in seconds
driver.get(base_url)
driver.implicitly_wait(10)
driver.find_element_by_name('password').send_keys("*****")
driver.implicitly_wait(10)
driver.find_element_by_class_name('arrow-icon').click()

driver.implicitly_wait(10)
            #FITO NAMES
driver.find_element_by_link_text("FiveSeasons").click()
driver.find_element_by_xpath('/html/body/div[1]/main/article/section/div[2]/div/section/div/div[1]/a').click()
driver.find_element_by_xpath('/html/body/div[1]/main/article/section/div[2]/div/section/article/section[1]/section/div/div[4]/div').click()
time.sleep(2.4)

#driver.find_element_by_xpath('/html/body/div[1]/header/div[3]/div/div[2]/div[3]/div[2]/a/span/svg').click()
driver.get("https://www.fitotouch.com/cart")
time.sleep(2.4)
#driver.execute_script("window.scrollTo(300, 0)")
driver.get("https://www.fitotouch.com/checkout")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[1]/div[2]/form/div[1]/div[1]/input').send_keys("test@gmail.com")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[1]/div[2]/form/div[3]/button').click()
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[1]/div[1]/div[1]/input').send_keys("test")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[1]/div[1]/div[2]/input').send_keys("Malik")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[1]/div[2]/div[1]/div[1]/input').send_keys("port qasim")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[1]/div[2]/div[4]/input').send_keys("5426")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[1]/div[2]/div[5]/input').send_keys("karachi")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[1]/div[2]/div[6]/input').send_keys("sindh")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[1]/div[3]/input').send_keys("031545454")
time.sleep(2.4)
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[4]').click()
time.sleep(2.4)
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[3]/div[2]/div/form/div[7]').click()
time.sleep(2.4)
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[4]/div[2]/div[4]').click()
time.sleep(2.4)
url = driver.current_url
print(url)
</code>```

答:
```<code>url = url.split('=')[1].split('&')[0]
</code>```

BTW this will work too:

```<code>url = url.split('&')[0].split('=')[1]
</code>```

Body:
I have created an automation script to place an order, My main objective was to get the order id from the URL. I am storing my whole URL in a string this URL has my order id. Now, how I can only get order id from URL.
This is my URL which I am getting as a string I have also bold out the specific string (order id) which I want:

https://www.fitotouch.com/checkout/orderconfirmedoid=5e4d212fadda911b34f8862c&authCode=NWU0ZDIxMmZhZGRhOTExYjM0Zjg4NjJjOjIwMjAtMDItMTlUMTE6NTE6MDkuNDE2WnqeukQEbFNV8aOXKuJtXpOsH_DpTTGB7zCdbXlrhZOR

Below is my code

import time
import self as self
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

# declare variable to store the URL to be visited
base_url="https://www.fitotouch.com"

driver = webdriver.Chrome('E:/Chrome driver/chromedriver.exe')
driver.maximize_window()
#function of our 'driver' object.
driver.implicitly_wait(10) #10 is in seconds
driver.get(base_url)
driver.implicitly_wait(10)
driver.find_element_by_name('password').send_keys("*****")
driver.implicitly_wait(10)
driver.find_element_by_class_name('arrow-icon').click()

driver.implicitly_wait(10)
            #FITO NAMES
driver.find_element_by_link_text("FiveSeasons").click()
driver.find_element_by_xpath('/html/body/div[1]/main/article/section/div[2]/div/section/div/div[1]/a').click()
driver.find_element_by_xpath('/html/body/div[1]/main/article/section/div[2]/div/section/article/section[1]/section/div/div[4]/div').click()
time.sleep(2.4)

#driver.find_element_by_xpath('/html/body/div[1]/header/div[3]/div/div[2]/div[3]/div[2]/a/span/svg').click()
driver.get("https://www.fitotouch.com/cart")
time.sleep(2.4)
#driver.execute_script("window.scrollTo(300, 0)")
driver.get("https://www.fitotouch.com/checkout")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[1]/div[2]/form/div[1]/div[1]/input').send_keys("test@gmail.com")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[1]/div[2]/form/div[3]/button').click()
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[1]/div[1]/div[1]/input').send_keys("test")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[1]/div[1]/div[2]/input').send_keys("Malik")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[1]/div[2]/div[1]/div[1]/input').send_keys("port qasim")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[1]/div[2]/div[4]/input').send_keys("5426")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[1]/div[2]/div[5]/input').send_keys("karachi")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[1]/div[2]/div[6]/input').send_keys("sindh")
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[1]/div[3]/input').send_keys("031545454")
time.sleep(2.4)
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[2]/div[2]/form/div[4]').click()
time.sleep(2.4)
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[3]/div[2]/div/form/div[7]').click()
time.sleep(2.4)
driver.find_element_by_xpath('//*[@id="checkout"]/div/div[3]/div/div/div[1]/div[4]/div[2]/div[4]').click()
time.sleep(2.4)
url = driver.current_url
print(url)

Body:
url = url.split('=')[1].split('&')[0]

BTW this will work too:

url = url.split('&')[0].split('=')[1]


问:
Elasticsearch ctx append json object to array
I am appending string to the array using painless and ctx API call.
For simple strings it works fine.

My loaded data is:
Request time: 26/Mar/2019:09:25:47 +0100, Cookie: sessionid=760ddsaa323

```<code>POST test/doc/948650eff51e70ecf0e7c38d4afa442d/_update
{
"script" : {
    "source": "if(ctx._source.session_cookie_log != null) {ctx._source.session_cookie_log.add(params.newsupp)}",
     "params": {
      "newsupp": "Request time: 26/Mar/2019:09:25:47 +0100, Cookie: sessionid=760ddsaa323"
    }
 }
}
</code>```

However my requirement changed and I have to load JSON object to the array instead of string.

My object that I am attempting to load now is:

```<code>{
  "Request time": "26/Mar/2019:09:25:47 +0100",
  "Cookie": "sessionid=760ddsaa323"
}
</code>```

How can I adjust my API call for loading the JSON object instead of a string?

答:
Change mapping of the field (session_cookie_log in your case) to nested.

Reference: https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html

Body:
I am appending string to the array using painless and ctx API call.
For simple strings it works fine.

My loaded data is:
Request time: 26/Mar/2019:09:25:47 +0100, Cookie: sessionid=760ddsaa323

POST test/doc/948650eff51e70ecf0e7c38d4afa442d/_update
{
"script" : {
    "source": "if(ctx._source.session_cookie_log != null) {ctx._source.session_cookie_log.add(params.newsupp)}",
     "params": {
      "newsupp": "Request time: 26/Mar/2019:09:25:47 +0100, Cookie: sessionid=760ddsaa323"
    }
 }
}

However my requirement changed and I have to load JSON object to the array instead of string.

My object that I am attempting to load now is:

{
  "Request time": "26/Mar/2019:09:25:47 +0100",
  "Cookie": "sessionid=760ddsaa323"
}

How can I adjust my API call for loading the JSON object instead of a string?


问:
How to find a specific data in Json using foreach loop?
I want to get no_kerja, tajuk_mohon, status, and nm_status.

```<code>[
  {
    "status": "string",
    "tajuk_mohon": "string",
    "tkh_btal_tgguh": "string",
    "tkh_buka_iklan": "string",
    "tkh_jk_sdg": "string",
    "tkh_lulus_jkpr": "string",
    "no_kerja": "string",
    "jurutera_civ": "string",
    "no_kerja_baru": "string",
    "bldg_id": "string",
    "jns_perolehan": "string",
    "keterangan_projek": "string",
    "lampiran": "string",
    "lulus_ruang": "string",
    "no_lulus_ruang": "string",
    "pemohon_id": "string",
    "status_akhir_serah": "string",
    "sumber": "string",
    "status_keterangan": "string",
    "syarat": "string",
    "nm_status": "string"
  }
]
</code>```

How do I use foreach loop to get the specific data using PHP curl.?

答:
```<code>// your json
$json = '[{
    "status": "string",
    "tkh_buka_iklan": "string",
    "no_kerja": "string",
    "no_kerja_baru": "string"
}]';

$array = json_decode($json, true);

foreach ($array as $value) {
    echo $value['no_kerja']; // get no_kerja
    // echo $array['tajuk_mohon']; // get tajuk_mohon
    // echo $array['status']; // get status
    // echo $array['nm_status']; // get nm_status

}
</code>```

Body:
I want to get no_kerja, tajuk_mohon, status, and nm_status.

[
  {
    "status": "string",
    "tajuk_mohon": "string",
    "tkh_btal_tgguh": "string",
    "tkh_buka_iklan": "string",
    "tkh_jk_sdg": "string",
    "tkh_lulus_jkpr": "string",
    "no_kerja": "string",
    "jurutera_civ": "string",
    "no_kerja_baru": "string",
    "bldg_id": "string",
    "jns_perolehan": "string",
    "keterangan_projek": "string",
    "lampiran": "string",
    "lulus_ruang": "string",
    "no_lulus_ruang": "string",
    "pemohon_id": "string",
    "status_akhir_serah": "string",
    "sumber": "string",
    "status_keterangan": "string",
    "syarat": "string",
    "nm_status": "string"
  }
]

How do I use foreach loop to get the specific data using PHP curl.?


问:
Truncate number to two decimal places without rounding
Suppose I have a value of 15.7784514, I want to display it 15.77 with no rounding.

```<code>var num = parseFloat(15.7784514);
document.write(num.toFixed(1)+"<br />");
document.write(num.toFixed(2)+"<br />");
document.write(num.toFixed(3)+"<br />");
document.write(num.toFixed(10));
</code>```

Results in -

```<code>15.8
15.78
15.778
15.7784514000
</code>```

How do I display 15.77?

答: const toFixed = (value) => value.toString().slice(0,5);

Body:
Suppose I have a value of 15.7784514, I want to display it 15.77 with no rounding.

var num = parseFloat(15.7784514);
document.write(num.toFixed(1)+"
");
document.write(num.toFixed(2)+"
");
document.write(num.toFixed(3)+"
");
document.write(num.toFixed(10));

Results in -

15.8
15.78
15.778
15.7784514000

How do I display 15.77?


问:
Error while installing symfit library in Python
I get an error while installing symfit library.

I use pip3 in cmd to install the library.

here's the error in cmd:

```<code>Collecting symfit
  Using cached symfit-0.5.2.tar.gz (943 kB)
Requirement already satisfied: numpy>=1.12 in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages (from symfit) (1.18.1)
Collecting scipy<1.2,>=1.0
  Using cached scipy-1.1.0.tar.gz (15.6 MB)
Requirement already satisfied: sympy>=1.2 in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages (from symfit) (1.5.1)
Collecting toposort
  Using cached toposort-1.5-py2.py3-none-any.whl (7.6 kB)
Requirement already satisfied: six in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages (from symfit) (1.14.0)
Requirement already satisfied: mpmath>=0.19 in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages (from sympy>=1.2->symfit) (1.1.0)
Installing collected packages: scipy, toposort, symfit
  Attempting uninstall: scipy
    Found existing installation: scipy 1.4.1
    Uninstalling scipy-1.4.1:
      Successfully uninstalled scipy-1.4.1
    Running setup.py install for scipy ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\amirhosein\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Amirhosein\\AppData\\Local\\Temp\\pip-install-92y759qu\\scipy\\setup.py'"'"'; __file__='"'"'C:\\Users\\Amirhosein\\AppData\\Local\\Temp\\pip-install-92y759qu\\scipy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Amirhosein\AppData\Local\Temp\pip-record-pr5dotd5\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\amirhosein\appdata\local\programs\python\python38-32\Include\scipy'
         cwd: C:\Users\Amirhosein\AppData\Local\Temp\pip-install-92y759qu\scipy\
    Complete output (147 lines):

    Note: if you need reliable uninstall behavior, then install
    with pip instead of using `setup.py install`:

      - `pip install .`       (from a git repo or downloaded source
                               release)
      - `pip install scipy`   (last SciPy release on PyPI)

    lapack_opt_info:
    lapack_mkl_info:
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries mkl_rt not found in ['c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\lib', 'C:\\', 'c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\libs']
      NOT AVAILABLE

    openblas_lapack_info:
      libraries openblas not found in ['c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\lib', 'C:\\', 'c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\libs']
    get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
    customize GnuFCompiler
    Could not locate executable g77
    Could not locate executable f77
    customize IntelVisualFCompiler
    Could not locate executable ifort
    Could not locate executable ifl
    customize AbsoftFCompiler
    Could not locate executable f90
    customize CompaqVisualFCompiler
    Could not locate executable DF
    customize IntelItaniumVisualFCompiler
    Could not locate executable efl
    customize Gnu95FCompiler
    Could not locate executable gfortran
    Could not locate executable f95
    customize G95FCompiler
    Could not locate executable g95
    customize IntelEM64VisualFCompiler
    customize IntelEM64TFCompiler
    Could not locate executable efort
    Could not locate executable efc
    customize PGroupFlangCompiler
    Could not locate executable flang
    don't know how to compile Fortran code on platform 'nt'
      NOT AVAILABLE

    openblas_clapack_info:
      libraries openblas,lapack not found in ['c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\lib', 'C:\\', 'c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\libs']
      NOT AVAILABLE

    flame_info:
      libraries flame not found in ['c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\lib', 'C:\\', 'c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\libs']
      NOT AVAILABLE

    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries tatlas,tatlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries lapack_atlas not found in C:\
      libraries tatlas,tatlas not found in C:\
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
      libraries tatlas,tatlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
    <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
      NOT AVAILABLE

    atlas_3_10_info:
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries satlas,satlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries lapack_atlas not found in C:\
      libraries satlas,satlas not found in C:\
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
      libraries satlas,satlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
    <class 'numpy.distutils.system_info.atlas_3_10_info'>
      NOT AVAILABLE

    atlas_threads_info:
    Setting PTATLAS=ATLAS
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries ptf77blas,ptcblas,atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries lapack_atlas not found in C:\
      libraries ptf77blas,ptcblas,atlas not found in C:\
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
      libraries ptf77blas,ptcblas,atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
    <class 'numpy.distutils.system_info.atlas_threads_info'>
      NOT AVAILABLE

    atlas_info:
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries f77blas,cblas,atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries lapack_atlas not found in C:\
      libraries f77blas,cblas,atlas not found in C:\
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
      libraries f77blas,cblas,atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
    <class 'numpy.distutils.system_info.atlas_info'>
      NOT AVAILABLE

    accelerate_info:
      NOT AVAILABLE

    lapack_info:
      libraries lapack not found in ['c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\lib', 'C:\\', 'c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\libs']
      NOT AVAILABLE

    c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\system_info.py:1730: UserWarning:
        Lapack (http://www.netlib.org/lapack/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [lapack]) or by setting
        the LAPACK environment variable.
      return getattr(self, '_calc_info_{}'.format(name))()
    lapack_src_info:
      NOT AVAILABLE

    c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\system_info.py:1730: UserWarning:
        Lapack (http://www.netlib.org/lapack/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [lapack_src]) or by setting
        the LAPACK_SRC environment variable.
      return getattr(self, '_calc_info_{}'.format(name))()
      NOT AVAILABLE

    Running from scipy source directory.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Amirhosein\AppData\Local\Temp\pip-install-92y759qu\scipy\setup.py", line 474, in <module>
        setup_package()
      File "C:\Users\Amirhosein\AppData\Local\Temp\pip-install-92y759qu\scipy\setup.py", line 470, in setup_package
        setup(**metadata)
      File "c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\core.py", line 137, in setup
        config = configuration()
      File "C:\Users\Amirhosein\AppData\Local\Temp\pip-install-92y759qu\scipy\setup.py", line 388, in configuration
        config.add_subpackage('scipy')
      File "c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\misc_util.py", line 1033, in add_subpackage
        config_list = self.get_subpackage(subpackage_name, subpackage_path,
      File "c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\misc_util.py", line 999, in get_subpackage
        config = self._get_configuration_from_setup_py(
      File "c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\misc_util.py", line 941, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "scipy\setup.py", line 15, in configuration
        config.add_subpackage('linalg')
      File "c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\misc_util.py", line 1033, in add_subpackage
        config_list = self.get_subpackage(subpackage_name, subpackage_path,
      File "c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\misc_util.py", line 999, in get_subpackage
        config = self._get_configuration_from_setup_py(
      File "c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\misc_util.py", line 941, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "scipy\linalg\setup.py", line 19, in configuration
        raise NotFoundError('no lapack/blas resources found')
    numpy.distutils.system_info.NotFoundError: no lapack/blas resources found
    ----------------------------------------
  Rolling back uninstall of scipy
  Moving to c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\scipy-1.4.1.dist-info\
   from C:\Users\Amirhosein\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\~cipy-1.4.1.dist-info
  Moving to c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\scipy\
   from C:\Users\Amirhosein\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\~cipy
ERROR: Command errored out with exit status 1: 'c:\users\amirhosein\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Amirhosein\\AppData\\Local\\Temp\\pip-install-92y759qu\\scipy\\setup.py'"'"'; __file__='"'"'C:\\Users\\Amirhosein\\AppData\\Local\\Temp\\pip-install-92y759qu\\scipy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Amirhosein\AppData\Local\Temp\pip-record-pr5dotd5\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\amirhosein\appdata\local\programs\python\python38-32\Include\scipy' Check the logs for full command output.
</code>```

I also installed the dependencies

sympy, numpy, scipy

答:
Make sure that you have installed 32 bit python on purpose, otherwise install the 64 bit version instead

The error message is caused by the fact that symfit on pypi has requirement scipy<1.2,>=1.0:

Collecting scipy<1.2,>=1.0

That is why your installation is uninstalling your scipy 1.4 and downloads version 1.1. Since it has no wheels for python 3.8 (too old) it downloads the source code and then fails because it cannot find a C compiler.

No module named 'numpy.distutils._msvccompiler'

What you should do is install symfit from the github repository, as it has been updated since the last release to have requirements that are compatible with python 3.8:

```<code> pip install git+https://github.com/tBuLi/symfit
</code>```

Body:
I get an error while installing symfit library.

I use pip3 in cmd to install the library.

here's the error in cmd:

Collecting symfit
  Using cached symfit-0.5.2.tar.gz (943 kB)
Requirement already satisfied: numpy>=1.12 in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages (from symfit) (1.18.1)
Collecting scipy<1.2,>=1.0
  Using cached scipy-1.1.0.tar.gz (15.6 MB)
Requirement already satisfied: sympy>=1.2 in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages (from symfit) (1.5.1)
Collecting toposort
  Using cached toposort-1.5-py2.py3-none-any.whl (7.6 kB)
Requirement already satisfied: six in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages (from symfit) (1.14.0)
Requirement already satisfied: mpmath>=0.19 in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages (from sympy>=1.2->symfit) (1.1.0)
Installing collected packages: scipy, toposort, symfit
  Attempting uninstall: scipy
    Found existing installation: scipy 1.4.1
    Uninstalling scipy-1.4.1:
      Successfully uninstalled scipy-1.4.1
    Running setup.py install for scipy ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\amirhosein\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Amirhosein\\AppData\\Local\\Temp\\pip-install-92y759qu\\scipy\\setup.py'"'"'; __file__='"'"'C:\\Users\\Amirhosein\\AppData\\Local\\Temp\\pip-install-92y759qu\\scipy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Amirhosein\AppData\Local\Temp\pip-record-pr5dotd5\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\amirhosein\appdata\local\programs\python\python38-32\Include\scipy'
         cwd: C:\Users\Amirhosein\AppData\Local\Temp\pip-install-92y759qu\scipy\
    Complete output (147 lines):

    Note: if you need reliable uninstall behavior, then install
    with pip instead of using `setup.py install`:

      - `pip install .`       (from a git repo or downloaded source
                               release)
      - `pip install scipy`   (last SciPy release on PyPI)

    lapack_opt_info:
    lapack_mkl_info:
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries mkl_rt not found in ['c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\lib', 'C:\\', 'c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\libs']
      NOT AVAILABLE

    openblas_lapack_info:
      libraries openblas not found in ['c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\lib', 'C:\\', 'c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\libs']
    get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
    customize GnuFCompiler
    Could not locate executable g77
    Could not locate executable f77
    customize IntelVisualFCompiler
    Could not locate executable ifort
    Could not locate executable ifl
    customize AbsoftFCompiler
    Could not locate executable f90
    customize CompaqVisualFCompiler
    Could not locate executable DF
    customize IntelItaniumVisualFCompiler
    Could not locate executable efl
    customize Gnu95FCompiler
    Could not locate executable gfortran
    Could not locate executable f95
    customize G95FCompiler
    Could not locate executable g95
    customize IntelEM64VisualFCompiler
    customize IntelEM64TFCompiler
    Could not locate executable efort
    Could not locate executable efc
    customize PGroupFlangCompiler
    Could not locate executable flang
    don't know how to compile Fortran code on platform 'nt'
      NOT AVAILABLE

    openblas_clapack_info:
      libraries openblas,lapack not found in ['c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\lib', 'C:\\', 'c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\libs']
      NOT AVAILABLE

    flame_info:
      libraries flame not found in ['c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\lib', 'C:\\', 'c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\libs']
      NOT AVAILABLE

    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries tatlas,tatlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries lapack_atlas not found in C:\
      libraries tatlas,tatlas not found in C:\
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
      libraries tatlas,tatlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
    <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
      NOT AVAILABLE

    atlas_3_10_info:
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries satlas,satlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries lapack_atlas not found in C:\
      libraries satlas,satlas not found in C:\
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
      libraries satlas,satlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
    <class 'numpy.distutils.system_info.atlas_3_10_info'>
      NOT AVAILABLE

    atlas_threads_info:
    Setting PTATLAS=ATLAS
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries ptf77blas,ptcblas,atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries lapack_atlas not found in C:\
      libraries ptf77blas,ptcblas,atlas not found in C:\
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
      libraries ptf77blas,ptcblas,atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
    <class 'numpy.distutils.system_info.atlas_threads_info'>
      NOT AVAILABLE

    atlas_info:
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries f77blas,cblas,atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\lib
      libraries lapack_atlas not found in C:\
      libraries f77blas,cblas,atlas not found in C:\
      libraries lapack_atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
      libraries f77blas,cblas,atlas not found in c:\users\amirhosein\appdata\local\programs\python\python38-32\libs
    <class 'numpy.distutils.system_info.atlas_info'>
      NOT AVAILABLE

    accelerate_info:
      NOT AVAILABLE

    lapack_info:
      libraries lapack not found in ['c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\lib', 'C:\\', 'c:\\users\\amirhosein\\appdata\\local\\programs\\python\\python38-32\\libs']
      NOT AVAILABLE

    c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\system_info.py:1730: UserWarning:
        Lapack (http://www.netlib.org/lapack/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [lapack]) or by setting
        the LAPACK environment variable.
      return getattr(self, '_calc_info_{}'.format(name))()
    lapack_src_info:
      NOT AVAILABLE

    c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\system_info.py:1730: UserWarning:
        Lapack (http://www.netlib.org/lapack/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [lapack_src]) or by setting
        the LAPACK_SRC environment variable.
      return getattr(self, '_calc_info_{}'.format(name))()
      NOT AVAILABLE

    Running from scipy source directory.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Amirhosein\AppData\Local\Temp\pip-install-92y759qu\scipy\setup.py", line 474, in <module>
        setup_package()
      File "C:\Users\Amirhosein\AppData\Local\Temp\pip-install-92y759qu\scipy\setup.py", line 470, in setup_package
        setup(**metadata)
      File "c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\core.py", line 137, in setup
        config = configuration()
      File "C:\Users\Amirhosein\AppData\Local\Temp\pip-install-92y759qu\scipy\setup.py", line 388, in configuration
        config.add_subpackage('scipy')
      File "c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\misc_util.py", line 1033, in add_subpackage
        config_list = self.get_subpackage(subpackage_name, subpackage_path,
      File "c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\misc_util.py", line 999, in get_subpackage
        config = self._get_configuration_from_setup_py(
      File "c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\misc_util.py", line 941, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "scipy\setup.py", line 15, in configuration
        config.add_subpackage('linalg')
      File "c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\misc_util.py", line 1033, in add_subpackage
        config_list = self.get_subpackage(subpackage_name, subpackage_path,
      File "c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\misc_util.py", line 999, in get_subpackage
        config = self._get_configuration_from_setup_py(
      File "c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\numpy\distutils\misc_util.py", line 941, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "scipy\linalg\setup.py", line 19, in configuration
        raise NotFoundError('no lapack/blas resources found')
    numpy.distutils.system_info.NotFoundError: no lapack/blas resources found
    ----------------------------------------
  Rolling back uninstall of scipy
  Moving to c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\scipy-1.4.1.dist-info\
   from C:\Users\Amirhosein\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\~cipy-1.4.1.dist-info
  Moving to c:\users\amirhosein\appdata\local\programs\python\python38-32\lib\site-packages\scipy\
   from C:\Users\Amirhosein\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\~cipy
ERROR: Command errored out with exit status 1: 'c:\users\amirhosein\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Amirhosein\\AppData\\Local\\Temp\\pip-install-92y759qu\\scipy\\setup.py'"'"'; __file__='"'"'C:\\Users\\Amirhosein\\AppData\\Local\\Temp\\pip-install-92y759qu\\scipy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Amirhosein\AppData\Local\Temp\pip-record-pr5dotd5\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\amirhosein\appdata\local\programs\python\python38-32\Include\scipy' Check the logs for full command output.

I also installed the dependencies

sympy, numpy, scipy

Body:
Make sure that you have installed 32 bit python on purpose, otherwise install the 64 bit version instead

The error message is caused by the fact that symfit on pypi has requirement scipy<1.2,>=1.0:

Collecting scipy<1.2,>=1.0

That is why your installation is uninstalling your scipy 1.4 and downloads version 1.1. Since it has no wheels for python 3.8 (too old) it downloads the source code and then fails because it cannot find a C compiler.

No module named 'numpy.distutils._msvccompiler'

What you should do is install symfit from the github repository, as it has been updated since the last release to have requirements that are compatible with python 3.8:

 pip install git+https://github.com/tBuLi/symfit


问:
how is an event triggered for a service in oracle brm
Hello every one i have been going through the oracle communications business revenue management (BRM)   docs for sometime now but one thing i can't figure out is how are the events associated with a service triggered actually. Is it done by the BRM or the client application interacting with the BRM. Somehow the docs don't mention it or i may have missed it.Would be nice if someone can explain it to me. Note the term service is used in the same context as used in BRM docs i.e. something that the customers subscribe to and pay for when use i.e. telephony service. the link to the docs https://docs.oracle.com/cd/E51000_01/index.htm</p>

答:
Events are created by BRM:

the logic is defined in the CM (Connection Manager) tier, inside the Facilities Modules (FMs)

the actual SQL instructions are generated by the Oracle DM (dm_oracle)

For the sake of completeness, there is also another way in which events are created:

Call Detail Records (CDRs) are rated with the Batch Rating Engine (Pipeline Manager) and generate Rated Event records

these are then loaded, via the Rated Event Loader (REL), directly to the database. Under the hood, REL calls SQL*Loader and a stored procedure to update account balances and bill items