问:
How can I import Vue component into application created in php file?
I'm included into some old project made in Yii2, which already consists hundreds of models and  views.
I'm thinking about bringing some new breeze to it by adding Vue3 on top of existing platform.

I see 2 possibilities:
1st step is adding Vue to php view files in such way, that each view is its own application.
2nd step is creating in the future new Yii modules with use of Inertia.

For now i want to convience my team that Vue is great and easy to use (other people just know basics of JS and jquery). Show them basics: v-if, v-for, v-model etc.

Im able to run Vue by adding it to existing php view like that:

<?php
use yii\web\View;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\select2\Select2;

    <?php $form = ActiveForm::begin(['id' => $model->formName()]); ?>

            <?= $form->field($model, 'nazwa')->textInput(['maxlength' => true, 'v-model' => 'model.nazwa']) ?>

            <?=
                $form->field($model, 'typ_cechy')->widget(Select2::class, [
                    'data' => \Yii::$app->params['inwentarz_cechy'],
                    'options' => ['placeholder' => 'Wybierz...', 'v-model' => 'model.typ_cechy'],
                    'pluginOptions' => ['allowClear' => true],
                    'pluginEvents' => [
                        "change" => "function() { toggleList(); toggleInfo(); }",
                    ]
                ]);
            ?>

            <?= $form->field($model, 'lista')->textArea(['style' => 'height: auto !important', 'v-model' => 'model.lista'])->label('elementy listy (wprowadzaj w oddzielnych wierszach)') ?>

            <?= $form->field($model, 'info')->textInput(['maxlength' => true, 'v-model' => 'model.info']) ?>

                <?= Html::submitButton(Yii::t('inwentarz', 'Zapisz'), ['class' => 'btn btn-success', 'display' => 'hidden']) ?>

    <?php ActiveForm::end(); ?>

```
<p>What i've done here was creating app and mounting it into div cointaining Yii2 ActiveForm, adding v-model to inputs and passing values with php in created() lifecycle method. It works.</p>
<p>What im unnable to do is importing existing components. First thing needed above is to replace Kartik Select2 with vue3-select2-component.</p>
<p>I was trying to create own super simple component for test:</p>
```<template>

        Hello Vue3

</template>

```
<p>Used webpack to compile it into app.js file (below is webpack.config.js)</p>
<pre class="lang-js prettyprint-override"><code>const { VueLoaderPlugin } = require('vue-loader')
const path = require('path');

module.exports = {
    mode: 'development',
    entry: './app/App.vue',
    output: {
        filename: 'app.js',
        path: path.resolve(__dirname, '../../web/apps/inwentarz'),
    },
    module: {
        rules: [{ test: /\.vue$/, use: 'vue-loader' }],
    },
    plugins: [
        new VueLoaderPlugin()
    ]
};
</code>```

Than try to import webpacked file:

/*
(...)

(...)

*/

```

Now i get error in console: "The requested module '/apps/inwentarz/app.js' does not provide an export named 'default'".

Body:
I'm included into some old project made in Yii2, which already consists hundreds of models and  views.
I'm thinking about bringing some new breeze to it by adding Vue3 on top of existing platform.

I see 2 possibilities:
1st step is adding Vue to php view files in such way, that each view is its own application.
2nd step is creating in the future new Yii modules with use of Inertia.

For now i want to convience my team that Vue is great and easy to use (other people just know basics of JS and jquery). Show them basics: v-if, v-for, v-model etc.

Im able to run Vue by adding it to existing php view like that:

<?php
use yii\web\View;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\select2\Select2;

    <?php $form = ActiveForm::begin(['id' => $model->formName()]); ?>

            <?= $form->field($model, 'nazwa')->textInput(['maxlength' => true, 'v-model' => 'model.nazwa']) ?>

            <?=
                $form->field($model, 'typ_cechy')->widget(Select2::class, [
                    'data' => \Yii::$app->params['inwentarz_cechy'],
                    'options' => ['placeholder' => 'Wybierz...', 'v-model' => 'model.typ_cechy'],
                    'pluginOptions' => ['allowClear' => true],
                    'pluginEvents' => [
                        "change" => "function() { toggleList(); toggleInfo(); }",
                    ]
                ]);
            ?>

            <?= $form->field($model, 'lista')->textArea(['style' => 'height: auto !important', 'v-model' => 'model.lista'])->label('elementy listy (wprowadzaj w oddzielnych wierszach)') ?>

            <?= $form->field($model, 'info')->textInput(['maxlength' => true, 'v-model' => 'model.info']) ?>

                <?= Html::submitButton(Yii::t('inwentarz', 'Zapisz'), ['class' => 'btn btn-success', 'display' => 'hidden']) ?>

    <?php ActiveForm::end(); ?>

What i've done here was creating app and mounting it into div cointaining Yii2 ActiveForm, adding v-model to inputs and passing values with php in created() lifecycle method. It works.

What im unnable to do is importing existing components. First thing needed above is to replace Kartik Select2 with vue3-select2-component.

I was trying to create own super simple component for test:

<template>

        Hello Vue3

</template>

Used webpack to compile it into app.js file (below is webpack.config.js)

const { VueLoaderPlugin } = require('vue-loader')
const path = require('path');

module.exports = {
    mode: 'development',
    entry: './app/App.vue',
    output: {
        filename: 'app.js',
        path: path.resolve(__dirname, '../../web/apps/inwentarz'),
    },
    module: {
        rules: [{ test: /\.vue$/, use: 'vue-loader' }],
    },
    plugins: [
        new VueLoaderPlugin()
    ]
};

Than try to import webpacked file:

/*
(...)

(...)

*/

Now i get error in console: "The requested module '/apps/inwentarz/app.js' does not provide an export named 'default'".


来源: stackexchange

问:
The query does not work on .net but it works on sql management studio
When I run the query with sql management studio, I get results, but when I run it with .net application, my query does not work.

`

```<code>public static void findUser_P(string mail, string password)
        {
            using (var connection = GetSqlConnection())
            {
                    connection.Open();
                    string sql = "select * from [dbo].[User] where UserName=@mail and Password=@password";
                    SqlCommand fcommand = new SqlCommand(sql, connection);
                    fcommand.Parameters.AddWithValue("@password", password);
                    fcommand.Parameters.AddWithValue("@mail", mail);
                    SqlDataReader reader = fcommand.ExecuteReader();
                if (reader.Read())
                {
                    // read data for single/first record here
                        Console.WriteLine(reader[0].ToString(), reader[1].ToString());
                }
                    reader.Close();

            }

        }`
</code>```

`

ContentLicense: CC BY-SA 4.0

Body:
When I run the query with sql management studio, I get results, but when I run it with .net application, my query does not work.

`

public static void findUser_P(string mail, string password)
        {
            using (var connection = GetSqlConnection())
            {
                    connection.Open();
                    string sql = "select * from [dbo].[User] where UserName=@mail and Password=@password";
                    SqlCommand fcommand = new SqlCommand(sql, connection);
                    fcommand.Parameters.AddWithValue("@password", password);
                    fcommand.Parameters.AddWithValue("@mail", mail);
                    SqlDataReader reader = fcommand.ExecuteReader();
                if (reader.Read())
                {
                    // read data for single/first record here
                        Console.WriteLine(reader[0].ToString(), reader[1].ToString());
                }
                    reader.Close();

            }

        }`

`


问:
React redux tollkit with saga - dispatch multiple action
Hi I'm new using React with redux toolkit + redux saga.
My scenario is to show updated list after CRUD operation.
Currently data is saved successfully, and updated list is showing after refreshing the page.

If I'm calling multiple dispatch() then also it's not working.
Like this:

```<code>if (flag === "add") {
  handleAddEditModalClose();
  const body = { appname, package: packagename, version };
  await dispatch(saveVersionsData_init(body));
  await dispatch(getVersionsData_init());
}
</code>```

Component Page:

```<code>const versionsdata = useSelector((state) => state.versionsdata.data);
const isLoading = useSelector((state) => state.versionsdata.isLoading);
const status = useSelector((state) => state.versionsdata.status);
...

useEffect(() => {
  dispatch(getVersionsData_init());
  setData(versionsdata);
}, [dispatch]);

const handleSubmit = async () => {
  if (flag === "add") {
    const body = { appname, package: packagename, version };
    await dispatch(saveVersionsData_init(body));
    handleAddEditModalClose();
  }
...
}
</code>```

Slice:

```<code>import { createSlice } from "@reduxjs/toolkit";

const initialState = {
  data: [],
  isLoading: false,
  status: "error",
};

export const versionsSlice = createSlice({
  name: "versionsSlice",
  initialState,
  reducers: {
    getVersionsData_init(state, action) {
      state.isLoading = true;
      state.status = "initializing";
    },
    getVersionsData_sucess(state, action) {
      state.isLoading = false;
      state.status = "success";
      state.data = action.payload;
    },

    saveVersionsData_init(state, action) {
      state.isLoading = true;
      state.status = "initializing";
    },
    saveVersionsData_sucess(state, action) {
      state.isLoading = false;
      state.status = action.payload.status;
      //state.data = action.payload;
    },
    ....
  },
});

export const { getVersionsData_init, getVersionsData_sucess, saveVersionsData_init,
saveVersionsData_sucess, updateVersionsData_init, updateVersionsData_sucess,
deleteVersionsData_init, deleteVersionsData_sucess } = versionsSlice.actions;
export default versionsSlice.reducer;
</code>```

Saga:

```<code>import { all, take, takeEvery, put, fork, call } from "redux-saga/effects";
import * as slice from "../slices/VersionsSlice";
import * as api from "../api/VersionsApi";

export function* getVersionData_init_api({ payload }) {
  try {
    const res = yield call(api.getallappversion, payload);
    if (res.status === 200) {
      yield put(slice.getVersionsData_sucess(res.data));
    }
  } catch (err) {
    console.log("get version data error");
  }
}
export function* getVersionData_init_saga() {
  yield takeEvery(slice.getVersionsData_init, getVersionData_init_api);
}

export function* saveVersionData_init_api({ payload }) {
  try {
    const res = yield call(api.createnewappversion, payload);
    if (res.status === 200) {
      yield put(slice.saveVersionsData_sucess(res.data));
    }
  } catch (err) {
    console.log("save version data error");
  }
}
export function* saveVersionData_init_saga() {
  yield takeEvery(slice.saveVersionsData_init, saveVersionData_init_api);
}
export const versionsSaga = [fork(getVersionData_init_saga),
fork(saveVersionData_init_saga), fork(updateVersionData_init_saga),
fork(deleteVersionData_init_saga)];
</code>```

Please anyone help me sort this out

Body:
Hi I'm new using React with redux toolkit + redux saga.
My scenario is to show updated list after CRUD operation.
Currently data is saved successfully, and updated list is showing after refreshing the page.

If I'm calling multiple dispatch() then also it's not working.
Like this:

if (flag === "add") {
  handleAddEditModalClose();
  const body = { appname, package: packagename, version };
  await dispatch(saveVersionsData_init(body));
  await dispatch(getVersionsData_init());
}

Component Page:

const versionsdata = useSelector((state) => state.versionsdata.data);
const isLoading = useSelector((state) => state.versionsdata.isLoading);
const status = useSelector((state) => state.versionsdata.status);
...

useEffect(() => {
  dispatch(getVersionsData_init());
  setData(versionsdata);
}, [dispatch]);

const handleSubmit = async () => {
  if (flag === "add") {
    const body = { appname, package: packagename, version };
    await dispatch(saveVersionsData_init(body));
    handleAddEditModalClose();
  }
...
}

Slice:

import { createSlice } from "@reduxjs/toolkit";

const initialState = {
  data: [],
  isLoading: false,
  status: "error",
};

export const versionsSlice = createSlice({
  name: "versionsSlice",
  initialState,
  reducers: {
    getVersionsData_init(state, action) {
      state.isLoading = true;
      state.status = "initializing";
    },
    getVersionsData_sucess(state, action) {
      state.isLoading = false;
      state.status = "success";
      state.data = action.payload;
    },

    saveVersionsData_init(state, action) {
      state.isLoading = true;
      state.status = "initializing";
    },
    saveVersionsData_sucess(state, action) {
      state.isLoading = false;
      state.status = action.payload.status;
      //state.data = action.payload;
    },
    ....
  },
});

export const { getVersionsData_init, getVersionsData_sucess, saveVersionsData_init,
saveVersionsData_sucess, updateVersionsData_init, updateVersionsData_sucess,
deleteVersionsData_init, deleteVersionsData_sucess } = versionsSlice.actions;
export default versionsSlice.reducer;

Saga:

import { all, take, takeEvery, put, fork, call } from "redux-saga/effects";
import * as slice from "../slices/VersionsSlice";
import * as api from "../api/VersionsApi";

export function* getVersionData_init_api({ payload }) {
  try {
    const res = yield call(api.getallappversion, payload);
    if (res.status === 200) {
      yield put(slice.getVersionsData_sucess(res.data));
    }
  } catch (err) {
    console.log("get version data error");
  }
}
export function* getVersionData_init_saga() {
  yield takeEvery(slice.getVersionsData_init, getVersionData_init_api);
}

export function* saveVersionData_init_api({ payload }) {
  try {
    const res = yield call(api.createnewappversion, payload);
    if (res.status === 200) {
      yield put(slice.saveVersionsData_sucess(res.data));
    }
  } catch (err) {
    console.log("save version data error");
  }
}
export function* saveVersionData_init_saga() {
  yield takeEvery(slice.saveVersionsData_init, saveVersionData_init_api);
}
export const versionsSaga = [fork(getVersionData_init_saga),
fork(saveVersionData_init_saga), fork(updateVersionData_init_saga),
fork(deleteVersionData_init_saga)];

Please anyone help me sort this out


问:
How to push array of objects to grafana with statsd to create gauge dashboard
I want to push with statsd (prometheus) an array of objects containing user_id and other properties specific to said user. The goal is to be able to display on a graph a number of user depending on chosen property. As an example, this is the value I want to push:

```<code>[
        {
            "user_id": "b3726d1d-e947-4035-bd98-87bddbca1c2b",
            "premium": false,
            "basic": false
        },
        {
            "user_id": "a2b9e909-0e35-48b2-a7d6-0a554f802159",
            "premium": false,
            "basic": true
        },
        {
            "user_id": "1e91df33-122b-4199-adff-a001e7864221",
            "premium": true,
            "basic": false
        }
]
</code>```

And I want to be able to choose premium property in Grafana and get a number of premium users on the graph counted. How can I make it worked? This is how I tried to do it...

In the script that pushes the data, it looks like this:

```<code>const userStatistics = await UserRepository.getUserStatistics();
statsD.default.gauge("user_statistics", userStatistics);
</code>```

where userStatistics is the value mentioned before. Do I have to also push a number of total users to Grafana, or is this not needed? And if so, do I just push it as a seperate value? As in

```<code>statsD.default.gauge("totalCountOfUsers", totalCountOfUsers);
</code>```

The idea for it is to be a scalable solution, as I think new properties are also gonna be added in the future, that's why I'm thinking of doing this that way... Anyone could help out with this?

When I tried the solution above, the metrics didn't show up at all.

Body:
I want to push with statsd (prometheus) an array of objects containing user_id and other properties specific to said user. The goal is to be able to display on a graph a number of user depending on chosen property. As an example, this is the value I want to push:

[
        {
            "user_id": "b3726d1d-e947-4035-bd98-87bddbca1c2b",
            "premium": false,
            "basic": false
        },
        {
            "user_id": "a2b9e909-0e35-48b2-a7d6-0a554f802159",
            "premium": false,
            "basic": true
        },
        {
            "user_id": "1e91df33-122b-4199-adff-a001e7864221",
            "premium": true,
            "basic": false
        }
]

And I want to be able to choose premium property in Grafana and get a number of premium users on the graph counted. How can I make it worked? This is how I tried to do it...

In the script that pushes the data, it looks like this:

const userStatistics = await UserRepository.getUserStatistics();
statsD.default.gauge("user_statistics", userStatistics);

where userStatistics is the value mentioned before. Do I have to also push a number of total users to Grafana, or is this not needed? And if so, do I just push it as a seperate value? As in

statsD.default.gauge("totalCountOfUsers", totalCountOfUsers);

The idea for it is to be a scalable solution, as I think new properties are also gonna be added in the future, that's why I'm thinking of doing this that way... Anyone could help out with this?

When I tried the solution above, the metrics didn't show up at all.


问:
Is there a way of using the ImportExcel Module in Powershell to access a Excel document in a Sharepoint Document Library?
I'm currently trying to run a PowerShell script which will take excel data from a SharePoint document library and insert it into a SQL database. I'm trying to use the importExcel module in PowerShell, as I think that has the ability to get data from SharePoint if the link is written in a certain way, however I can't get it working and it displays the error: "file not found"

I've been trying to do this with a link written like this:

```<code>
$path = "\\organisation.sharepoint.com\sites\Deliveries-Team Name\Shared Documents\Spreadsheet name.xlsx"
$Workplace = Import-Excel $path -worksheetname "worksheet"

</code>```

This also doesn't work if I use:

```<code>https://organisation.sharepoint.com/sites/Deliveries-Team Name/Shared Documents/Spreadsheet name.xlsx

</code>```

When I run this using both however I get a error saying  "file not found". Does anyone know what the format of the path has to look like for this to work with the importExcel module in powershell?

Just for information, I have tried also doing this using this approach: New-Object -ComObject Excel.Application and when running it in task scheduler it was a bit tempermental on whether it would run or not(thought it would work with the path https://organisation.sharepoint.com/sites/Deliveries-Team Name/Shared Documents/Spreadsheet name.xlsx), so would prefer if it can be done with importexcel.

Thanks for all your help!

Body:
I'm currently trying to run a PowerShell script which will take excel data from a SharePoint document library and insert it into a SQL database. I'm trying to use the importExcel module in PowerShell, as I think that has the ability to get data from SharePoint if the link is written in a certain way, however I can't get it working and it displays the error: "file not found"

I've been trying to do this with a link written like this:

$path = "\\organisation.sharepoint.com\sites\Deliveries-Team Name\Shared Documents\Spreadsheet name.xlsx"
$Workplace = Import-Excel $path -worksheetname "worksheet"

This also doesn't work if I use:

https://organisation.sharepoint.com/sites/Deliveries-Team Name/Shared Documents/Spreadsheet name.xlsx

When I run this using both however I get a error saying  "file not found". Does anyone know what the format of the path has to look like for this to work with the importExcel module in powershell?

Just for information, I have tried also doing this using this approach: New-Object -ComObject Excel.Application and when running it in task scheduler it was a bit tempermental on whether it would run or not(thought it would work with the path https://organisation.sharepoint.com/sites/Deliveries-Team Name/Shared Documents/Spreadsheet name.xlsx), so would prefer if it can be done with importexcel.

Thanks for all your help!


问:
Firebase storage rules works on playground but throws 403 from client

This is my firestore database:

brokers collection:

companies collection:

users collection:

These are my firebase storage rules:

```<code>rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {

    function getDocument(collection, documentId) {
      return firestore.get(/databases/(default)/documents/$(collection)/$(documentId));
    }

    function getUser() {
      return getDocument('users', request.auth.uid).__name__;
    }

    function userIsMember(collection, documentId) {
      return getUser() in getDocument(collection, documentId).data.get('members', []);
    }

    match /companies/{companyId}/contracts/{allPaths=**} {
      allow read: if userIsMember("brokers", getDocument("companies", companyId).data.broker[4]);
    }
  }
}
</code>```

My problem:

Whenever the user vJIwuxn4jXN88Hs5uv3fZXcTlyu1 wants to get the downloadURL with the following code:

```<code>const downloadURL = await getDownloadURL(
  ref(
    storage,
    "companies/company-id/contracts/contract-id/document.pdf"
  )
);
</code>```

he gets a 403 error but I don't understand why as I believe the rules should allow him to read the file.

The weird thing is that if I try to debug the rules within the playground it works:

Any help much appreciated.

Body:
This is my firestore database:

brokers collection:

companies collection:

users collection:

These are my firebase storage rules:

rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {

    function getDocument(collection, documentId) {
      return firestore.get(/databases/(default)/documents/$(collection)/$(documentId));
    }

    function getUser() {
      return getDocument('users', request.auth.uid).__name__;
    }

    function userIsMember(collection, documentId) {
      return getUser() in getDocument(collection, documentId).data.get('members', []);
    }

    match /companies/{companyId}/contracts/{allPaths=**} {
      allow read: if userIsMember("brokers", getDocument("companies", companyId).data.broker[4]);
    }
  }
}

My problem:

Whenever the user vJIwuxn4jXN88Hs5uv3fZXcTlyu1 wants to get the downloadURL with the following code:

const downloadURL = await getDownloadURL(
  ref(
    storage,
    "companies/company-id/contracts/contract-id/document.pdf"
  )
);

he gets a 403 error but I don't understand why as I believe the rules should allow him to read the file.

The weird thing is that if I try to debug the rules within the playground it works:

Any help much appreciated.


问:
Lazy loading ApplicationScoped beans in Quarkus test only works for the parent
I'm trying to implement tests for a quarkus app so that they work natively as well. I have two application scoped beans defined as such

import org.eclipse.microprofile.config.inject.ConfigProperty
import javax.enterprise.context.ApplicationScoped

@ApplicationScoped
class Client(
    @ConfigProperty(name = "FOO") val FOO String,
    @ConfigProperty(name = "BAR") val BAR: String,
) {
    ...
}
```
<p>and another one, which depends on above <code>Client</code></p>
<pre class="lang-kotlin prettyprint-override"><code>@ApplicationScoped
class UseCases(
    private val client: Client
) {
    ...
}
</code>```

In tests, I'm lazy loading these using constructors instead of using injection to enable native-tests as well, as follows

val client by lazy {
    Client("foo", "bar")
}
```
<p>and</p>
```val useCases by lazy {
    useCases(client)
}
```
<p>When I try to refer to these in the tests, any tests using <code>useCases</code> work fine, but any tests using <code>client</code> fail saying quarkus failed to start because</p>
```Caused by: javax.enterprise.inject.spi.DeploymentException: io.quarkus.runtime.configuration.ConfigurationException: Failed to load config value of type class java.lang.String for: FOOFailed to load config value of type class java.lang.String for: BAR
```

How could I define both beans in the tests so that I can use both for testing? I'm using quarkus-junit5 for running tests.

Body:
I'm trying to implement tests for a quarkus app so that they work natively as well. I have two application scoped beans defined as such

import org.eclipse.microprofile.config.inject.ConfigProperty
import javax.enterprise.context.ApplicationScoped

@ApplicationScoped
class Client(
    @ConfigProperty(name = "FOO") val FOO String,
    @ConfigProperty(name = "BAR") val BAR: String,
) {
    ...
}

and another one, which depends on above Client

@ApplicationScoped
class UseCases(
    private val client: Client
) {
    ...
}

In tests, I'm lazy loading these using constructors instead of using injection to enable native-tests as well, as follows

val client by lazy {
    Client("foo", "bar")
}

and

val useCases by lazy {
    useCases(client)
}

When I try to refer to these in the tests, any tests using useCases work fine, but any tests using client fail saying quarkus failed to start because

Caused by: javax.enterprise.inject.spi.DeploymentException: io.quarkus.runtime.configuration.ConfigurationException: Failed to load config value of type class java.lang.String for: FOOFailed to load config value of type class java.lang.String for: BAR

How could I define both beans in the tests so that I can use both for testing? I'm using quarkus-junit5 for running tests.


问:
How to display an image in Tkinter with a transparent background on MacOS (Ventura)?
According to the StackOverflow thread here: https://stackoverflow.com/a/44296157/7817891
The following code should display an image with a transparent background:

```<code>import tkinter as tk

root = tk.Tk()
# Hide the root window drag bar and close button
root.overrideredirect(True)
# Make the root window always on top
root.wm_attributes("-topmost", True)
# Turn off the window shadow
root.wm_attributes("-transparent", True)
# Set the root window background color to a transparent color
root.config(bg='systemTransparent')

root.geometry("+300+300")

# Store the PhotoImage to prevent early garbage collection
root.image = tk.PhotoImage(file="photoshop-icon.gif")
# Display the image on a label
label = tk.Label(root, image=root.image)
# Set the label background color to a transparent color
label.config(bg='systemTransparent')
label.pack()

root.mainloop()
</code>```

However, the code ends up making the entire Tkinter window invisible.

I have tried a couple of different approaches, but cannot find anything online that seems to work with recent versions of MacOS. Is there a way to still do this?

Body:
According to the StackOverflow thread here: https://stackoverflow.com/a/44296157/7817891
The following code should display an image with a transparent background:

import tkinter as tk

root = tk.Tk()
# Hide the root window drag bar and close button
root.overrideredirect(True)
# Make the root window always on top
root.wm_attributes("-topmost", True)
# Turn off the window shadow
root.wm_attributes("-transparent", True)
# Set the root window background color to a transparent color
root.config(bg='systemTransparent')

root.geometry("+300+300")

# Store the PhotoImage to prevent early garbage collection
root.image = tk.PhotoImage(file="photoshop-icon.gif")
# Display the image on a label
label = tk.Label(root, image=root.image)
# Set the label background color to a transparent color
label.config(bg='systemTransparent')
label.pack()

root.mainloop()

However, the code ends up making the entire Tkinter window invisible.

I have tried a couple of different approaches, but cannot find anything online that seems to work with recent versions of MacOS. Is there a way to still do this?


问:
Spring Authorization Server with AuthorizationGrantType.PASSWORD
I am new to Spring Security, but somehow I implemented Spring security in my application. Now further there is requirement to create a custom Authorization server with Grant Type - Password. Please provide me any link with Authorization Server having Password Grant Type, and a Client app that is integrating to that Authorization Server.

with some below configuration in Clientapp.

```<code>employee-client-password:
            provider: abhay
            client-id: employee-client
            client-secret: employee-secret
            authorization-grant-type: password
            scope: employee_message.read
            client-name: employee-client-password
</code>```

Body:
I am new to Spring Security, but somehow I implemented Spring security in my application. Now further there is requirement to create a custom Authorization server with Grant Type - Password. Please provide me any link with Authorization Server having Password Grant Type, and a Client app that is integrating to that Authorization Server.

with some below configuration in Clientapp.

employee-client-password:
            provider: abhay
            client-id: employee-client
            client-secret: employee-secret
            authorization-grant-type: password
            scope: employee_message.read
            client-name: employee-client-password


问:
CRA Cors Type Response
I'm trying to make a POST request to a third party API, to return me a token. I've created the front with CRA.

```<code> useEffect(() => {
const login = async () => {
  const bodyData = {
    username: "xxx@xxx",
    password: "xxx",
  };
  try {
    const data = await fetch(loginUrl, {
      method: "POST",
      body: bodyData,

    });

    const token = data;

    console.log(token);
    return token;
  } catch (error) {
    console.log(error);
  }
}
 login();
 }, [])
</code>```

The problem is that I cant receive the data,

I get this response in console:

Response {type: 'cors', url: 'https://api.s360web.com/api/login', redirected: false, status: 200, ok: true, …}

With POSTMAN works fine. Any recommendation?

Title: CRA Cors Type Response

Body:
I'm trying to make a POST request to a third party API, to return me a token. I've created the front with CRA.

 useEffect(() => {
const login = async () => {
  const bodyData = {
    username: "xxx@xxx",
    password: "xxx",
  };
  try {
    const data = await fetch(loginUrl, {
      method: "POST",
      body: bodyData,

    });

    const token = data;

    console.log(token);
    return token;
  } catch (error) {
    console.log(error);
  }
}
 login();
 }, [])

The problem is that I cant receive the data,

I get this response in console:

Response {type: 'cors', url: 'https://api.s360web.com/api/login', redirected: false, status: 200, ok: true, …}

With POSTMAN works fine. Any recommendation?


问:
Unable to load FormsFlow Web
I install FormsFlow.ai manuel with Docker Containers.

When i try to enter FormsFlow Web http://localhost:3000/ theres just a loading screen with 3 points in the middle that never ends.

```<code>chromeweb

       Failed to load resource: the server responded with a status of 404 ()
Refused to frame 'http://192.168.100.4:8080/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".

(Index):1955

       crbug/1173575, non-JS module files deprecated.
(anonym) @ (Index):1955
main.220745dd.chunk.js:1 This web app is being served cache-first by a service worker. To learn more, visit https://cra.link/PWA
</code>```

Can someone help me here?

Thanks!

```<code>I install FormsFlow.ai manuel with Docker Containers.

When i try to enter FormsFlow Web http://localhost:3000/ theres just a loading screen with 3 points in the middle that never ends.

</code>```

chromeweb

```<code>   Failed to load resource: the server responded with a status of 404 ()
</code>```

Refused to frame 'http://192.168.100.4:8080/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".

(Index):1955

```<code>   crbug/1173575, non-JS module files deprecated.
</code>```

(anonym) @ (Index):1955
main.220745dd.chunk.js:1 This web app is being served cache-first by a service worker. To learn more, visit https://cra.link/PWA

```<code>
Can someone help me here?

Thanks!

</code>```

Title: Unable to load FormsFlow Web

Body:
I install FormsFlow.ai manuel with Docker Containers.

When i try to enter FormsFlow Web http://localhost:3000/ theres just a loading screen with 3 points in the middle that never ends.

chromeweb

       Failed to load resource: the server responded with a status of 404 ()
Refused to frame 'http://192.168.100.4:8080/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".

(Index):1955

       crbug/1173575, non-JS module files deprecated.
(anonym) @ (Index):1955
main.220745dd.chunk.js:1 This web app is being served cache-first by a service worker. To learn more, visit https://cra.link/PWA

Can someone help me here?

Thanks!

I install FormsFlow.ai manuel with Docker Containers.

When i try to enter FormsFlow Web http://localhost:3000/ theres just a loading screen with 3 points in the middle that never ends.

chromeweb

   Failed to load resource: the server responded with a status of 404 ()

Refused to frame 'http://192.168.100.4:8080/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".

(Index):1955

   crbug/1173575, non-JS module files deprecated.

(anonym) @ (Index):1955
main.220745dd.chunk.js:1 This web app is being served cache-first by a service worker. To learn more, visit https://cra.link/PWA

Can someone help me here?

Thanks!


问:
Python,pandas dataframe does not show decimals after exporting to csv
I've been trying to get all my data from a dynamodb database with boto3. After receiving all the data im trying to export the data to .csv The problem is that all my decimal numbers loose their comma. For example 3.457 becomes : 3457 Which is a big difference for further calculations. I tried to use df.values.round(4) but that does nothing. When im printing the dataframe to the console i can see that all values are correct. Something goes wrong with the exporting part.

This is the code that i'm using:

```<code>#Get all items from Dynamodb
response = vopak_table.scan()
data = response['Items']

while 'LastEvaluatedKey' in response:
    response = vopak_table.scan(ExclusiveStartKey=response['LastEvaluatedKey'])
    data.extend(response['Items'])

#Write data to CSV
df = pd.DataFrame(data)

#Time column first in sheet
first_column = df.pop('time')
df.insert(0,'time',first_column)
#Save as CSV
df.to_csv(r'C:\***\export.csv',index=False, header=True)
print(df)
</code>```

Printing to the console the result is like this:
before the save :
after the save :  3:

Thanks!

Body:
I've been trying to get all my data from a dynamodb database with boto3. After receiving all the data im trying to export the data to .csv The problem is that all my decimal numbers loose their comma. For example 3.457 becomes : 3457 Which is a big difference for further calculations. I tried to use df.values.round(4) but that does nothing. When im printing the dataframe to the console i can see that all values are correct. Something goes wrong with the exporting part.

This is the code that i'm using:

#Get all items from Dynamodb
response = vopak_table.scan()
data = response['Items']

while 'LastEvaluatedKey' in response:
    response = vopak_table.scan(ExclusiveStartKey=response['LastEvaluatedKey'])
    data.extend(response['Items'])

#Write data to CSV
df = pd.DataFrame(data)

#Time column first in sheet
first_column = df.pop('time')
df.insert(0,'time',first_column)
#Save as CSV
df.to_csv(r'C:\***\export.csv',index=False, header=True)
print(df)

Printing to the console the result is like this:
before the save :
after the save :  3:

Thanks!


问:
Regarding google server tag show 500 error
we have used the google cloud project for server-side tagging but it gives a 500 error.

Can you please let me know why it giving an 500 error can we need to upgrade the account?

Please check the attached screenshot for more information.

Thanks,

Can you please let me know why it giving an 500 error can we need to upgrade the account?


问:
Pyttsx is not showing languages, getting error
I was having problem with my pyttsx3 not showing some installed languages.

So I followed this solution:

Open regedit.exe (Windows + R, and type regedit) and navigate to the Registry key Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokens.

Right click on the voice you want to use and chose export.

Open the exported file with a text editor (for example Notepad++).

Copy all the text a second time in the file so you have everything two times (except the first line Windows Registry Editor Version 5.00).

In the first part of the data, replace \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokensby HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens (you have to do this at two distinct places).

In the second part (the one you pasted below), do the same but change for HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens (again, two places to change).

Save the file, close it, and double click it. Accept the registry modification.

Restart your computer.

But to my surprised, after restarting my pc, after trying some basic test code from this library, I am getting errors and I have no idea what went wrong or how to fix it.
There is my code (basic test, worked before I followed the sollution up here)

```<code>import pyttsx3

engine = pyttsx3.init()

engine.say("Hello world")
engine.runAndWait()
voices = engine.getProperty('voices')
for voice in voices:
    print("Voice: %s" % voice.name)
    print(" - ID: %s" % voice.id)
    print(" - Languages: %s" % voice.languages)
    print(" - Gender: %s" % voice.gender)
    print(" - Age: %s" % voice.age)
    print("\n")
</code>```

Well after following the solution up, all I get is error message:

```<code>Traceback (most recent call last):
  File "C:\Users\Esmessica\Desktop\file_folder\main.py", line 6, in <module>
    voices = engine.getProperty('voices')
  File "C:\Users\Esmessica\Desktop\file_folder\venv\lib\site-packages\pyttsx3\engine.py", line 146, in getProperty
    return self.proxy.getProperty(name)
  File "C:\Users\Esmessica\Desktop\file_folder\venv\lib\site-packages\pyttsx3\driver.py", line 173, in getProperty
    return self._driver.getProperty(name)
  File "C:\Users\Esmessica\Desktop\file_folder\venv\lib\site-packages\pyttsx3\drivers\sapi5.py", line 88, in getProperty
    return [self._toVoice(attr) for attr in self._tts.GetVoices()]
  File "C:\Users\Esmessica\Desktop\file_folder\venv\lib\site-packages\pyttsx3\drivers\sapi5.py", line 88, in <listcomp>
    return [self._toVoice(attr) for attr in self._tts.GetVoices()]
  File "C:\Users\Esmessica\Desktop\file_folder\venv\lib\site-packages\pyttsx3\drivers\sapi5.py", line 77, in _toVoice
    return Voice(attr.Id, attr.GetDescription())
_ctypes.COMError: (-2147200966, None, (None, None, None, 0, None))

Process finished with exit code 1

</code>```

I don't know how to solve this or how did it even happened.
Probably something wrong with registries?
I never worked with registries or with this library so I am sorry if my question is kind of amateur.

Body:
I was having problem with my pyttsx3 not showing some installed languages.

So I followed this solution:

Open regedit.exe (Windows + R, and type regedit) and navigate to the Registry key Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokens.

Right click on the voice you want to use and chose export.

Open the exported file with a text editor (for example Notepad++).

Copy all the text a second time in the file so you have everything two times (except the first line Windows Registry Editor Version 5.00).

In the first part of the data, replace \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokensby HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens (you have to do this at two distinct places).

In the second part (the one you pasted below), do the same but change for HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens (again, two places to change).

Save the file, close it, and double click it. Accept the registry modification.

Restart your computer.

But to my surprised, after restarting my pc, after trying some basic test code from this library, I am getting errors and I have no idea what went wrong or how to fix it.
There is my code (basic test, worked before I followed the sollution up here)

import pyttsx3

engine = pyttsx3.init()

engine.say("Hello world")
engine.runAndWait()
voices = engine.getProperty('voices')
for voice in voices:
    print("Voice: %s" % voice.name)
    print(" - ID: %s" % voice.id)
    print(" - Languages: %s" % voice.languages)
    print(" - Gender: %s" % voice.gender)
    print(" - Age: %s" % voice.age)
    print("\n")

Well after following the solution up, all I get is error message:

Traceback (most recent call last):
  File "C:\Users\Esmessica\Desktop\file_folder\main.py", line 6, in <module>
    voices = engine.getProperty('voices')
  File "C:\Users\Esmessica\Desktop\file_folder\venv\lib\site-packages\pyttsx3\engine.py", line 146, in getProperty
    return self.proxy.getProperty(name)
  File "C:\Users\Esmessica\Desktop\file_folder\venv\lib\site-packages\pyttsx3\driver.py", line 173, in getProperty
    return self._driver.getProperty(name)
  File "C:\Users\Esmessica\Desktop\file_folder\venv\lib\site-packages\pyttsx3\drivers\sapi5.py", line 88, in getProperty
    return [self._toVoice(attr) for attr in self._tts.GetVoices()]
  File "C:\Users\Esmessica\Desktop\file_folder\venv\lib\site-packages\pyttsx3\drivers\sapi5.py", line 88, in <listcomp>
    return [self._toVoice(attr) for attr in self._tts.GetVoices()]
  File "C:\Users\Esmessica\Desktop\file_folder\venv\lib\site-packages\pyttsx3\drivers\sapi5.py", line 77, in _toVoice
    return Voice(attr.Id, attr.GetDescription())
_ctypes.COMError: (-2147200966, None, (None, None, None, 0, None))

Process finished with exit code 1

I don't know how to solve this or how did it even happened.
Probably something wrong with registries?
I never worked with registries or with this library so I am sorry if my question is kind of amateur.


问:
Setup my infrastructure to deploy and host my web apps
I'm looking for to know how can I create an infrastrucuture to deploy and host my web apps.

I developed web apps using ASP.Net core with MySQL.

I'd like to set up an infrastructure in cloud like for exemple:

AWS (or other cloud service )with some Linux distro, and some open source tool like Open Shift to deploy my apps with GitLab.

So I don't know for where I need to start, how you all doing to store and deploy your apps ?

Thank you all in advance !

Set up an infrastructure where I have two environments (development and production) to deploy and host my web apps (ASP.Net core)


问:
How to create writtable replica in TimeScaleDB?
I have been trying to implement database clustering and replication in timescaleDB. I have done the setup for replication, then the primary database is replicated to the replica node.

But in the replica database, I can perform the read-only query. I could not run queries such as create, insert, or update.

How can I make a replica server writable?

database version: 12.12

config in the primary database

```<code> synchronous_commit = off
 wal_level = replica
 max_replication_slots = 150
 listen_addresses = '*'
</code>```

I have followed the following document for database replication

https://docs.timescale.com/timescaledb/latest/how-to-guides/replication-and-ha/configure-replication/

Body:
I have been trying to implement database clustering and replication in timescaleDB. I have done the setup for replication, then the primary database is replicated to the replica node.

But in the replica database, I can perform the read-only query. I could not run queries such as create, insert, or update.

How can I make a replica server writable?

database version: 12.12

config in the primary database

 synchronous_commit = off
 wal_level = replica
 max_replication_slots = 150
 listen_addresses = '*'

I have followed the following document for database replication

https://docs.timescale.com/timescaledb/latest/how-to-guides/replication-and-ha/configure-replication/


问:
Cover the touch area that is overlapped by another layout
I want to show a layout on top of another layout that is in full screen, but when I touch the laout that in on top (higher translationZ) the view that is behind this layout also get clicked. I want the view that is in behind have touch gesture but I don't want touch gesture when I click the viewholder that is on top.

Also when I use AppBarLayout then there is no problem, but when I use ConstraintLayout, I am not able to fix the problem.

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/clBigScreenPhotoInfo"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:translationZ="1dp"
            android:visibility="invisible">

            <com.google.android.material.appbar.AppBarLayout
                android:background="#77000000"
                android:id="@+id/appBarLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:elevation="0dp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.5"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent">

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <androidx.appcompat.widget.Toolbar
                        android:id="@+id/toolbar_home"
                        android:layout_width="match_parent"
                        android:layout_height="72dp"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <ImageView
                        android:id="@+id/ivBack"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="16dp"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintTop_toTopOf="parent"
                        app:srcCompat="@drawable/ic_back_white" />

                </androidx.constraintlayout.widget.ConstraintLayout>
            </com.google.android.material.appbar.AppBarLayout>

            <androidx.constraintlayout.widget.ConstraintLayout
                app:elevation="1dp"
                android:layout_width="match_parent"
                android:layout_height="120dp"
                android:background="#77000000"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.5"
                app:layout_constraintStart_toStartOf="parent">

            </androidx.constraintlayout.widget.ConstraintLayout>
        </androidx.constraintlayout.widget.ConstraintLayout>

        <ImageView
            android:id="@+id/ivBig"
            android:translationZ="0dp"
            android:layout_width="match_parent"
            android:src="@drawable/big"
            android:layout_height="match_parent"/>

    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>
```
<p>click listener of the imageView that is in behind</p>
```binding.ivBig.setOnClickListener {
    val v = binding.clBigScreenPhotoInfo
    if (v.visibility == View.INVISIBLE) {
        v.visibility = View.VISIBLE
        return
    }
    v.visibility = View.INVISIBLE
}
```

Body:
I want to show a layout on top of another layout that is in full screen, but when I touch the laout that in on top (higher translationZ) the view that is behind this layout also get clicked. I want the view that is in behind have touch gesture but I don't want touch gesture when I click the viewholder that is on top.

Also when I use AppBarLayout then there is no problem, but when I use ConstraintLayout, I am not able to fix the problem.

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/clBigScreenPhotoInfo"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:translationZ="1dp"
            android:visibility="invisible">

            <com.google.android.material.appbar.AppBarLayout
                android:background="#77000000"
                android:id="@+id/appBarLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:elevation="0dp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.5"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent">

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <androidx.appcompat.widget.Toolbar
                        android:id="@+id/toolbar_home"
                        android:layout_width="match_parent"
                        android:layout_height="72dp"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <ImageView
                        android:id="@+id/ivBack"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="16dp"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintTop_toTopOf="parent"
                        app:srcCompat="@drawable/ic_back_white" />

                </androidx.constraintlayout.widget.ConstraintLayout>
            </com.google.android.material.appbar.AppBarLayout>

            <androidx.constraintlayout.widget.ConstraintLayout
                app:elevation="1dp"
                android:layout_width="match_parent"
                android:layout_height="120dp"
                android:background="#77000000"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.5"
                app:layout_constraintStart_toStartOf="parent">

            </androidx.constraintlayout.widget.ConstraintLayout>
        </androidx.constraintlayout.widget.ConstraintLayout>

        <ImageView
            android:id="@+id/ivBig"
            android:translationZ="0dp"
            android:layout_width="match_parent"
            android:src="@drawable/big"
            android:layout_height="match_parent"/>

    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>

click listener of the imageView that is in behind

binding.ivBig.setOnClickListener {
    val v = binding.clBigScreenPhotoInfo
    if (v.visibility == View.INVISIBLE) {
        v.visibility = View.VISIBLE
        return
    }
    v.visibility = View.INVISIBLE
}


问:
Method not found: CryptProtectData
Dears all
I am working on a project using Identity authentication. Everything was working alright and I added automapper library. After that when i ran the project i started getting;

MissingMethodException: Method not found: 'Boolean
Microsoft.AspNetCore.Cryptography.UnsafeNativeMethods.CryptProtectData(Microsoft.AspNetCore.Cryptography.DATA_BLOB*,
IntPtr, Microsoft.AspNetCore.Cryptography.DATA_BLOB*, IntPtr, IntPtr,
UInt32, Microsoft.AspNetCore.Cryptography.DATA_BLOB ByRef)'.

I am unable to trace the source of this error. Any help will be appreciated.

I am building the application on .net core 6.

Title: Method not found: CryptProtectData


问:
Adding claims to access token received from B2C custom policy
I have a problem where I need the access token received from a custom policy B2C flow to contain certain claims, for example email. I have one flow for local login (email + password) and that gives me a correct access token, it contains email. However, my other flow for social IDP does not give an access token with any extra claims. An access token from Facebook looks something like this:

```<code>{
  "typ": "JWT",
  "alg": "RS256",
  "kid": "IiippFxxxxxxxxxxxxxxxxxxqVEz16tNMOR0"
}.{
  "iss": "https://xxxxxxxxxxxxxxx.b2clogin.com/a861612f-xxxxxxxxxxxxxxxx-34e14528d/v2.0/",
  "exp": 1671466114,
  "nbf": 1671462514,
  "aud": "b0823952xxxxxxxxxxxxxxxx363b7bdfe0a",
  "sub": "c1aceafd-xxxxxxxxxxxxxxxf4f1a0a83a7",
  "idp": "facebook.com",
  "tid": "a861612fxxxxxxxxxxxxxxxxxxxce534e14528d",
  "nonce": "73eee291-xxxxxxxxxxxxxf6-85818e3efdab",
  "scp": "user.read",
  "azp": "b0823952-xxxxxxxxxxxxxxx2363b7bdfe0a",
  "ver": "1.0",
  "iat": 1671462514
}.[Signature]
</code>```

While the access token from a local sign in looks like this:

```<code>{
  "typ": "JWT",
  "alg": "RS256",
  "kid": "IiippFPBuNxxxxxxxxxxxxxxxxxxxPDWO9qVEz16tNMOR0"
}.{
  "iss": "https://xxxxxxxxxxxxxxxx.b2clogin.com/a861612f-xxxxxxxxxxxxxxxxx14528d/v2.0/",
  "exp": 1671546543,
  "nbf": 1671542943,
  "aud": "b0823952xxxxxxxxxxxxxxxx363b7bdfe0a",
  "sub": "c1aceafd-xxxxxxxxxxxxxxxx1f4f1a0a83a7",
  "userIdentities": [
    {
      "issuer": "https://oidc.test.xxxxx.com",
      "issuerUserId": "1xxxxxxxxxxxxx9"
    },
    {
      "issuer": "linkedin.com",
      "issuerUserId": "xxxxxxxxxx"
    },
    {
      "issuer": "facebook.com",
      "issuerUserId": "xxxxxxxxxxxxx"
    }
  ],
  "email": "my@email.com",
  "name": "My name",
  "given_name": "My",
  "family_name": "Name",
  "idp": "Local",
  "tid": "a86161xxxxxxxxxxxxxxxxxxxx4e14528d",
  "nonce": "e080be59xxxxxxxxxxxxxxxxxxxx5bfa353bd601",
  "scp": "user.read",
  "azp": "b0823952xxxxxxxxxxxxx3b7bdfe0a",
  "ver": "1.0",
  "iat": 1671542943
}.[Signature]
</code>```

I know that there's several kinds of tokens and it is the access token I need, not ID token or refresh token. The access token from the custom policy flow will be automatically injected into my API calls by MSAL interceptor in the frontend.

None of my specified OutputClaims in my Custom policy are present in the access token. I have also tried adding optionalClaims in my applications manifest in Azure portal like this:

```<code>    "optionalClaims": {
        "idToken": [],
        "accessToken": [
            {
                "name": "email",
                "source": "user",
                "essential": true,
                "additionalProperties": []
            }
        ],
        "saml2Token": []
    },
</code>```

I've also tried mail instead of email, and User instead of user.

Body:
I have a problem where I need the access token received from a custom policy B2C flow to contain certain claims, for example email. I have one flow for local login (email + password) and that gives me a correct access token, it contains email. However, my other flow for social IDP does not give an access token with any extra claims. An access token from Facebook looks something like this:

{
  "typ": "JWT",
  "alg": "RS256",
  "kid": "IiippFxxxxxxxxxxxxxxxxxxqVEz16tNMOR0"
}.{
  "iss": "https://xxxxxxxxxxxxxxx.b2clogin.com/a861612f-xxxxxxxxxxxxxxxx-34e14528d/v2.0/",
  "exp": 1671466114,
  "nbf": 1671462514,
  "aud": "b0823952xxxxxxxxxxxxxxxx363b7bdfe0a",
  "sub": "c1aceafd-xxxxxxxxxxxxxxxf4f1a0a83a7",
  "idp": "facebook.com",
  "tid": "a861612fxxxxxxxxxxxxxxxxxxxce534e14528d",
  "nonce": "73eee291-xxxxxxxxxxxxxf6-85818e3efdab",
  "scp": "user.read",
  "azp": "b0823952-xxxxxxxxxxxxxxx2363b7bdfe0a",
  "ver": "1.0",
  "iat": 1671462514
}.[Signature]

While the access token from a local sign in looks like this:

{
  "typ": "JWT",
  "alg": "RS256",
  "kid": "IiippFPBuNxxxxxxxxxxxxxxxxxxxPDWO9qVEz16tNMOR0"
}.{
  "iss": "https://xxxxxxxxxxxxxxxx.b2clogin.com/a861612f-xxxxxxxxxxxxxxxxx14528d/v2.0/",
  "exp": 1671546543,
  "nbf": 1671542943,
  "aud": "b0823952xxxxxxxxxxxxxxxx363b7bdfe0a",
  "sub": "c1aceafd-xxxxxxxxxxxxxxxx1f4f1a0a83a7",
  "userIdentities": [
    {
      "issuer": "https://oidc.test.xxxxx.com",
      "issuerUserId": "1xxxxxxxxxxxxx9"
    },
    {
      "issuer": "linkedin.com",
      "issuerUserId": "xxxxxxxxxx"
    },
    {
      "issuer": "facebook.com",
      "issuerUserId": "xxxxxxxxxxxxx"
    }
  ],
  "email": "my@email.com",
  "name": "My name",
  "given_name": "My",
  "family_name": "Name",
  "idp": "Local",
  "tid": "a86161xxxxxxxxxxxxxxxxxxxx4e14528d",
  "nonce": "e080be59xxxxxxxxxxxxxxxxxxxx5bfa353bd601",
  "scp": "user.read",
  "azp": "b0823952xxxxxxxxxxxxx3b7bdfe0a",
  "ver": "1.0",
  "iat": 1671542943
}.[Signature]

I know that there's several kinds of tokens and it is the access token I need, not ID token or refresh token. The access token from the custom policy flow will be automatically injected into my API calls by MSAL interceptor in the frontend.

None of my specified OutputClaims in my Custom policy are present in the access token. I have also tried adding optionalClaims in my applications manifest in Azure portal like this:

    "optionalClaims": {
        "idToken": [],
        "accessToken": [
            {
                "name": "email",
                "source": "user",
                "essential": true,
                "additionalProperties": []
            }
        ],
        "saml2Token": []
    },

I've also tried mail instead of email, and User instead of user.


问:
Python, Streamlit - null dataframe
In my code i filter some data in dataframe:

```<code>CurrentBOM = merged_Plan_BOM_df.loc[(merged_Plan_BOM_df['ORDER_REF_STR'] == filtered_df['ORDER_REF_STR'].item())]
</code>```

I am looking for one item which i want to visualisate like below:

```<code>with st.container():
    col2.dataframe(CurrentBOM,100,1000)
</code>```

It is working properly, but what with the situataion when the CurrentBOM is empty(no results in this moment). I have an error.

I want to understand how manage my "queries" on dataframe when they are null.

Title: Python, Streamlit - null dataframe

Body:
In my code i filter some data in dataframe:

CurrentBOM = merged_Plan_BOM_df.loc[(merged_Plan_BOM_df['ORDER_REF_STR'] == filtered_df['ORDER_REF_STR'].item())]

I am looking for one item which i want to visualisate like below:

with st.container():
    col2.dataframe(CurrentBOM,100,1000)

It is working properly, but what with the situataion when the CurrentBOM is empty(no results in this moment). I have an error.

I want to understand how manage my "queries" on dataframe when they are null.


问:
update gt table with selected markers on a leaflet map in R
I'm trying to update a GT table with selected markers in a leaflet marker but for the life of me I cannot get it to update the table. There are no errors when I run the app, and there are no errors in the console when trying to select a marker.</p>
```<code># Define UI for application that draws a histogram
  ui <- fluidPage(

  # Application title
 titlePanel("Sales Volume Map Report"),

 # Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
  selectizeInput("Primary_Provider","Choose Primary Provider",selected = NULL,choices = c("",unique(providers$ProviderNumber))),
  selectizeInput("Compare_Group","Choose Providers to Compare",choices = c(unique(providers$ProviderNumber)),multiple = TRUE),
  numericInput("radius", "Choose Radius in Miles:", 10, min = 1, max = 1000),
  downloadButton("download")
),

# Show a plot of the generated distribution
mainPanel(
  leafletOutput("mymap"),
  gt_output(outputId = "table")
)
 )
)
server <- function(input, output, session) {

my_gt_object <- reactive(gt(data %>%
                            dplyr::select(ProviderNumber,Facilityname,Year,Service_Line,Corazon_Category,volume) %>%
                            dplyr::mutate(Corazon_Category = case_when(str_detect(Corazon_Category,"PCI & PV") ~ "PCI", TRUE ~ Corazon_Category)) %>%
                            dplyr::filter(ProviderNumber == input$Primary_Provider | ProviderNumber %in% c(input$Compare_Group)) %>%
                            dplyr::group_by(ProviderNumber,Facilityname,Year,Service_Line,Corazon_Category) %>%
                            pivot_wider(names_from = Year,values_from = volume,names_sort = TRUE ,values_fn = \(volume) sum(volume, na.rm = TRUE)) %>%
                            dplyr::mutate(Case_Change = `2020` -`2019`) %>%
                            dplyr::mutate(Percent_change = (`2020` -`2019`) / `2020` ) %>%
                            dplyr::mutate(primary = case_when(ProviderNumber == input$Primary_Provider ~ 1,FALSE ~ 0)) %>%
                            dplyr::arrange(desc(primary),Service_Line,Corazon_Category) %>%
                            dplyr::select(-c(ProviderNumber)),
                          groupname_col = c("Service_Line","Corazon_Category")
)
 output$table <- render_gt(my_gt_object())

  output$mymap <- renderLeaflet({
leaflet(cords) %>%
  addTiles() %>%
  addCircles(data = (cords %>%
                       dplyr::filter(providernumber == input$Primary_Provider)),lng = ~longitude, lat =  ~latitude, color = 'black', fillColor = 'Red',
             radius = (input$radius*1609.344), opacity = .3) %>%
  addCircleMarkers(lng = ~longitude, lat = ~latitude,
                   popup = ~as.character(providernumber), label = ~as.character(providernumber)) %>%
  addCircleMarkers(data = (cords %>%
                             dplyr::filter(providernumber == input$Primary_Provider)),lng = ~longitude, lat =  ~latitude,color = 'Green')
 })

observeEvent(input$sitemap_marker_click, {
click <- input$sitemap_marker_click
updateSelectInput(session, "Compare_Group",
                  selected = c(click$id[!click$id %in% input$Compare_Group],
                               input$Compare_Group[input$Compare_Group != click$id]))
})
</code>```

Body:
I'm trying to update a GT table with selected markers in a leaflet marker but for the life of me I cannot get it to update the table. There are no errors when I run the app, and there are no errors in the console when trying to select a marker.

# Define UI for application that draws a histogram
  ui <- fluidPage(

  # Application title
 titlePanel("Sales Volume Map Report"),

 # Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
  selectizeInput("Primary_Provider","Choose Primary Provider",selected = NULL,choices = c("",unique(providers$ProviderNumber))),
  selectizeInput("Compare_Group","Choose Providers to Compare",choices = c(unique(providers$ProviderNumber)),multiple = TRUE),
  numericInput("radius", "Choose Radius in Miles:", 10, min = 1, max = 1000),
  downloadButton("download")
),

# Show a plot of the generated distribution
mainPanel(
  leafletOutput("mymap"),
  gt_output(outputId = "table")
)
 )
)
server <- function(input, output, session) {

my_gt_object <- reactive(gt(data %>%
                            dplyr::select(ProviderNumber,Facilityname,Year,Service_Line,Corazon_Category,volume) %>%
                            dplyr::mutate(Corazon_Category = case_when(str_detect(Corazon_Category,"PCI & PV") ~ "PCI", TRUE ~ Corazon_Category)) %>%
                            dplyr::filter(ProviderNumber == input$Primary_Provider | ProviderNumber %in% c(input$Compare_Group)) %>%
                            dplyr::group_by(ProviderNumber,Facilityname,Year,Service_Line,Corazon_Category) %>%
                            pivot_wider(names_from = Year,values_from = volume,names_sort = TRUE ,values_fn = \(volume) sum(volume, na.rm = TRUE)) %>%
                            dplyr::mutate(Case_Change = `2020` -`2019`) %>%
                            dplyr::mutate(Percent_change = (`2020` -`2019`) / `2020` ) %>%
                            dplyr::mutate(primary = case_when(ProviderNumber == input$Primary_Provider ~ 1,FALSE ~ 0)) %>%
                            dplyr::arrange(desc(primary),Service_Line,Corazon_Category) %>%
                            dplyr::select(-c(ProviderNumber)),
                          groupname_col = c("Service_Line","Corazon_Category")
)
 output$table <- render_gt(my_gt_object())

  output$mymap <- renderLeaflet({
leaflet(cords) %>%
  addTiles() %>%
  addCircles(data = (cords %>%
                       dplyr::filter(providernumber == input$Primary_Provider)),lng = ~longitude, lat =  ~latitude, color = 'black', fillColor = 'Red',
             radius = (input$radius*1609.344), opacity = .3) %>%
  addCircleMarkers(lng = ~longitude, lat = ~latitude,
                   popup = ~as.character(providernumber), label = ~as.character(providernumber)) %>%
  addCircleMarkers(data = (cords %>%
                             dplyr::filter(providernumber == input$Primary_Provider)),lng = ~longitude, lat =  ~latitude,color = 'Green')
 })

observeEvent(input$sitemap_marker_click, {
click <- input$sitemap_marker_click
updateSelectInput(session, "Compare_Group",
                  selected = c(click$id[!click$id %in% input$Compare_Group],
                               input$Compare_Group[input$Compare_Group != click$id]))
})


问:
Git Not Allowing to push changes to remote Repo
I have been facing the following error everytime I try to push changes to a remote repository:

"ERROR: Write access to repository not granted.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists. "

I have the SSH keys already set I am able also to git pull and git clone with no problems, the issue is just when I try to push changes.

Do you have any idea about ow to solve it ??
I am using a MacOs .

Thank you in advance for your time.

I removed the SSH keys from github account also I generated them again on my machine and added them again in my github account, but no luck so far.


问:
Effective installer for large applications
I have a big application, which includes multiple modules (desktop,web)
Applications written using C#
application has abo many desktop tools
we use visual studio installer for years to prepare msi files
but now we need to develop one group installer that takes care of installing application and tools and
also uninstall them
something like visual studio setup, customer can choose tools and install them and not installing each part separately

need to know please recommended installers for this task

We tried WIX and visual studio installers but we noticed that wix is declining in market, needs help if this is true and is the recommended alternatives


问:
React Native Flatlist Touchable opacity
I'm new to programming and I can't seem to add touchable opacity to flatlist renderitem for contacts. anyone can help?

I need this code to have a touchable opacity

```<code>import React, {useEffect, useState} from 'react';
import {FlatList, View, Text, StyleSheet,TouchableOpacity} from 'react-native';
import Contacts from 'react-native-contacts';
import {Contact} from '.';
const ContactsList = () => {
  const [contacts, setContacts] = useState([]);
  useEffect(() => {
    Contacts.getAll().then(contacts => {
      setContacts(contacts);
    });
  }, []);
  const keyExtractor = (item, idx) => {
    return item?.recordID?.toString() || idx.toString();
  };
  const renderItem = ({item, index}) => {
    return <Contact contact={item} />;
  };
  return (
    <FlatList

      data={contacts}
      keyExtractor={keyExtractor}
      style={styles.list}
      renderItem={ renderItem }
    />
  );
};
const styles = StyleSheet.create({
  list: {
    flex: 1,
  },
});
export default ContactsList;

</code>```

Title: React Native Flatlist Touchable opacity

Body:
I'm new to programming and I can't seem to add touchable opacity to flatlist renderitem for contacts. anyone can help?

I need this code to have a touchable opacity

import React, {useEffect, useState} from 'react';
import {FlatList, View, Text, StyleSheet,TouchableOpacity} from 'react-native';
import Contacts from 'react-native-contacts';
import {Contact} from '.';
const ContactsList = () => {
  const [contacts, setContacts] = useState([]);
  useEffect(() => {
    Contacts.getAll().then(contacts => {
      setContacts(contacts);
    });
  }, []);
  const keyExtractor = (item, idx) => {
    return item?.recordID?.toString() || idx.toString();
  };
  const renderItem = ({item, index}) => {
    return <Contact contact={item} />;
  };
  return (
    <FlatList

      data={contacts}
      keyExtractor={keyExtractor}
      style={styles.list}
      renderItem={ renderItem }
    />
  );
};
const styles = StyleSheet.create({
  list: {
    flex: 1,
  },
});
export default ContactsList;


问:
convert base64 to image to dispaly in input type="file" -React
I have form with 4 pages , written in react. when I am clicking on next page the form data of this page are saved in sessionStorage and move to next page. so that if I am returning the previous page the form takes its values from the storage.
My problem is with the pictures.
I upload an image in an input that accepts image files.
and saves it in storage after converting to base64.

The problem is that when I go back, I can't get the image to be displayed in the input.
(And don't send the photo in axios after I get to the last page)
I would very much appreciate your answers.
here I am setting the image:```</p>
``` const getBase64FromUrl = async (url) => {
    const data = await fetch(url);
    const blob = await data.blob();
    return new Promise((resolve) => {
      const reader = new FileReader();
      reader.readAsDataURL(blob);
      reader.onloadend = () => {
        const base64data = reader.result;
        sessionStorage.setItem("deceasedPhoto", base64data)
        resolve(base64data)
      };
    });
  };

  const handleChange = function loadFile(event) {
    if (event.target.files.length > 0) {
      const file = URL.createObjectURL(event.target.files[0]);
      getBase64FromUrl(file)
      setFile({
        url: file,
        file: event.target.files[0],
        name: event.target.files[0].name,
      });

    }
  };

```
``` <>

                  <Input
                    accept="image/*"
                    onChange={handleChange}
                    file={file.file}
                    id="icon-button-file"
                    type="file"
                    sx={{ display: "none" }}
                  />
                  <IconButton
                    sx={{ bgcolor: "#000000", m: 0 }}
                    aria-label="upload picture"
                    component="span"
                  >
                    <PhotoCamera
                      sx={{ color: "#ffffff", height: 12, width: 12, p: 0 }}
                    />
                  </IconButton>

```
<p>and here how I try to get it in useffect hook when page mounted:`</p>
```  const [file, setFile] = useState({ url: "", file: "", name: "" });

```
```function dataURLtoFile(dataurl, filename) {

    var arr = dataurl.split(','),
      mime = arr[0].match(/:(.*?);/)[1],
      bstr = atob(arr[1]),
      n = bstr.length,
      u8arr = new Uint8Array(n);

    while (n--) {
      u8arr[n] = bstr.charCodeAt(n);
    }

    return new File([u8arr], filename, { type: mime });
  }
```
```useEffect(() => {

    if (sessionStorage.getItem("deceasedPhoto")) {

      var file = dataURLtoFile(sessionStorage.getItem("deceasedPhoto"), 'hello.png');

      setFile({ url: "", file: file, name: "" })
    }
  }, [])

````your text`
</code>```

Body:
I have form with 4 pages , written in react. when I am clicking on next page the form data of this page are saved in sessionStorage and move to next page. so that if I am returning the previous page the form takes its values from the storage.
My problem is with the pictures.
I upload an image in an input that accepts image files.
and saves it in storage after converting to base64.

The problem is that when I go back, I can't get the image to be displayed in the input.
(And don't send the photo in axios after I get to the last page)
I would very much appreciate your answers.
here I am setting the image:```</p>
<pre><code> const getBase64FromUrl = async (url) => {
    const data = await fetch(url);
    const blob = await data.blob();
    return new Promise((resolve) => {
      const reader = new FileReader();
      reader.readAsDataURL(blob);
      reader.onloadend = () => {
        const base64data = reader.result;
        sessionStorage.setItem("deceasedPhoto", base64data)
        resolve(base64data)
      };
    });
  };

  const handleChange = function loadFile(event) {
    if (event.target.files.length > 0) {
      const file = URL.createObjectURL(event.target.files[0]);
      getBase64FromUrl(file)
      setFile({
        url: file,
        file: event.target.files[0],
        name: event.target.files[0].name,
      });

    }
  };

</code></pre>
<pre><code> <>
                <label htmlFor="icon-button-file">
                  <Input
                    accept="image/*"
                    onChange={handleChange}
                    file={file.file}
                    id="icon-button-file"
                    type="file"
                    sx={{ display: "none" }}
                  />
                  <IconButton
                    sx={{ bgcolor: "#000000", m: 0 }}
                    aria-label="upload picture"
                    component="span"
                  >
                    <PhotoCamera
                      sx={{ color: "#ffffff", height: 12, width: 12, p: 0 }}
                    />
                  </IconButton>
                </label>
</code></pre>
<p>and here how I try to get it in useffect hook when page mounted:`</p>
<pre><code>  const [file, setFile] = useState({ url: "", file: "", name: "" });

</code></pre>
<pre><code>function dataURLtoFile(dataurl, filename) {

    var arr = dataurl.split(','),
      mime = arr[0].match(/:(.*?);/)[1],
      bstr = atob(arr[1]),
      n = bstr.length,
      u8arr = new Uint8Array(n);

    while (n--) {
      u8arr[n] = bstr.charCodeAt(n);
    }

    return new File([u8arr], filename, { type: mime });
  }
</code></pre>
<pre><code>useEffect(() => {

    if (sessionStorage.getItem("deceasedPhoto")) {

      var file = dataURLtoFile(sessionStorage.getItem("deceasedPhoto"), 'hello.png');

      setFile({ url: "", file: file, name: "" })
    }
  }, [])

````your text`


问:
How to render dynamically fetched 3rd party component in Next.js?
I am using an emoji picker npm package. The package size is quite large ~25Kbs (minified + gzipped) which is why I want to dynamically fetch it only when required, to not increase my bundle size and initial load time.

If you scroll a bit in the docs, you'll find a way to dynamically fetch it using a CDN (snippet below). This returns an HTML element. The problem with React is that we cannot render objects as children. I'd like to understand how to dynamically fetch this component and render it.

```<code>import { Picker } from 'emoji-mart'
new Picker({
  data: async () => {
    const response = await fetch(
      'https://cdn.jsdelivr.net/npm/@emoji-mart/data',
    )

    return response.json()
  }
})
</code>```

I also tried using Next.js dynamic imports but I think they only support local components as of now. The other solution I have in mind is to stringify the entire HTML and then dangerously set the inner HTML but that seems like a very hacky way to do it.

Body:
I am using an emoji picker npm package. The package size is quite large ~25Kbs (minified + gzipped) which is why I want to dynamically fetch it only when required, to not increase my bundle size and initial load time.

If you scroll a bit in the docs, you'll find a way to dynamically fetch it using a CDN (snippet below). This returns an HTML element. The problem with React is that we cannot render objects as children. I'd like to understand how to dynamically fetch this component and render it.

import { Picker } from 'emoji-mart'
new Picker({
  data: async () => {
    const response = await fetch(
      'https://cdn.jsdelivr.net/npm/@emoji-mart/data',
    )

    return response.json()
  }
})

I also tried using Next.js dynamic imports but I think they only support local components as of now. The other solution I have in mind is to stringify the entire HTML and then dangerously set the inner HTML but that seems like a very hacky way to do it.


问:
Arcgis & Python: Azure YAML pipeline fails with "Command 'krb5-config --libs gssapi' returned non-zero exit status 127."
I am deploying my Python code to an Azure Function with Python runtime 3.9, using the following yaml pipeline:

trigger:
  branches:
    include:
      - dev
      - test
      - uat
      - prod

pool:
  vmImage: ubuntu-latest

stages:
- stage: Build
  displayName: Build stage
  condition: always()
  jobs:
  - job: Build_Stage
    displayName: Build Stage
    steps:

    #Define Python Version
    - task: UsePythonVersion@0
      displayName: "Setting Python version to 3.9"
      inputs:
        versionSpec: '3.9'
        architecture: 'x64'

    #Install Python packages
    - bash: |
        if [ -f extensions.csproj ]
        then
            dotnet build extensions.csproj --output ./bin
        fi
        pip install --target="./.python_packages/lib/site-packages" -r ./requirements.txt
      displayName: 'Install Python packages in venv'

    #Archive files to create zip folder for the build
    - task: ArchiveFiles@2
      displayName: 'Archive files to create zip folder for the build'
      inputs:
            rootFolderOrFile: '$(Build.SourcesDirectory)' #Change to '$(Build.SourcesDirectory)/FolderNameWithFunctionAppInside' if a new parent folder is added
            includeRootFolder: false
            archiveType: 'zip'
            archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
            replaceExistingArchive: true

    #Publish zip to Azure Pipeline
    - task: PublishPipelineArtifact@1
      displayName: 'Publish zip Package to Azure Pipeline'
      inputs:
        targetPath: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
        artifactName: $(artifactName)
        artifactType: 'pipeline'

#Deploy to DEV
- stage: DEV
  displayName: Deploy to DEV
  dependsOn: Build
  variables:
  - group: <my-variable-group>
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
  jobs:
  - job: Deploy
    steps:

      #Download artifact to make it available to this stage
      - task: DownloadPipelineArtifact@2
        inputs:
          source: 'current'
          path: '$(Pipeline.Workspace)'

      #Deploy
      - task: AzureFunctionApp@1
        displayName: Deploy Linux function app
        inputs:
          azureSubscription: $(azureRmConnection.Id)
          appType: 'functionAppLinux'
          appName: $(functionAppName)
          package: '$(Pipeline.Workspace)/**/*.zip'
          deploymentMethod: auto

#Deploy to TEST
- stage: TEST
  displayName: Deploy to TEST
  dependsOn: Build
  variables:
  - group: <my-variable-group>
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/test'))
  jobs:
  - job: Deploy
    steps:

      #Download artifact to make it available to this stage
      - task: DownloadPipelineArtifact@2
        inputs:
          source: 'current'
          path: '$(Pipeline.Workspace)'

      #Deploy
      - task: AzureFunctionApp@1
        displayName: Deploy Linux function app
        inputs:
          azureSubscription: $(azureRmConnection.Id)
          appType: 'functionAppLinux'
          appName: $(functionAppName)
          package: '$(Pipeline.Workspace)/**/*.zip'
          deploymentMethod: auto

#Deploy to UAT
- stage: UAT
  displayName: Deploy to UAT
  dependsOn: Build
  variables:
  - group: <my-variable-group>
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/uat'))
  jobs:
  - job: Deploy
    steps:

      #Download artifact to make it available to this stage
      - task: DownloadPipelineArtifact@2
        inputs:
          source: 'current'
          path: '$(Pipeline.Workspace)'

      #Deploy
      - task: AzureFunctionApp@1
        displayName: Deploy Linux function app
        inputs:
          azureSubscription: $(azureRmConnection.Id)
          appType: 'functionAppLinux'
          appName: $(functionAppName)
          package: '$(Pipeline.Workspace)/**/*.zip'
          deploymentMethod: auto

#Deploy to PROD
- stage: PROD
  displayName: Deploy to PROD
  dependsOn: Build
  variables:
  - group: <my-variable-group>
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/prod'))
  jobs:
  - job: Deploy
    steps:

      #Download artifact to make it available to this stage
      - task: DownloadPipelineArtifact@2
        inputs:
          source: 'current'
          path: '$(Pipeline.Workspace)'

      #Deploy
      - task: AzureFunctionApp@1
        displayName: Deploy Linux function app
        inputs:
          azureSubscription: $(azureRmConnection.Id)
          appType: 'functionAppLinux'
          appName: $(functionAppName)
          package: '$(Pipeline.Workspace)/**/*.zip'
          deploymentMethod: auto
```
<p>When I trigger this pipeline, my build stage fails with an error message pointing at <code>krb5-config</code>:</p>
<pre class="lang-bash prettyprint-override"><code>
        File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
          main()
        File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-j844587_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-j844587_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-j844587_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 109, in <module>
        File "<string>", line 22, in get_output
        File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/subprocess.py", line 424, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
        File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/subprocess.py", line 528, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command 'krb5-config --libs gssapi' returned non-zero exit status 127.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
##[error]Bash exited with code '1'.
</code>```

Is there a way I can fix this?

EDIT

The requirements are as follows:

pip==22.3.1
azure-functions
azure-functions-durable
datetime
requests==2.28.1
arcgis==2.0.1
openpyxl==3.0.10
numpy
```

Body:
I am deploying my Python code to an Azure Function with Python runtime 3.9, using the following yaml pipeline:

trigger:
  branches:
    include:
      - dev
      - test
      - uat
      - prod

pool:
  vmImage: ubuntu-latest

stages:
- stage: Build
  displayName: Build stage
  condition: always()
  jobs:
  - job: Build_Stage
    displayName: Build Stage
    steps:

    #Define Python Version
    - task: UsePythonVersion@0
      displayName: "Setting Python version to 3.9"
      inputs:
        versionSpec: '3.9'
        architecture: 'x64'

    #Install Python packages
    - bash: |
        if [ -f extensions.csproj ]
        then
            dotnet build extensions.csproj --output ./bin
        fi
        pip install --target="./.python_packages/lib/site-packages" -r ./requirements.txt
      displayName: 'Install Python packages in venv'

    #Archive files to create zip folder for the build
    - task: ArchiveFiles@2
      displayName: 'Archive files to create zip folder for the build'
      inputs:
            rootFolderOrFile: '$(Build.SourcesDirectory)' #Change to '$(Build.SourcesDirectory)/FolderNameWithFunctionAppInside' if a new parent folder is added
            includeRootFolder: false
            archiveType: 'zip'
            archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
            replaceExistingArchive: true

    #Publish zip to Azure Pipeline
    - task: PublishPipelineArtifact@1
      displayName: 'Publish zip Package to Azure Pipeline'
      inputs:
        targetPath: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
        artifactName: $(artifactName)
        artifactType: 'pipeline'

#Deploy to DEV
- stage: DEV
  displayName: Deploy to DEV
  dependsOn: Build
  variables:
  - group: <my-variable-group>
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
  jobs:
  - job: Deploy
    steps:

      #Download artifact to make it available to this stage
      - task: DownloadPipelineArtifact@2
        inputs:
          source: 'current'
          path: '$(Pipeline.Workspace)'

      #Deploy
      - task: AzureFunctionApp@1
        displayName: Deploy Linux function app
        inputs:
          azureSubscription: $(azureRmConnection.Id)
          appType: 'functionAppLinux'
          appName: $(functionAppName)
          package: '$(Pipeline.Workspace)/**/*.zip'
          deploymentMethod: auto

#Deploy to TEST
- stage: TEST
  displayName: Deploy to TEST
  dependsOn: Build
  variables:
  - group: <my-variable-group>
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/test'))
  jobs:
  - job: Deploy
    steps:

      #Download artifact to make it available to this stage
      - task: DownloadPipelineArtifact@2
        inputs:
          source: 'current'
          path: '$(Pipeline.Workspace)'

      #Deploy
      - task: AzureFunctionApp@1
        displayName: Deploy Linux function app
        inputs:
          azureSubscription: $(azureRmConnection.Id)
          appType: 'functionAppLinux'
          appName: $(functionAppName)
          package: '$(Pipeline.Workspace)/**/*.zip'
          deploymentMethod: auto

#Deploy to UAT
- stage: UAT
  displayName: Deploy to UAT
  dependsOn: Build
  variables:
  - group: <my-variable-group>
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/uat'))
  jobs:
  - job: Deploy
    steps:

      #Download artifact to make it available to this stage
      - task: DownloadPipelineArtifact@2
        inputs:
          source: 'current'
          path: '$(Pipeline.Workspace)'

      #Deploy
      - task: AzureFunctionApp@1
        displayName: Deploy Linux function app
        inputs:
          azureSubscription: $(azureRmConnection.Id)
          appType: 'functionAppLinux'
          appName: $(functionAppName)
          package: '$(Pipeline.Workspace)/**/*.zip'
          deploymentMethod: auto

#Deploy to PROD
- stage: PROD
  displayName: Deploy to PROD
  dependsOn: Build
  variables:
  - group: <my-variable-group>
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/prod'))
  jobs:
  - job: Deploy
    steps:

      #Download artifact to make it available to this stage
      - task: DownloadPipelineArtifact@2
        inputs:
          source: 'current'
          path: '$(Pipeline.Workspace)'

      #Deploy
      - task: AzureFunctionApp@1
        displayName: Deploy Linux function app
        inputs:
          azureSubscription: $(azureRmConnection.Id)
          appType: 'functionAppLinux'
          appName: $(functionAppName)
          package: '$(Pipeline.Workspace)/**/*.zip'
          deploymentMethod: auto

When I trigger this pipeline, my build stage fails with an error message pointing at krb5-config:

        File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
          main()
        File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-j844587_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-j844587_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-j844587_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 109, in <module>
        File "<string>", line 22, in get_output
        File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/subprocess.py", line 424, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
        File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/subprocess.py", line 528, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command 'krb5-config --libs gssapi' returned non-zero exit status 127.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
##[error]Bash exited with code '1'.

Is there a way I can fix this?

EDIT

The requirements are as follows:

pip==22.3.1
azure-functions
azure-functions-durable
datetime
requests==2.28.1
arcgis==2.0.1
openpyxl==3.0.10
numpy


问:
How can I include my following SASS code mixin in my SAAS class property?
I want to include display property from the variables.scss in below x.scss file where I have placed as a question mark. With class name alone it's working fine. But I want to include as css property. I really don't know how can I include it.

```<code> $displayProps: (
    'block',
    'inline-block',
    'inline',
    'flex',
    'grid',
    'inline-flex',
    'inline-grid',
    'table',
    'inline-table',
    'list-item',
    'none',
    'contents'
);

@each $disp in $displayProps {
 .display--#{$disp} {
 display: #{$disp} !important;
  }
 }

.x{
 background: $white-color;
  border-bottom: 1px solid $gray-light-color;
  padding: 14px 24px;
  display: ?;
}
</code>```

Thanks in advance.

Body:
I want to include display property from the variables.scss in below x.scss file where I have placed as a question mark. With class name alone it's working fine. But I want to include as css property. I really don't know how can I include it.

 $displayProps: (
    'block',
    'inline-block',
    'inline',
    'flex',
    'grid',
    'inline-flex',
    'inline-grid',
    'table',
    'inline-table',
    'list-item',
    'none',
    'contents'
);

@each $disp in $displayProps {
 .display--#{$disp} {
 display: #{$disp} !important;
  }
 }

.x{
 background: $white-color;
  border-bottom: 1px solid $gray-light-color;
  padding: 14px 24px;
  display: ?;
}

Thanks in advance.


问:
Android native build error. clang++: error: unknown argument: '-fconcepts-ts'
I am using code where auto is used for function. It compiles well on gcc compiler on linux machine. When I using the same function in android native, it is throwing the error

clang++: error: unknown argument: '-fconcepts-ts'

-fconcepts-ts is optional on linux machine as without it , we only get a warning.
But for android native build, I am not understanding where to fix this.

I updated build.gradle to reflect the cppflags for c++17
cppFlags '-std=c++17'
However, it is not recognizing the -fconcepts-ts flag at all.

Please help.