问:
How to inline radio buttons in a django form?
Here's the radio buttons:

```<code>account_type = forms.ChoiceField(
    choices=enumerate(('Choice 1', 'Choice 2')),
    widget=forms.RadioSelect(
        {'class': 'form-check form-check-inline', 'style': 'margin-left: 20px'}
    ),
    label='',
)
</code>```

I'm using bootstrap-nightshade for styling which possibly contains something that prevents inlining the buttons. So far I tried:

```<code>display: inline
</code>```

and

```<code>display: inline-block;
</code>```

and

```<code>class="radio-inline"
</code>```

Nothing works. Here's the template of the form

```<code>{% extends 'index.html' %}
{% load bootstrap5 %}

{% block content %}
    <section class="h-100">
        <div class="container h-100">
            <div class="row justify-content-sm-center h-100">
                <div class="col-xxl-4 col-xl-5 col-lg-5 col-md-7 col-sm-9">
                    <div class="card shadow-lg">
                        <div class="card-body p-5">
                            <h4>{{ form_title }}</h4>
                            <form method="post">
                                {% csrf_token %}
                                {% bootstrap_form form %}
                                <button class="btn btn-success">{{ form_title }}</button>
                                {% if form_title == 'Sign in' %}
                                    <a style="margin-left: 15px" href={% url 'reset-password' %}>Forgot password?</a>
                                {% endif %}
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
{% endblock %}
</code>```

and here's how they are rendered:

```<code><div class="mb-3">
    <div class="form-check form-check-inline" id="id_choices">
        <div>
            <label for="id_choices_0"><input class="form-check form-check-inline" id="id_choices_0"
                                                  name="choices" required="" style="margin-left: 20px" title=""
                                                  type="radio" value="0">
                Choice 1</label>
        </div>
        <div>
            <label for="id_choices_1"><input class="form-check form-check-inline" id="id_choices_1"
                                                  name="choices" required="" style="margin-left: 20px" title=""
                                                  type="radio" value="1">
                Choice 2</label>
        </div>
    </div>
</div>
</code>```

Body:
Here's the radio buttons:

account_type = forms.ChoiceField(
    choices=enumerate(('Choice 1', 'Choice 2')),
    widget=forms.RadioSelect(
        {'class': 'form-check form-check-inline', 'style': 'margin-left: 20px'}
    ),
    label='',
)

I'm using bootstrap-nightshade for styling which possibly contains something that prevents inlining the buttons. So far I tried:

display: inline

and

display: inline-block;

and

class="radio-inline"

Nothing works. Here's the template of the form

{% extends 'index.html' %}
{% load bootstrap5 %}

{% block content %}

{{ form_title }}

                            <form method="post">
                                {% csrf_token %}
                                {% bootstrap_form form %}
                                <button class="btn btn-success">{{ form_title }}</button>
                                {% if form_title == 'Sign in' %}
                                    Forgot password?
                                {% endif %}
                            </form>

{% endblock %}

and here's how they are rendered:

            <input class="form-check form-check-inline" id="id_choices_0"
                                                  name="choices" required="" style="margin-left: 20px" title=""
                                                  type="radio" value="0">
                Choice 1

            <input class="form-check form-check-inline" id="id_choices_1"
                                                  name="choices" required="" style="margin-left: 20px" title=""
                                                  type="radio" value="1">
                Choice 2


来源: stackexchange

问:
How to check that DNS hijacking happened in next.js?
In my next.js website I want to show a UI alert to an end user if DNS hijacking happened and client side code was modified by the attacker.

So the idea is the following:

On website build add "UI hash" of the project build somewhere in js.

On website load calculate "UI hash" and compare with the one provided from the build. If they are not equal then show alert like "Phishing attempt".

I understand that this UI check can be easily bypassed by the attacker with enough reverse engineering efforts.

Are there any better ways to prevent DNS hijacking on the UI side?

ContentLicense: CC BY-SA 4.0


问:
how to show on-screen keyboard in playwright webkit
I'm trying to make playwright webkit show on-screen keyboard for testing due to some layout issues.

Is there any flags/params I can set to make webkit show on-screen keyboard when I click a text-input?

(or is this only available in android-emulation?)

thank you!

I looked at playwright docs / typescript definitions, but couldn't find one related to 'show on-screen keyboard'


问:
validate one dynamic field on the basis of dynamic checkbox in vue using yup
I am using composition api in vue, I have dynamic fields what i want to is to validate one dynamic field on the basis of other dynamic field with yup

this is dynamic field one

```<code><Field
 type="checkbox"
 class="form-check-input form-check-sm "
 :name="`sku[${index}].cross_dock_check`"
 :id="`sku[${index}].cross_dock_check`"
 />
</code>```

this is my second dynamic field

```<code><Field :name="`sku[${index}].pickup_address`" v-slot="{ field }" :value="store.pickup_address_id">
 <Multiselect v-model="field.value"
 :searchable="true"
 v-bind="field"
 :options="add_sku_data.get_pickup_addresses"
 placeholder="Address"
 ></Multiselect>
 </Field>
</code>```

what i want to do is if the
checkbox[0] is checked then the pickup_address[0]
checkbox[1] is checked then the pickup_address[1]
is required and so on, this is my validator

```<code> const orderbookingformValidator = Yup.object().shape({
                order_type: Yup.number().required().typeError("Order Type is required"),
                courier_type: Yup.number().required().typeError("Courier Type is required"),
                //sku_courier: Yup.number().required().typeError("Courier Type is required"),
                city: Yup.number().required().typeError("City is required"),
                consignee_name: Yup.string().required().label("Name"),
                select_shipping: Yup.string().when("order_type", {
                    is: value => value == 5 || value == 6,
                    then: Yup.string().required().label("Shipping"),
                }),

                email: Yup.string().required().label("Email").email(),
                address: Yup.string().required().label("Address"),
                phone_number: Yup.string().required().label("Phone Number"),
                phone_number2: Yup.string().required().label("Phone Number # 2"),
                cod_amount: Yup.number().required().label("COD Amount"),
                shipping_mode: Yup.number().required().label("Shipping Mode"),
                courier_charges_mode: Yup.number().required().label("Courier Charges Mode"),
                order_id: Yup.string().required().label("Order ID"),
                spacial_instruction: Yup.string().required().label("Spacial Instruction"),
                packaging_instructions: Yup.string().required().label("Packaging Instruction"),
                product_counter: Yup.number().required().min(1, "At least one product is required"),

            });
</code>```

so how should i be able to add condition , that address is required only if the checkbox is checked

I know that

```<code>const schema = Yup.object().shape({
 checkboxName: Yup.boolean(),
 address: Yup.string().when("checkboxName", {
 is: true,
 then: Yup.string().required("Address is required."),
 }),
});
</code>```

works for the single field validation , but how to do it for dynamic fields?

Body:
I am using composition api in vue, I have dynamic fields what i want to is to validate one dynamic field on the basis of other dynamic field with yup

this is dynamic field one

<Field
 type="checkbox"
 class="form-check-input form-check-sm "
 :name="`sku[${index}].cross_dock_check`"
 :id="`sku[${index}].cross_dock_check`"
 />

this is my second dynamic field

<Field :name="`sku[${index}].pickup_address`" v-slot="{ field }" :value="store.pickup_address_id">
 <Multiselect v-model="field.value"
 :searchable="true"
 v-bind="field"
 :options="add_sku_data.get_pickup_addresses"
 placeholder="Address"
 ></Multiselect>
 </Field>

what i want to do is if the
checkbox[0] is checked then the pickup_address[0]
checkbox[1] is checked then the pickup_address[1]
is required and so on, this is my validator

 const orderbookingformValidator = Yup.object().shape({
                order_type: Yup.number().required().typeError("Order Type is required"),
                courier_type: Yup.number().required().typeError("Courier Type is required"),
                //sku_courier: Yup.number().required().typeError("Courier Type is required"),
                city: Yup.number().required().typeError("City is required"),
                consignee_name: Yup.string().required().label("Name"),
                select_shipping: Yup.string().when("order_type", {
                    is: value => value == 5 || value == 6,
                    then: Yup.string().required().label("Shipping"),
                }),

                email: Yup.string().required().label("Email").email(),
                address: Yup.string().required().label("Address"),
                phone_number: Yup.string().required().label("Phone Number"),
                phone_number2: Yup.string().required().label("Phone Number # 2"),
                cod_amount: Yup.number().required().label("COD Amount"),
                shipping_mode: Yup.number().required().label("Shipping Mode"),
                courier_charges_mode: Yup.number().required().label("Courier Charges Mode"),
                order_id: Yup.string().required().label("Order ID"),
                spacial_instruction: Yup.string().required().label("Spacial Instruction"),
                packaging_instructions: Yup.string().required().label("Packaging Instruction"),
                product_counter: Yup.number().required().min(1, "At least one product is required"),

            });

so how should i be able to add condition , that address is required only if the checkbox is checked

I know that

const schema = Yup.object().shape({
 checkboxName: Yup.boolean(),
 address: Yup.string().when("checkboxName", {
 is: true,
 then: Yup.string().required("Address is required."),
 }),
});

works for the single field validation , but how to do it for dynamic fields?


问:
problems with setuptools while setting up trac on remote system without internet connection
I am trying to set up trac on a remote system running Fedora 12 that doesn't have an internet connection. So, I am copying all files from my system with the internet connection to that system and trying to install from source on that system.

When I run

```<code> python ./setup.py install
</code>```

I get this:

```<code>Traceback (most recent call last):
  File "./setup.py", line 17, in <module>
   from setuptools import setup, find_packages
ImportError: No module named setuptools
</code>```

I tried installing setuptools from source. I downloaded setuptools-0.6c11-1.src.rpm and ran

```<code>rpm -i setuptools-0.6c11-1.src.rpm
</code>```

but I get the following warnings and nothing seems to happen:

```<code>warning: user pje does not exist - using root
warning: group pje does not exist - using root
warning: user pje does not exist - using root
warning: group pje does not exist - using root
</code>```

How do I proceed?

ContentLicense: CC BY-SA 3.0

Body:
I am trying to set up trac on a remote system running Fedora 12 that doesn't have an internet connection. So, I am copying all files from my system with the internet connection to that system and trying to install from source on that system.

When I run

 python ./setup.py install

I get this:

Traceback (most recent call last):
  File "./setup.py", line 17, in <module>
   from setuptools import setup, find_packages
ImportError: No module named setuptools

I tried installing setuptools from source. I downloaded setuptools-0.6c11-1.src.rpm and ran

rpm -i setuptools-0.6c11-1.src.rpm

but I get the following warnings and nothing seems to happen:

warning: user pje does not exist - using root
warning: group pje does not exist - using root
warning: user pje does not exist - using root
warning: group pje does not exist - using root

How do I proceed?


问:
React Navigation, React native, Nested Navigator, Want to Navigate to root of stack
I have a nested navigator, Drawer navigator then stack navigator,
When user is on a screen on the home stack, other than the root screen of the home stack, when user opens drawer and click on Home, it should redirect to the root of the home stack.
How can I achieve this?

Below is code for my drawer navigator and Home stack

drawer:

```<code>import {
  createDrawerNavigator,
  DrawerItemList,
} from "@react-navigation/drawer";
import Bg from "../../assets/background.png";
import { NavigationContainer } from "@react-navigation/native";
import Home from "../screens/home";
import { ImageBackground, SafeAreaView, Text, View } from "react-native";
import HomeStack from "./homeStack";
import { SafeAreaProvider } from 'react-native-safe-area-context';
import SongStack from "./songStack";
import SearchStack from "./searchStack";
import ContactUsStack from "./contactUsStack";
import HelpStack from "./helpStack";
import VolunteerStack from "./volunteerStack";

const CustomDrawerContentComponent = (props) => (
  <ImageBackground style={{ flex: 1, resizeMode: "cover" }} source={Bg}>
    <View
      style={{
        backgroundColor: "rgba(59, 82, 88,0.65)",
        width: "100%",
        height: "100%",
      }}
    >
      <SafeAreaView>
        <View style={{ height: "10%" }}></View>
        <DrawerItemList {...props} />
      </SafeAreaView>
      <Text
        style={{ position: "absolute", bottom: 1, left: 1, color: "#ffffff" }}
      >
        Copyright © Songs Of Zion v4.1.1 {new Date().getFullYear()}
      </Text>
    </View>
  </ImageBackground>
);

const Drawer = createDrawerNavigator();

export default function Draweri() {
  return (
<SafeAreaProvider>
    <NavigationContainer>
      <Drawer.Navigator
        drawerContent={(props) => <CustomDrawerContentComponent {...props} />}
        screenOptions={{
            unmountOnBlur:true,
          headerShown: false,
          drawerItemStyle: {
            borderColor: "white",
            borderBottomWidth: 1.5,
          },
          drawerActiveTintColor: "#ffffff",
          drawerInactiveTintColor: "#ffffff",
          drawerActiveBackgroundColor: "rgba(59, 82, 88,0.7)",
          drawerLabelStyle: {
            fontSize: 18,
            marginLeft: 20,
            marginTop: 20,
            marginBottom: 20,
          },
        }}
      >
          <Drawer.Screen name="DHome" options={{title:"Home"}} component={HomeStack} />
          <Drawer.Screen name="Song" component={SongStack} />
          <Drawer.Screen name="Search" options={{unmountOnBlur: true}} component={SearchStack} />
          <Drawer.Screen name="ContactUs"options={{title:"Contact Us"}} component={ContactUsStack} />
          <Drawer.Screen name="Help" component={HelpStack} />
          <Drawer.Screen name="Volunteer" component={VolunteerStack} />

      </Drawer.Navigator>
    </NavigationContainer>
    </SafeAreaProvider>
  );
}
</code>```

Home Stack:

```<code>import { createNativeStackNavigator } from "@react-navigation/native-stack";
import Home from "../screens/home";
import SearchResults from "../shared/screens/search/searchResults";
import Header from "../shared/header";
import Search from "../screens/search";
import Sync from "../screens/home/sync";
import Song from "../shared/screens/song";

const Stack = createNativeStackNavigator();

export default function HomeStack(navigation) {
  return (
    <Stack.Navigator>
      <Stack.Screen
        name="Home"
        component={Home}
        options={{ headerShown: false }}
      />
        <Stack.Screen name="SearchResults" component={SearchResults} options={{header: ({navigation}) => <Header navigation={navigation} title={"Search Results"} pop={true}  />}}/>
        <Stack.Screen name="SongLyrics" component={Song} options={{header: ({navigation}) => <Header navigation={navigation} title={"Song Lyrics"} pop={true} replace={true} />}}/>
        <Stack.Screen name="Search" component={Search} options={{header: ({navigation}) => <Header navigation={navigation} title={"Search"} pop={true}/>}}/>
        <Stack.Screen name="BookSongLyrics" component={Song} options={{header: ({navigation}) => <Header navigation={navigation} title={"Song Lyrics"} pop={true}/>}}/>

        <Stack.Screen name="Sync" component={Sync}         options={{ headerShown: false }}

        />
    </Stack.Navigator>
  );
}
</code>```

I have tried:

```<code> <Drawer.Screen
        name="Home"
        component={HomeStack}
        options={{
          drawerLabel: 'Home',
          // This will be called when the home button is pressed in the drawer
          onPress: ({ navigation }) => {
            // Reset the home stack to the 'Home' screen
            navigation.reset({
              index: 0,
              routes: [{ name: 'Home' }],
            });
          },
        }}
      />
</code>```

....

```<code>function Home({ navigation }) {
  useFocusEffect(
    React.useCallback(() => {
      // Reset the home stack to the 'Home' screen when the 'Home' screen becomes the focused screen
      navigation.reset({
        index: 0,
        routes: [{ name: 'Home' }],
      });
    }, [navigation])
  );

  // Other component code
}
</code>```

...

```<code>function App() {
  return (
    <Drawer.Navigator>
      <Drawer.Screen
        name="DHome"
        component={HomeStack}
        options={{
          title: 'Home',
          // This will be called when the home button is pressed in the drawer
          onPress: ({ navigation }) => {
            // Navigate to the Home screen
            navigation.navigate('Home');
          },
        }}
      />
      {/* Other screens in the drawer navigator */}
    </Drawer.Navigator>
  );
}

</code>```

...

```<code>const CustomDrawerContentComponent = (props) => {
  const { navigation } = props;

  return (
    <View>
      <DrawerItemList
        {...props}
        onItemPress={({ route, focused }) => {
          if (route.name === 'DHome') {
            // Navigate to the root screen of the home stack when the home button is pressed
            navigation.navigate('Home');
          } else {
            // Navigate to the pressed screen for other buttons
            navigation.navigate(route.name);
          }
        }}
      />
    </View>
  );
};

const Drawer = createDrawerNavigator();

function App() {
  return (
    <Drawer.Navigator
      drawerContent={(props) => <CustomDrawerContentComponent {...props} />}
    >
      <Drawer.Screen name="DHome" component={HomeStack} />
      {/* Other screens in the drawer navigator */}
    </Drawer.Navigator>
  );
}
</code>```

...

```<code>import { NavigationContainer } from '@react-navigation/native';

const Drawer = createDrawerNavigator();

function MyDrawer({ navigation }) {
  return (
    <NavigationContainer
      onNavigationStateChange={(prevState, currentState) => {
        const currentRouteName = currentState.routes[currentState.index].name;

        if (currentRouteName === 'Home') {
          // Navigate to the root screen of the home stack when the home button is pressed
          navigation.navigate('Home');
        } else {
          // Navigate to the pressed screen for other buttons
          navigation.navigate(currentRouteName);
        }
      }}
    >
      <Drawer.Navigator>
        <Drawer.Screen name="Home" component={HomeStack} />
        <Drawer.Screen name="Song" component={SongStack} />
        <Drawer.Screen name="Search" component={SearchStack} />
        <Drawer.Screen name="ContactUs" component={ContactUsStack} />
        <Drawer.Screen name="Help" component={HelpStack} />
        <Drawer.Screen name="Volunteer" component={VolunteerStack} />
      </Drawer.Navigator>
    </NavigationContainer>
  );
}

</code>```

Body:
I have a nested navigator, Drawer navigator then stack navigator,
When user is on a screen on the home stack, other than the root screen of the home stack, when user opens drawer and click on Home, it should redirect to the root of the home stack.
How can I achieve this?

Below is code for my drawer navigator and Home stack

drawer:

import {
  createDrawerNavigator,
  DrawerItemList,
} from "@react-navigation/drawer";
import Bg from "../../assets/background.png";
import { NavigationContainer } from "@react-navigation/native";
import Home from "../screens/home";
import { ImageBackground, SafeAreaView, Text, View } from "react-native";
import HomeStack from "./homeStack";
import { SafeAreaProvider } from 'react-native-safe-area-context';
import SongStack from "./songStack";
import SearchStack from "./searchStack";
import ContactUsStack from "./contactUsStack";
import HelpStack from "./helpStack";
import VolunteerStack from "./volunteerStack";

const CustomDrawerContentComponent = (props) => (
  <ImageBackground style={{ flex: 1, resizeMode: "cover" }} source={Bg}>
    <View
      style={{
        backgroundColor: "rgba(59, 82, 88,0.65)",
        width: "100%",
        height: "100%",
      }}
    >
      <SafeAreaView>
        <View style={{ height: "10%" }}></View>
        <DrawerItemList {...props} />
      </SafeAreaView>
      <Text
        style={{ position: "absolute", bottom: 1, left: 1, color: "#ffffff" }}
      >
        Copyright © Songs Of Zion v4.1.1 {new Date().getFullYear()}
      </Text>
    </View>
  </ImageBackground>
);

const Drawer = createDrawerNavigator();

export default function Draweri() {
  return (
<SafeAreaProvider>
    <NavigationContainer>
      <Drawer.Navigator
        drawerContent={(props) => <CustomDrawerContentComponent {...props} />}
        screenOptions={{
            unmountOnBlur:true,
          headerShown: false,
          drawerItemStyle: {
            borderColor: "white",
            borderBottomWidth: 1.5,
          },
          drawerActiveTintColor: "#ffffff",
          drawerInactiveTintColor: "#ffffff",
          drawerActiveBackgroundColor: "rgba(59, 82, 88,0.7)",
          drawerLabelStyle: {
            fontSize: 18,
            marginLeft: 20,
            marginTop: 20,
            marginBottom: 20,
          },
        }}
      >
          <Drawer.Screen name="DHome" options={{title:"Home"}} component={HomeStack} />
          <Drawer.Screen name="Song" component={SongStack} />
          <Drawer.Screen name="Search" options={{unmountOnBlur: true}} component={SearchStack} />
          <Drawer.Screen name="ContactUs"options={{title:"Contact Us"}} component={ContactUsStack} />
          <Drawer.Screen name="Help" component={HelpStack} />
          <Drawer.Screen name="Volunteer" component={VolunteerStack} />

      </Drawer.Navigator>
    </NavigationContainer>
    </SafeAreaProvider>
  );
}

Home Stack:

import { createNativeStackNavigator } from "@react-navigation/native-stack";
import Home from "../screens/home";
import SearchResults from "../shared/screens/search/searchResults";
import Header from "../shared/header";
import Search from "../screens/search";
import Sync from "../screens/home/sync";
import Song from "../shared/screens/song";

const Stack = createNativeStackNavigator();

export default function HomeStack(navigation) {
  return (
    <Stack.Navigator>
      <Stack.Screen
        name="Home"
        component={Home}
        options={{ headerShown: false }}
      />
        <Stack.Screen name="SearchResults" component={SearchResults} options={{header: ({navigation}) => }}/>
        <Stack.Screen name="SongLyrics" component={Song} options={{header: ({navigation}) => }}/>
        <Stack.Screen name="Search" component={Search} options={{header: ({navigation}) => }}/>
        <Stack.Screen name="BookSongLyrics" component={Song} options={{header: ({navigation}) => }}/>

        <Stack.Screen name="Sync" component={Sync}         options={{ headerShown: false }}

        />
    </Stack.Navigator>
  );
}

I have tried:

 <Drawer.Screen
        name="Home"
        component={HomeStack}
        options={{
          drawerLabel: 'Home',
          // This will be called when the home button is pressed in the drawer
          onPress: ({ navigation }) => {
            // Reset the home stack to the 'Home' screen
            navigation.reset({
              index: 0,
              routes: [{ name: 'Home' }],
            });
          },
        }}
      />

....

function Home({ navigation }) {
  useFocusEffect(
    React.useCallback(() => {
      // Reset the home stack to the 'Home' screen when the 'Home' screen becomes the focused screen
      navigation.reset({
        index: 0,
        routes: [{ name: 'Home' }],
      });
    }, [navigation])
  );

  // Other component code
}

...

function App() {
  return (
    <Drawer.Navigator>
      <Drawer.Screen
        name="DHome"
        component={HomeStack}
        options={{
          title: 'Home',
          // This will be called when the home button is pressed in the drawer
          onPress: ({ navigation }) => {
            // Navigate to the Home screen
            navigation.navigate('Home');
          },
        }}
      />
      {/* Other screens in the drawer navigator */}
    </Drawer.Navigator>
  );
}

...

const CustomDrawerContentComponent = (props) => {
  const { navigation } = props;

  return (
    <View>
      <DrawerItemList
        {...props}
        onItemPress={({ route, focused }) => {
          if (route.name === 'DHome') {
            // Navigate to the root screen of the home stack when the home button is pressed
            navigation.navigate('Home');
          } else {
            // Navigate to the pressed screen for other buttons
            navigation.navigate(route.name);
          }
        }}
      />
    </View>
  );
};

const Drawer = createDrawerNavigator();

function App() {
  return (
    <Drawer.Navigator
      drawerContent={(props) => <CustomDrawerContentComponent {...props} />}
    >
      <Drawer.Screen name="DHome" component={HomeStack} />
      {/* Other screens in the drawer navigator */}
    </Drawer.Navigator>
  );
}

...

import { NavigationContainer } from '@react-navigation/native';

const Drawer = createDrawerNavigator();

function MyDrawer({ navigation }) {
  return (
    <NavigationContainer
      onNavigationStateChange={(prevState, currentState) => {
        const currentRouteName = currentState.routes[currentState.index].name;

        if (currentRouteName === 'Home') {
          // Navigate to the root screen of the home stack when the home button is pressed
          navigation.navigate('Home');
        } else {
          // Navigate to the pressed screen for other buttons
          navigation.navigate(currentRouteName);
        }
      }}
    >
      <Drawer.Navigator>
        <Drawer.Screen name="Home" component={HomeStack} />
        <Drawer.Screen name="Song" component={SongStack} />
        <Drawer.Screen name="Search" component={SearchStack} />
        <Drawer.Screen name="ContactUs" component={ContactUsStack} />
        <Drawer.Screen name="Help" component={HelpStack} />
        <Drawer.Screen name="Volunteer" component={VolunteerStack} />
      </Drawer.Navigator>
    </NavigationContainer>
  );
}


问:
Implement Angular CDK Virtual Scroll Errors
I have weird issue with Angular CDK Virtual Scroll. I have implemented a virtual scroll and during scrolling this below error occurs in random time:

I have tried to use this properties but do not work for me

```<code> itemSize="50" minBufferPx="100" maxBufferPx="1000"
</code>```

Libs verions:

```<code>"@angular/cdk": "14.2.7",
</code>```
```<code>"@angular/material": "14.2.7",
</code>```

No errors. Questions: Why it happens?

Body:
I have weird issue with Angular CDK Virtual Scroll. I have implemented a virtual scroll and during scrolling this below error occurs in random time:

I have tried to use this properties but do not work for me

 itemSize="50" minBufferPx="100" maxBufferPx="1000"

Libs verions:

"@angular/cdk": "14.2.7",

"@angular/material": "14.2.7",

No errors. Questions: Why it happens?


问:
How do I filter search for files in directories that are more than one layer deep?
I'm trying to search for a certain file type in a specific folder in my unity project. But the dir: filter seems to only work for the base folder.

In my case typing dir:BaseFolder works but when I type dir:BaseFolder/Sripts it doesn't.

Is there a way to filter search in nested directories in Unity?


问:
How to tweak Docusaurus webpack config for some react component?
It seems that one of my component ( https://www.npmjs.com/package/@stoplight/json-schema-viewer ) needs some tweaks in webpack with Docusaurus

Any ideas ? I tried to follow https://gist.github.com/sibelius/24f63eef7f43b15dc73c4a0be11bbef8 but it didn't work ...

Step to reproduce :

npx create-docusaurus@latest my-website classic --typescript
cd my-website
npm install @stoplight/json-schema-viewer
```
<p>Create a schema.json into static folder such as :</p>
<pre class="lang-json prettyprint-override"><code>{
  "$id": "https://example.com/person.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Person",
  "type": "object",
  "properties": {
    "firstName": {
      "type": "string",
      "description": "The person's first name."
    },
    "lastName": {
      "type": "string",
      "description": "The person's last name."
    },
    "age": {
      "description": "Age in years which must be equal to or greater than zero.",
      "type": "integer",
      "minimum": 0
    }
  }
}
</code>```

Create inside src/pages the file json_schema.tsx with :

```<code>import React, { useState, useEffect } from 'react';
import Layout from '@theme/Layout';
import useBaseUrl from '@docusaurus/useBaseUrl';
import {useColorMode} from '@docusaurus/theme-common';
import { JsonSchemaViewer } from "@stoplight/json-schema-viewer";

// docusaurus.config.js
// https://gist.github.com/sibelius/24f63eef7f43b15dc73c4a0be11bbef8

function fetchSchema(URL : string, callback : (any) => void) {
    fetch(URL, {
        method: "GET",
        headers: {
            'Accept': 'application/json'
        }
    })
    .then(response => response.json())
    .then(json => callback(json))
    .catch(err => callback(undefined));
}

export default function JSONSchema(): JSX.Element {
    const [schema, setSchema] = useState(undefined);
    const {colorMode} = useColorMode();
    const JSON_SCHEMA_URL = useBaseUrl("/schema.json");

    useEffect(() => fetchSchema(JSON_SCHEMA_URL, setSchema), []);

    return (
        <Layout
            title={`JSON Schema Viewer`}
            description={`JSON Schema for xxx`}
        >
            {
                (schema !== undefined) &&
                    <JsonSchemaViewer
                        schema={schema}
                        emptyText="No schema found"
                        defaultExpandedDepth={1}
                    />
            }
            {
                (schema === undefined ) && <div>Loading ...</div>
            }
        </Layout>
    )
}
</code>```

Thanks in advance,

Body:
It seems that one of my component ( https://www.npmjs.com/package/@stoplight/json-schema-viewer ) needs some tweaks in webpack with Docusaurus

Any ideas ? I tried to follow https://gist.github.com/sibelius/24f63eef7f43b15dc73c4a0be11bbef8 but it didn't work ...

Step to reproduce :

npx create-docusaurus@latest my-website classic --typescript
cd my-website
npm install @stoplight/json-schema-viewer

Create a schema.json into static folder such as :

{
  "$id": "https://example.com/person.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Person",
  "type": "object",
  "properties": {
    "firstName": {
      "type": "string",
      "description": "The person's first name."
    },
    "lastName": {
      "type": "string",
      "description": "The person's last name."
    },
    "age": {
      "description": "Age in years which must be equal to or greater than zero.",
      "type": "integer",
      "minimum": 0
    }
  }
}

Create inside src/pages the file json_schema.tsx with :

import React, { useState, useEffect } from 'react';
import Layout from '@theme/Layout';
import useBaseUrl from '@docusaurus/useBaseUrl';
import {useColorMode} from '@docusaurus/theme-common';
import { JsonSchemaViewer } from "@stoplight/json-schema-viewer";

// docusaurus.config.js
// https://gist.github.com/sibelius/24f63eef7f43b15dc73c4a0be11bbef8

function fetchSchema(URL : string, callback : (any) => void) {
    fetch(URL, {
        method: "GET",
        headers: {
            'Accept': 'application/json'
        }
    })
    .then(response => response.json())
    .then(json => callback(json))
    .catch(err => callback(undefined));
}

export default function JSONSchema(): JSX.Element {
    const [schema, setSchema] = useState(undefined);
    const {colorMode} = useColorMode();
    const JSON_SCHEMA_URL = useBaseUrl("/schema.json");

    useEffect(() => fetchSchema(JSON_SCHEMA_URL, setSchema), []);

    return (
        <Layout
            title={`JSON Schema Viewer`}
            description={`JSON Schema for xxx`}
        >
            {
                (schema !== undefined) &&
                    <JsonSchemaViewer
                        schema={schema}
                        emptyText="No schema found"
                        defaultExpandedDepth={1}
                    />
            }
            {
                (schema === undefined ) &&
Loading ...

            }
        </Layout>
    )
}

Thanks in advance,


问:
How would I make an Use Case Diagram without user interaction?
I've got the following problem:

Imagine I'm making a dashboard without any user input. The only time the values on the dashboard change is when webhooks in some tool get triggered or when a recurring cronjob calls a specific API endpoint to refresh data.

The user in this case only logs in and navigates to a specific page. How would I make a Use Case Diagram in this case? The user does nothing but watch, and things only change when a job is automatically ran, or externally (like a web hook).

Any ideas how I can tackle this?

What I've tried is basically making the Job Scheduler an actor, but I'm not sure if that's the right way to do things.


问:
How to exclude the Background section from the HTML report in cucumber test
I have a cucumber feature file which consists of the following

@Tag

Feature: Cost API

Background: Generate Token

Scenario 1: Call API 1
step 1
step 2

In the generated html report, background section is also reflecting.
How can I exclude/hide the background from html report.

Request help here.


问:
Raise an Event within an Excel-Addin when a Userform is loaded by the Excel Application or other Addin
I need to detect from within an excel-addin when a userform is loaded into memory without using the Initialize- or Activate-event of the loaded userform.

I'm currently trying to extend an Excel app by a translation addin to provide for the users a multilanguage GUI. Up to now, I could manage to translate on the fly all visible text-entries on (work-)sheets including comments, screentips and form- or ActiveX-controls embedded in shapes located on the sheet by passing the sheet object to a class which examines the sheet and its objects for text-entries needing translation and translate the identified text entries.

The next challenge will be to design a similar class for examination of userform-text-entries to be translated. Unfortunately, Excel does not provide a method to check upfront if and how many userforms can be loaded other than querying the VBE designer. In my case, VBE has to be locked and password protected so VBE cannot be used for querying for userforms. In addition, the Initialize and Activate events of the main application userforms should not be changed.

Due to my observations, the userforms collection is only populated when the userform is loaded and if the userform is an object of ThisWorkbook, so userforms designed within an additional addins are not part of the main application userforms collection.

The only chance I currently see, is to provide an event when a userform instance is loaded into memory causing a ThunderDFrame class window to pop up within the Excel window tree.
which then can be used for passing the userform-object to the examination routine.

Any idea how to achieve this within VBA? I assume, it might be possible by subclassing the Excel application with the API function SetWinEventHook to detect ThunderDFrame class window creation but my programming skills are not sufficient to figure this out on my own.

Any other approach is also welcome.


问:
Endpoint to access post detail on api.stackexchange site for Android
As it can be seen in the image, which endpoint did it request for class="s-prose js-post-body" class. https://api.stackexchange.com/docs I couldn't see it here, but I need to reach the post details. I would be glad if you help

API = https://api.stackexchange.com/2.3/posts/74254836?order=desc&sort=activity&site=stackoverflow

I can only access these values in post.

```<code>{
  "items": [
    {
      "owner": {
        "account_id": 10860110,
        "reputation": 180,
        "user_id": 18201304,
        "user_type": "registered",
        "profile_image": "https://i.stack.imgur.com/iyYDM.png?s=256&g=1",
        "display_name": "Vahit Keskin",
        "link": "https://stackoverflow.com/users/18201304/vahit-keskin"
      },
      "score": 0,
      "last_activity_date": 1668764569,
      "creation_date": 1667147558,
      "post_type": "question",
      "post_id": 74254836,
      "content_license": "CC BY-SA 4.0",
      "link": "https://stackoverflow.com/q/74254836"
    }
  ],
  "has_more": false,
  "quota_max": 300,
  "quota_remaining": 140
}
</code>```

Body:
As it can be seen in the image, which endpoint did it request for class="s-prose js-post-body" class. https://api.stackexchange.com/docs I couldn't see it here, but I need to reach the post details. I would be glad if you help

API = https://api.stackexchange.com/2.3/posts/74254836?order=desc&sort=activity&site=stackoverflow

I can only access these values in post.

{
  "items": [
    {
      "owner": {
        "account_id": 10860110,
        "reputation": 180,
        "user_id": 18201304,
        "user_type": "registered",
        "profile_image": "https://i.stack.imgur.com/iyYDM.png?s=256&g=1",
        "display_name": "Vahit Keskin",
        "link": "https://stackoverflow.com/users/18201304/vahit-keskin"
      },
      "score": 0,
      "last_activity_date": 1668764569,
      "creation_date": 1667147558,
      "post_type": "question",
      "post_id": 74254836,
      "content_license": "CC BY-SA 4.0",
      "link": "https://stackoverflow.com/q/74254836"
    }
  ],
  "has_more": false,
  "quota_max": 300,
  "quota_remaining": 140
}


问:
SpaCy3 UserWarning: [W030] Some entities could not be aligned in the text
A simple code to ad new NER entity:

```<code>TRAIN_DATA = [
    ("Sandra Bullock", {"entities": [(0, 13, "ACTOR")]}),
    ("Sam Neil", {"entities": [(0, 7, "ACTOR")]}),
    ("Harrison Ford", {"entities": [(0, 12, "ACTOR")]})
]
examples = []
nlp = spacy.load('en_core_web_sm')  # load existing spaCy model

for text, annots in TRAIN_DATA:
    examples.append(Example.from_dict(nlp.make_doc(text), annots))
    nlp.initialize(lambda: examples)
    for i in range(20):
        # print("Starting iteration " + str(i))
        random.shuffle(examples)
        for batch in minibatch(examples, size=8):
            nlp.update(batch)
</code>```

I keep getting warning for every example, such as:

```<code>pacy/training/iob_utils.py:141: UserWarning: [W030] Some entities could not be aligned in the text "Sandra Bullock" with entities "[(0, 13, 'ACTOR')]". Use `spacy.training.offsets_to_biluo_tags(nlp.make_doc(text), entities)` to check the alignment. Misaligned entities ('-') will be ignored during training.
  warnings.warn(
</code>```

but when I try to test as sugested in waring it turns out the the positions are not present ['O', 'O']

```<code>from spacy.training import offsets_to_biluo_tags

for text, annots in TRAIN_DATA:
    print(text + " " + str(annots))
    print(nlp.tokenizer.explain(text))
    print(offsets_to_biluo_tags(nlp.make_doc(text), entities))
</code>```

Result:

```<code>Sandra Bullock {'entities': [(0, 13, 'ACTOR')]}
[('TOKEN', 'Sandra'), ('TOKEN', 'Bullock')]
['O', 'O']
Sam Neil {'entities': [(0, 7, 'ACTOR')]}
[('TOKEN', 'Sam'), ('TOKEN', 'Neil')]
['O', 'O']
Harrison Ford {'entities': [(0, 12, 'ACTOR')]}
[('TOKEN', 'Harrison'), ('TOKEN', 'Ford')]
</code>```

How to correctly use  from the TRAIN_DATA to add custom entity 'ACTOR'  for given model so that it can be recognized with below code?:

```<code>doc = nlp("In this move the main role starring Sam Neil as the secret agent saving the world.")
for ent in doc.ents:
    print(ent.text, ent.label_)
</code>```

Body:
A simple code to ad new NER entity:

TRAIN_DATA = [
    ("Sandra Bullock", {"entities": [(0, 13, "ACTOR")]}),
    ("Sam Neil", {"entities": [(0, 7, "ACTOR")]}),
    ("Harrison Ford", {"entities": [(0, 12, "ACTOR")]})
]
examples = []
nlp = spacy.load('en_core_web_sm')  # load existing spaCy model

for text, annots in TRAIN_DATA:
    examples.append(Example.from_dict(nlp.make_doc(text), annots))
    nlp.initialize(lambda: examples)
    for i in range(20):
        # print("Starting iteration " + str(i))
        random.shuffle(examples)
        for batch in minibatch(examples, size=8):
            nlp.update(batch)

I keep getting warning for every example, such as:

pacy/training/iob_utils.py:141: UserWarning: [W030] Some entities could not be aligned in the text "Sandra Bullock" with entities "[(0, 13, 'ACTOR')]". Use `spacy.training.offsets_to_biluo_tags(nlp.make_doc(text), entities)` to check the alignment. Misaligned entities ('-') will be ignored during training.
  warnings.warn(

but when I try to test as sugested in waring it turns out the the positions are not present ['O', 'O']

from spacy.training import offsets_to_biluo_tags

for text, annots in TRAIN_DATA:
    print(text + " " + str(annots))
    print(nlp.tokenizer.explain(text))
    print(offsets_to_biluo_tags(nlp.make_doc(text), entities))

Result:

Sandra Bullock {'entities': [(0, 13, 'ACTOR')]}
[('TOKEN', 'Sandra'), ('TOKEN', 'Bullock')]
['O', 'O']
Sam Neil {'entities': [(0, 7, 'ACTOR')]}
[('TOKEN', 'Sam'), ('TOKEN', 'Neil')]
['O', 'O']
Harrison Ford {'entities': [(0, 12, 'ACTOR')]}
[('TOKEN', 'Harrison'), ('TOKEN', 'Ford')]

How to correctly use  from the TRAIN_DATA to add custom entity 'ACTOR'  for given model so that it can be recognized with below code?:

doc = nlp("In this move the main role starring Sam Neil as the secret agent saving the world.")
for ent in doc.ents:
    print(ent.text, ent.label_)


问:
Gradle Error: Colliding Attributes while upgrading unity project from android Google Play Billing Library v3 to v4
I am originally using Unity 2021.1.22f1

I have made a cardboard vr app for android and I need to make an update to it. I am not
using in app purchases or something similar, but I use the Play Asset Delivery package
for unity in order to minimize the app size. I successfullyu built the app and it throws
an error when I upload the app for internal testing and it will not proceed if this is not
resolved.

```<code>We have detected that this app is using an unsupported version of Play Billing.
Please upgrade your Billing Library to version 4 or later to publish this app.
</code>```

When I click the "learn more" button it redirects me to this link:
https://developer.android.com/google/play/billing/deprecation-faq
and the internal test button is greyed out.

It is saying that the Google Play Billing Library must be upgraded from version 3 to at least
version 4.

Due to this forum thread https://forum.unity.com/threads/important-update-google-play-billing-library-v4.1315443/
I searched about the changelog in the unity versions https://docs.unity3d.com/Packages/com.unity.purchasing@4.4/changelog/CHANGELOG.html.
In this changelog is written, that the "GooglePlay - Google Play Billing Library version 4.0.0" is added in IAP 4.4.0 and date 2022-07-11.

So I guessed that i had to upgrade the unity version. I downloaded Unity 2022.1.23f1 and built the same app with the current settings
(Google Play Billing Library v3) and it was successfully built without errors.

I found a way to upgrade the library by downloading the unity package of Play Billing Library
from this website https://developers.google.com/unity/packages#google_play even if it
is saying version 3.2.4 . When I tried to build it a new error appeared:

```<code>Gradle Error: Colliding Attributes

The attribute
meta-data#com.google.android.play.billingclient.version@value=3.0.3
in :billing-4.0.0: collides with another value
(See the Console for details)
</code>```

I tried updating the Play Asset Delivery package but there was no change in the error message.

I found this in my search for the bug https://github.com/RevenueCat/purchases-unity/issues/37#issuecomment-780970405.
In this link, the Google Play Billing Library is having a conflict with the same library
inside the IAP and it suggest a code to bypass the IAP library. and tried it, but to no avail.

After trying this I guess that there is a Google Play Billing Library v3 in the Play Asset Delivery package that probably is
needed to be bypassed.

If the Play Billing Library can be completely skipped it would be the best, because there is no billing function planned
to be implemented in the app, but I mainly want to be able to upload it to the playstore.

This is the mainTemplate.gradle file:

```<code>// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN

// Android Resolver Repos Start
([rootProject] + (rootProject.subprojects as List)).each { project ->
    project.repositories {
        def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
        maven {
            url "https://maven.google.com"
        }
        maven {
            url "https://android-sdk.is.com/" // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:9
        }
        maven {
            url "https://maven.google.com/" // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:17, Assets/IronSource/Editor/IronSourceSDKDependencies.xml:25
        }
        mavenLocal()
        mavenCentral()
    }
}
// Android Resolver Repos End
apply plugin: 'com.android.library'
**APPLY_PLUGINS**

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.google.android.gms:play-services-vision:15.0.2'
    implementation 'com.google.protobuf:protobuf-lite:3.0.0'
// Android Resolver Dependencies Start
    implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:17
    implementation 'com.google.android.gms:play-services-basement:17.2.1' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:25
    implementation 'com.google.android.play:asset-delivery:2.0.0' // Assets/GooglePlayPlugins/com.google.play.assetdelivery/Editor/Dependencies.xml:3
    implementation 'com.google.android.play:core-common:2.0.0' // Assets/GooglePlayPlugins/com.google.play.core/Editor/Dependencies.xml:3
    implementation 'com.ironsource.sdk:mediationsdk:7.2.5' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:9
// Android Resolver Dependencies End
**DEPS**}

// Android Resolver Exclusions Start
android {
  packagingOptions {
      exclude ('/lib/armeabi/*' + '*')
      exclude ('/lib/armeabi-v7a/*' + '*')
      exclude ('/lib/mips/*' + '*')
      exclude ('/lib/mips64/*' + '*')
      exclude ('/lib/x86/*' + '*')
      exclude ('/lib/x86_64/*' + '*')
  }
}
// Android Resolver Exclusions End
android {
    aaptOptions {
        noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ')
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    }

    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        minSdkVersion **MINSDKVERSION**
        targetSdkVersion **TARGETSDKVERSION**
        ndk {
            abiFilters **ABIFILTERS**
        }
        versionCode **VERSIONCODE**
        versionName '**VERSIONNAME**'
        consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
    }

    lintOptions {
        abortOnError false
    }
**PACKAGING_OPTIONS**
}**REPOSITORIES**
**IL_CPP_BUILD_SETUP**
**SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**
</code>```

Body:
I am originally using Unity 2021.1.22f1

I have made a cardboard vr app for android and I need to make an update to it. I am not
using in app purchases or something similar, but I use the Play Asset Delivery package
for unity in order to minimize the app size. I successfullyu built the app and it throws
an error when I upload the app for internal testing and it will not proceed if this is not
resolved.

We have detected that this app is using an unsupported version of Play Billing.
Please upgrade your Billing Library to version 4 or later to publish this app.

When I click the "learn more" button it redirects me to this link:
https://developer.android.com/google/play/billing/deprecation-faq
and the internal test button is greyed out.

It is saying that the Google Play Billing Library must be upgraded from version 3 to at least
version 4.

Due to this forum thread https://forum.unity.com/threads/important-update-google-play-billing-library-v4.1315443/
I searched about the changelog in the unity versions https://docs.unity3d.com/Packages/com.unity.purchasing@4.4/changelog/CHANGELOG.html.
In this changelog is written, that the "GooglePlay - Google Play Billing Library version 4.0.0" is added in IAP 4.4.0 and date 2022-07-11.

So I guessed that i had to upgrade the unity version. I downloaded Unity 2022.1.23f1 and built the same app with the current settings
(Google Play Billing Library v3) and it was successfully built without errors.

I found a way to upgrade the library by downloading the unity package of Play Billing Library
from this website https://developers.google.com/unity/packages#google_play even if it
is saying version 3.2.4 . When I tried to build it a new error appeared:

Gradle Error: Colliding Attributes

The attribute
meta-data#com.google.android.play.billingclient.version@value=3.0.3
in :billing-4.0.0: collides with another value
(See the Console for details)

I tried updating the Play Asset Delivery package but there was no change in the error message.

I found this in my search for the bug https://github.com/RevenueCat/purchases-unity/issues/37#issuecomment-780970405.
In this link, the Google Play Billing Library is having a conflict with the same library
inside the IAP and it suggest a code to bypass the IAP library. and tried it, but to no avail.

After trying this I guess that there is a Google Play Billing Library v3 in the Play Asset Delivery package that probably is
needed to be bypassed.

If the Play Billing Library can be completely skipped it would be the best, because there is no billing function planned
to be implemented in the app, but I mainly want to be able to upload it to the playstore.

This is the mainTemplate.gradle file:

// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN

// Android Resolver Repos Start
([rootProject] + (rootProject.subprojects as List)).each { project ->
    project.repositories {
        def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
        maven {
            url "https://maven.google.com"
        }
        maven {
            url "https://android-sdk.is.com/" // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:9
        }
        maven {
            url "https://maven.google.com/" // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:17, Assets/IronSource/Editor/IronSourceSDKDependencies.xml:25
        }
        mavenLocal()
        mavenCentral()
    }
}
// Android Resolver Repos End
apply plugin: 'com.android.library'
**APPLY_PLUGINS**

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.google.android.gms:play-services-vision:15.0.2'
    implementation 'com.google.protobuf:protobuf-lite:3.0.0'
// Android Resolver Dependencies Start
    implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:17
    implementation 'com.google.android.gms:play-services-basement:17.2.1' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:25
    implementation 'com.google.android.play:asset-delivery:2.0.0' // Assets/GooglePlayPlugins/com.google.play.assetdelivery/Editor/Dependencies.xml:3
    implementation 'com.google.android.play:core-common:2.0.0' // Assets/GooglePlayPlugins/com.google.play.core/Editor/Dependencies.xml:3
    implementation 'com.ironsource.sdk:mediationsdk:7.2.5' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:9
// Android Resolver Dependencies End
**DEPS**}

// Android Resolver Exclusions Start
android {
  packagingOptions {
      exclude ('/lib/armeabi/*' + '*')
      exclude ('/lib/armeabi-v7a/*' + '*')
      exclude ('/lib/mips/*' + '*')
      exclude ('/lib/mips64/*' + '*')
      exclude ('/lib/x86/*' + '*')
      exclude ('/lib/x86_64/*' + '*')
  }
}
// Android Resolver Exclusions End
android {
    aaptOptions {
        noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ')
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    }

    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        minSdkVersion **MINSDKVERSION**
        targetSdkVersion **TARGETSDKVERSION**
        ndk {
            abiFilters **ABIFILTERS**
        }
        versionCode **VERSIONCODE**
        versionName '**VERSIONNAME**'
        consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
    }

    lintOptions {
        abortOnError false
    }
**PACKAGING_OPTIONS**
}**REPOSITORIES**
**IL_CPP_BUILD_SETUP**
**SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**


问:
De-duplicating a table with pairs of Ids
I'm stumped by how to do this. I have the following table with rows that I need to de-duplicate:

BaseCurrencyid
QuoteCurrencyId

DKK
GBP

DKK
GBX

DKK
USD

GBP
DKK

GBP
GBX

GBP
USD

GBX
DKK

GBX
GBP

GBX
USD

USD
DKK

USD
GBP

USD
GBX

De duping involves reducing the table to this:

BaseCurrencyid
QuoteCurrencyId

DKK
GBP

DKK
GBX

DKK
USD

GBP
GBX

GBP
USD

GBX
USD

i.e. you can have DKK/GBP or GBP/DKK pairs but not both.

Here's a SQL statement that generates the pairs - can anybody amend it to get it working?

```<code>with
    cte_currencies as (
        select 'GBP' as CurrencyId union select 'USD' union select 'DKK' union select 'GBX'
    ), cte_combined_crossings as (
        select b.CurrencyId as baseCurrencyId, q.CurrencyId as QuoteCurrencyId from cte_currencies b cross join cte_currencies q where not b.CurrencyId=q.CurrencyId
    )

select * from cte_combined_crossings
</code>```

DbFiddle is here

Body:
I'm stumped by how to do this. I have the following table with rows that I need to de-duplicate:

BaseCurrencyid
QuoteCurrencyId

DKK
GBP

DKK
GBX

DKK
USD

GBP
DKK

GBP
GBX

GBP
USD

GBX
DKK

GBX
GBP

GBX
USD

USD
DKK

USD
GBP

USD
GBX

De duping involves reducing the table to this:

BaseCurrencyid
QuoteCurrencyId

DKK
GBP

DKK
GBX

DKK
USD

GBP
GBX

GBP
USD

GBX
USD

i.e. you can have DKK/GBP or GBP/DKK pairs but not both.

Here's a SQL statement that generates the pairs - can anybody amend it to get it working?

with
    cte_currencies as (
        select 'GBP' as CurrencyId union select 'USD' union select 'DKK' union select 'GBX'
    ), cte_combined_crossings as (
        select b.CurrencyId as baseCurrencyId, q.CurrencyId as QuoteCurrencyId from cte_currencies b cross join cte_currencies q where not b.CurrencyId=q.CurrencyId
    )

select * from cte_combined_crossings

DbFiddle is here


问:
No more error handlers available (recursive errors?); invoking 'abort' restart during profvis()
The reprex below results in the error message, "No more error handlers available (recursive errors?); invoking 'abort' restart". This error message only appears when the code is wrapped within a profvis() call. Any insight into why this is happening would be appreciated. My initial suspicion is something to do with the tryCatch() statement.

Code

```<code>library(profvis)

n_pred <- c(3,6,12)
pref_prev <- c(0.3, 0.1, 0.01)
scen_temp <- expand.grid(pref_prev = pref_prev, n_pred = n_pred)
par_all <- matrix(NA, nrow = nrow(scen_temp), ncol = 2)
par_init <- matrix(data = c(-1, 0.5,
                            -2.5, 0.5,
                            -5, 0.5,
                            -1, 0.4,
                            -2.5, 0.4,
                            -5, 0.4,
                            -1, 0.3,
                            -2.5, 0.3,
                            -5, 0.3),
                   nrow = 9, ncol = 2, byrow = TRUE)

profvis({

  for (j in 1:nrow(par_all)) {

    par_sce <- matrix(NA, 10, 2)

    for (k in 1:10){
      par_sce[k,] <- tryCatch({optimB(n_pred = scen_temp[j,2],
                                      pref_prev = scen_temp[j,1],
                                      par_init = par_init[j,],
                                      n = 5000)},
                              error = function(err) {
                                err$message <- paste(err, "Using initial params instead.")
                                par_init[j,]
                              })
    }
    par_all[j,] <- apply(par_sce, 2, median)
  }
})
</code>```

Session Info

R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Ventura 13.0.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_4.2.1   magrittr_2.0.3   fastmap_1.1.0    cli_3.4.1        tools_4.2.1      rstudioapi_0.14
[7] memoise_2.0.1    cachem_1.0.6     conflicted_1.1.0 rlang_1.0.6      purrr_0.3.5

Body:
The reprex below results in the error message, "No more error handlers available (recursive errors?); invoking 'abort' restart". This error message only appears when the code is wrapped within a profvis() call. Any insight into why this is happening would be appreciated. My initial suspicion is something to do with the tryCatch() statement.

Code

library(profvis)

n_pred <- c(3,6,12)
pref_prev <- c(0.3, 0.1, 0.01)
scen_temp <- expand.grid(pref_prev = pref_prev, n_pred = n_pred)
par_all <- matrix(NA, nrow = nrow(scen_temp), ncol = 2)
par_init <- matrix(data = c(-1, 0.5,
                            -2.5, 0.5,
                            -5, 0.5,
                            -1, 0.4,
                            -2.5, 0.4,
                            -5, 0.4,
                            -1, 0.3,
                            -2.5, 0.3,
                            -5, 0.3),
                   nrow = 9, ncol = 2, byrow = TRUE)

profvis({

  for (j in 1:nrow(par_all)) {

    par_sce <- matrix(NA, 10, 2)

    for (k in 1:10){
      par_sce[k,] <- tryCatch({optimB(n_pred = scen_temp[j,2],
                                      pref_prev = scen_temp[j,1],
                                      par_init = par_init[j,],
                                      n = 5000)},
                              error = function(err) {
                                err$message <- paste(err, "Using initial params instead.")
                                par_init[j,]
                              })
    }
    par_all[j,] <- apply(par_sce, 2, median)
  }
})

Session Info

R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Ventura 13.0.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_4.2.1   magrittr_2.0.3   fastmap_1.1.0    cli_3.4.1        tools_4.2.1      rstudioapi_0.14
[7] memoise_2.0.1    cachem_1.0.6     conflicted_1.1.0 rlang_1.0.6      purrr_0.3.5


问:
Return Custom ValidationResult and access it from controller ModalState in Asp.Net Core
I have same issue as mentioned in this question long back.
Return Custom ValidationResult and access it from controller in Asp.Net Core

But it didn't concluded with an answer.
Please suggest a way to get CustomValidationResult into ModelState of controller.
Note: I am not trying to create new action filters. i am trying to work with ValidationResult, ValidationAttribute and ModelState.

i created a class for

```<code>CustomValidationResult : ValidationResult
</code>```

Using this in my custom attribute

```<code>Mandatory : RequiredAttribute
</code>```

This is not reflecting back to controller level ModelState for further validation.

Body:
I have same issue as mentioned in this question long back.
Return Custom ValidationResult and access it from controller in Asp.Net Core

But it didn't concluded with an answer.
Please suggest a way to get CustomValidationResult into ModelState of controller.
Note: I am not trying to create new action filters. i am trying to work with ValidationResult, ValidationAttribute and ModelState.

i created a class for

CustomValidationResult : ValidationResult

Using this in my custom attribute

Mandatory : RequiredAttribute

This is not reflecting back to controller level ModelState for further validation.


问:
Unable to set the password for MySQL during installation
Using Windows OS after selecting the authentication method from here

I am getting this page where I haven't even set the password

How to set the password? I am unable to get the proper answer.


问:
Angular 13: Error: Transform failed with 1 error
When I was upgrading to Angular 13 I ran into the following errors:

```<code>./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Transform failed with 1 error:
D:/LevaData UI/customer-portal/src/app/modules/authentication/login/login.component.sass:17:100: ERROR: Unterminated string token
    at D:\LevaData UI\customer-portal\node_modules\@ngtools\webpack\src\ivy\loader.js:81:18
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

./src/polyfills.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Transform failed with 1 error:
D:/LevaData UI/customer-portal/src/app/modules/authentication/login/login.component.sass:17:100: ERROR: Unterminated string token
    at D:\LevaData UI\customer-portal\node_modules\@ngtools\webpack\src\ivy\loader.js:81:18
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
</code>```

I'm using the following dependencies:

```<code>  "@angular/cdk": "^13.3.9",
    "@angular/common": "~13.3.12",
    "@angular/compiler": "~13.3.12",
    "@angular/core": "~13.3.12",
    "@angular/forms": "~13.3.12",
    "@angular/platform-browser": "~13.3.12",
    "@angular/platform-browser-dynamic": "~13.3.12",
    "@angular/platform-server": "^13.3.12",

 "bootstrap-sass": "^3.4.1",
 "node-sass": "^4.14.1",
 "sass": "^1.56.0"
</code>```

Does anyone have an idea how to solve these issues?

Body:
When I was upgrading to Angular 13 I ran into the following errors:

./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Transform failed with 1 error:
D:/LevaData UI/customer-portal/src/app/modules/authentication/login/login.component.sass:17:100: ERROR: Unterminated string token
    at D:\LevaData UI\customer-portal\node_modules\@ngtools\webpack\src\ivy\loader.js:81:18
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

./src/polyfills.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Transform failed with 1 error:
D:/LevaData UI/customer-portal/src/app/modules/authentication/login/login.component.sass:17:100: ERROR: Unterminated string token
    at D:\LevaData UI\customer-portal\node_modules\@ngtools\webpack\src\ivy\loader.js:81:18
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

I'm using the following dependencies:

  "@angular/cdk": "^13.3.9",
    "@angular/common": "~13.3.12",
    "@angular/compiler": "~13.3.12",
    "@angular/core": "~13.3.12",
    "@angular/forms": "~13.3.12",
    "@angular/platform-browser": "~13.3.12",
    "@angular/platform-browser-dynamic": "~13.3.12",
    "@angular/platform-server": "^13.3.12",

 "bootstrap-sass": "^3.4.1",
 "node-sass": "^4.14.1",
 "sass": "^1.56.0"

Does anyone have an idea how to solve these issues?


问:
ModuleNotFoundError: No module named 'boto3' in zeppelin notebook when used boto3 in UDF's
When used boto3 library in user defined function, got the no module found error but the same library is working fine in other paragraphs (when not used in user defined functions).
enter image description here
enter image description here

Use boto3 module for uploading data to S3 using python in zeppelin notebook


问:
Unable to push the Button placed next to Picker
I'm creating a todo list with local notifications.

When I press the notification setting button on the right side of the two pickers , it does not work properly,
and the selection display of the first picker appears.

```<code>import SwiftUI
import UserNotifications

struct ContentView: View {
    @State var newItem: String = ""
    @State var toDoList: [String] = []

    @State var selectedValue1: [Int] = []
    @State var selectedValue2: [Int] = []

    var body: some View {
        VStack {
            //Register　new to-do
            HStack {
                TextField("Please write a new task.", text: $newItem)
                    .textFieldStyle(RoundedBorderTextFieldStyle())
                    .frame(width: 300)

                Button {
                    toDoList.append(newItem)
                    selectedValue1.append(-1)
                    selectedValue2.append(-1)
                    newItem = ""
                    UserDefaults.standard.set(toDoList, forKey: "ToDoList")
                    UserDefaults.standard.set(selectedValue1, forKey: "selectedValue1")
                    UserDefaults.standard.set(selectedValue2, forKey: "selectedValue2")
                } label: {
                    ZStack {
                        RoundedRectangle(cornerRadius: 5)
                            .frame(width: 50, height: 30)
                            .foregroundColor(.green)

                        Text("Add").foregroundColor(.white)
                    }
                }
            }

            //List of registered tasks
            List {
                ForEach(0 ..< toDoList.count) { index in
                    VStack{
                        HStack{
                            Text(toDoList[index])
                            Spacer()
                        }

                        todoDatePicker(index)
                    }
                }
            }
            .id(UUID())
        }
        .onAppear() {
            NotificationManager.instance.requestAutorization()
            guard let defaultItem = UserDefaults.standard.array(forKey: "ToDoList") as? [String]
            else { return }
            guard let defaultSelectedValue1 = UserDefaults.standard.array(forKey: "selectedValue1") as? [Int]
            else { return }
            guard let defaultSelectedValue2 = UserDefaults.standard.array(forKey: "selectedValue2") as? [Int]
            else { return }
            toDoList = defaultItem
            selectedValue1 = defaultSelectedValue1
            selectedValue2 = defaultSelectedValue2
        }
    }
}

//Picker to set notification time
extension ContentView {
    func todoDatePicker(_ index: Int) -> some View {
        return HStack {

            Text("Hour")

            Picker("", selection: $selectedValue1[index]) {
                ForEach(-1 ..< 24, id: \.self) { hour in
                    VStack{
                        if hour == -1 {
                            Text("--").tag(hour)
                        } else{
                            Text("\(hour)").tag(hour)
                        }
                    }
                }
            }

            Text("Minute")

            Picker("", selection: $selectedValue2[index]) {
                ForEach(-1 ..< 60, id: \.self) { minute in

                    if minute == -1 {
                        Text("--").tag(minute)
                    } else {
                        Text("\(minute)").tag(minute)
                    }
                }
            }

            Button {
                NotificationManager.instance.scheduleNotification(todoSubtitle: toDoList[index], todoHour: selectedValue1[index], todoMinute: selectedValue2[index])
            } label: {
                Text("Set notification")
            }
        }
    }
}

class NotificationManager {

    static let instance = NotificationManager()

    //    Authorizing a notification
    func requestAutorization() {
        let options: UNAuthorizationOptions = [.alert, .sound, .badge]
        UNUserNotificationCenter.current().requestAuthorization(options: options) { success, error in
            if let error = error {
                print("ERROR: \(error)")
            } else {
                print("SUCCESS")
            }
        }
    }

    //    Local notification at set hour/minute
    func scheduleNotification(todoSubtitle: String, todoHour: Int, todoMinute: Int) {

        let content = UNMutableNotificationContent()
        content.title = "Notification from To-do"
        content.subtitle = todoSubtitle
        content.sound = .default
        content.badge = 1

        var dateComponents = DateComponents()
        dateComponents.hour = todoHour
        dateComponents.minute = todoMinute

        let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: true)

        let request = UNNotificationRequest(
            identifier: UUID().uuidString,
            content: content,
            trigger: trigger)
        UNUserNotificationCenter.current().add(request)
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

</code>```

Preview of the App:

I tried using ZStack,and putting the button over the picker layer, but I could not solve it.

Xcode Version is 14.2.

Body:
I'm creating a todo list with local notifications.

When I press the notification setting button on the right side of the two pickers , it does not work properly,
and the selection display of the first picker appears.

import SwiftUI
import UserNotifications

struct ContentView: View {
    @State var newItem: String = ""
    @State var toDoList: [String] = []

    @State var selectedValue1: [Int] = []
    @State var selectedValue2: [Int] = []

    var body: some View {
        VStack {
            //Register　new to-do
            HStack {
                TextField("Please write a new task.", text: $newItem)
                    .textFieldStyle(RoundedBorderTextFieldStyle())
                    .frame(width: 300)

                Button {
                    toDoList.append(newItem)
                    selectedValue1.append(-1)
                    selectedValue2.append(-1)
                    newItem = ""
                    UserDefaults.standard.set(toDoList, forKey: "ToDoList")
                    UserDefaults.standard.set(selectedValue1, forKey: "selectedValue1")
                    UserDefaults.standard.set(selectedValue2, forKey: "selectedValue2")
                } label: {
                    ZStack {
                        RoundedRectangle(cornerRadius: 5)
                            .frame(width: 50, height: 30)
                            .foregroundColor(.green)

                        Text("Add").foregroundColor(.white)
                    }
                }
            }

            //List of registered tasks
            List {
                ForEach(0 ..< toDoList.count) { index in
                    VStack{
                        HStack{
                            Text(toDoList[index])
                            Spacer()
                        }

                        todoDatePicker(index)
                    }
                }
            }
            .id(UUID())
        }
        .onAppear() {
            NotificationManager.instance.requestAutorization()
            guard let defaultItem = UserDefaults.standard.array(forKey: "ToDoList") as? [String]
            else { return }
            guard let defaultSelectedValue1 = UserDefaults.standard.array(forKey: "selectedValue1") as? [Int]
            else { return }
            guard let defaultSelectedValue2 = UserDefaults.standard.array(forKey: "selectedValue2") as? [Int]
            else { return }
            toDoList = defaultItem
            selectedValue1 = defaultSelectedValue1
            selectedValue2 = defaultSelectedValue2
        }
    }
}

//Picker to set notification time
extension ContentView {
    func todoDatePicker(_ index: Int) -> some View {
        return HStack {

            Text("Hour")

            Picker("", selection: $selectedValue1[index]) {
                ForEach(-1 ..< 24, id: \.self) { hour in
                    VStack{
                        if hour == -1 {
                            Text("--").tag(hour)
                        } else{
                            Text("\(hour)").tag(hour)
                        }
                    }
                }
            }

            Text("Minute")

            Picker("", selection: $selectedValue2[index]) {
                ForEach(-1 ..< 60, id: \.self) { minute in

                    if minute == -1 {
                        Text("--").tag(minute)
                    } else {
                        Text("\(minute)").tag(minute)
                    }
                }
            }

            Button {
                NotificationManager.instance.scheduleNotification(todoSubtitle: toDoList[index], todoHour: selectedValue1[index], todoMinute: selectedValue2[index])
            } label: {
                Text("Set notification")
            }
        }
    }
}

class NotificationManager {

    static let instance = NotificationManager()

    //    Authorizing a notification
    func requestAutorization() {
        let options: UNAuthorizationOptions = [.alert, .sound, .badge]
        UNUserNotificationCenter.current().requestAuthorization(options: options) { success, error in
            if let error = error {
                print("ERROR: \(error)")
            } else {
                print("SUCCESS")
            }
        }
    }

    //    Local notification at set hour/minute
    func scheduleNotification(todoSubtitle: String, todoHour: Int, todoMinute: Int) {

        let content = UNMutableNotificationContent()
        content.title = "Notification from To-do"
        content.subtitle = todoSubtitle
        content.sound = .default
        content.badge = 1

        var dateComponents = DateComponents()
        dateComponents.hour = todoHour
        dateComponents.minute = todoMinute

        let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: true)

        let request = UNNotificationRequest(
            identifier: UUID().uuidString,
            content: content,
            trigger: trigger)
        UNUserNotificationCenter.current().add(request)
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

Preview of the App:

I tried using ZStack,and putting the button over the picker layer, but I could not solve it.

Xcode Version is 14.2.


问:
Can we hide/encrypt particular details in a file without encrypting the entire file
Is it possible to encrypt particular details in a file than entire file....lets say in hyperledger we have a channel with some organizations(lets say 3) one is dealer,2nd is supplier-1 and the other will be supplier-2. So if dealer has a deal of buying some products with supplier 1 and 2...here, supplier 1 knows that dealer has a deal with supplier 2 also,same goes with supplier 1 but here dealer wants to maintain privacy with both supplier 1 and 2 on the details like price, quantity etc. so how to hide those particular fields other than the entire data.

simply- supplier-1 knows that there is a deal between dealer and supplier-2 but don't know the quantity of goods that dealer is going to buy from supplier-2 and the price.

how can we solve this problem?

I want a solution other than the concept of private data collection in hyperledger fabric


问:
I want to update an windows application while the older version of the same app is installed and running using visual studio installer
I want to stop an application while update the same app with updated version.

I can able to update the application when manually stop the application in task manager. But I want to do the same process while installing the new version using visual studio installer.

is that possible?

I have done the same in Mac OS by adding pre and post process scripts. I want to do the same in windows like the pre and post process scripts or the visual studio installer has any option to do it.


问:
Symfony 6.1.7 project didn't work and still reload without any information
Symfony 6.1.7
PHP 8.1.13
Ubuntu 20.04.5 LTS

the project work normally on local test but in upload on server didn't work without display any information without write in log files , and the project/public still in loading

i think it's permission problem but i try to give the folder project 'all the permission with chmod 777 '  but without any changement


问:
How do I display 2 columns next to eachother wit the x-axis being the index
I'm using plotly and dash to create a data dashboard. I want to display the 'WER' and the 'CER' next to eachother and then have a the bars side by side for each row in the dataframe.

```<code>dff = pd.read_sql_query(
        'SELECT * FROM WER_Sentence WHERE Root = "{}"'.format(value),
        engine
    )
dff.reset_index(drop=True)
fig= px.bar(dff , y= ['WER', 'CER'], x= dff.index ,hover_data=['Truth' , 'Predicted'] , title= 'WER per sentence', barmode= 'group' )
</code>```

This is the output

I don't understand why the y-axis becomes a count and why the x-axis becomes the values?

Body:
I'm using plotly and dash to create a data dashboard. I want to display the 'WER' and the 'CER' next to eachother and then have a the bars side by side for each row in the dataframe.

dff = pd.read_sql_query(
        'SELECT * FROM WER_Sentence WHERE Root = "{}"'.format(value),
        engine
    )
dff.reset_index(drop=True)
fig= px.bar(dff , y= ['WER', 'CER'], x= dff.index ,hover_data=['Truth' , 'Predicted'] , title= 'WER per sentence', barmode= 'group' )

This is the output

I don't understand why the y-axis becomes a count and why the x-axis becomes the values?


问:
Fluent UI React make Button fill full container
I am implementing a PowerApps PCF with inserting a Button, I want to fill this Button in the PCF container.

I tried with below code:

```<code>  public render(): React.ReactNode {
    return (
      <>
        <DefaultButton
          style={{ width: "100%", height: "100%" }}
          onClick={async () => await this.importExcel()}
        >
          {this.props.label ?? "Test Button"}
        </DefaultButton>
      </>
    );
  }
</code>```

But, it only makes the width fill parent container. The height did not change.

I prefer to make the Button fill the parent container and the text in the center.

Body:
I am implementing a PowerApps PCF with inserting a Button, I want to fill this Button in the PCF container.

I tried with below code:

  public render(): React.ReactNode {
    return (
      <>
        <DefaultButton
          style={{ width: "100%", height: "100%" }}
          onClick={async () => await this.importExcel()}
        >
          {this.props.label ?? "Test Button"}
        </DefaultButton>
      </>
    );
  }

But, it only makes the width fill parent container. The height did not change.

I prefer to make the Button fill the parent container and the text in the center.


问:
How do I query unique users opening the app weekly in 2021 and 2022
What I'm trying to do is query a database and return the unique users opening the app per week in 2021 and 2022.

Querying the unique users per week from a single year is very easy, the query looks like this:

```<code>SELECT COUNT(DISTINCT(u.user_id)) AS allCountries,
       DATE(ap.app_launched_time) AS launchAppDate
FROM users u
JOIN app_sessions ap ON ap.user_id = u.user_id
WHERE  u.user_email NOT LIKE '%proto%'
     AND u.user_email NOT LIKE '%test%'
     AND u.user_email NOT LIKE '%demo%'
     AND u.user_email NOT LIKE '%smart%'
     AND u.user_type = 'C'
     AND YEAR(ap.app_launched_time) = '2021'
GROUP BY WEEK(DATE(ap.app_launched_time))
</code>```

However, I have no idea how to do this for both years at the same time.
My desired output would be:

2021
2022
Date (week)

num
num
date

Body:
What I'm trying to do is query a database and return the unique users opening the app per week in 2021 and 2022.

Querying the unique users per week from a single year is very easy, the query looks like this:

SELECT COUNT(DISTINCT(u.user_id)) AS allCountries,
       DATE(ap.app_launched_time) AS launchAppDate
FROM users u
JOIN app_sessions ap ON ap.user_id = u.user_id
WHERE  u.user_email NOT LIKE '%proto%'
     AND u.user_email NOT LIKE '%test%'
     AND u.user_email NOT LIKE '%demo%'
     AND u.user_email NOT LIKE '%smart%'
     AND u.user_type = 'C'
     AND YEAR(ap.app_launched_time) = '2021'
GROUP BY WEEK(DATE(ap.app_launched_time))

However, I have no idea how to do this for both years at the same time.
My desired output would be:

2021
2022
Date (week)

num
num
date


问:
Not able to Merge and Insert from stored procedure on SQL ANYWHERE
```<code>ALTER PROCEDURE "DBA"."Inventory_CreateOrUpdateStock"(
IN @ItemCode CHAR(10),
IN @Name VARCHAR(200),
IN @Description VARCHAR(100),
IN @Size VARCHAR(60),
IN @Colour VARCHAR(60),
IN @TaxCode CHAR(5),
IN @Unit CHAR(10),
IN @Category CHAR(20),
IN @Section VARCHAR(30),
IN @Product VARCHAR(30),
IN @Brand VARCHAR(30),
IN @SupplierId CHAR(5),
IN @Hsn VARCHAR(40),
IN @Plu NUMERIC(10),
IN @Shelf VARCHAR(60),
IN @BillINgStatus CHAR(1),
IN @MinimumQuantity NUMERIC(12),
IN @MaximumQuantity NUMERIC(12),
IN @ReOrderLevel NUMERIC(12),
IN @MinimumSalePrice NUMERIC(10) )
BEGIN

MERGE INTO acc_product p (code, name, description, text3, text5,
taxcode, unit, catagory, company, product, brand, supplier,
text6, intcode, text4, withinstate, minimunquantity,
maximumquantity, number5, nlc2)
USING Inventory_CreateOrUpdateStock (@ItemCode, @Name,
@Description, @Size, @Colour, @TaxCode, @Unit, @Category,
@Section, @Product, @Brand, @SupplierId,
@Hsn, @Plu, @Shelf, @BillINgStatus, @MinimumQuantity,
@MaximumQuantity, @ReOrderLevel, @MinimumSalePrice) ON p.code=
Inventory_CreateOrUpdateStock.@ItemCode
WHEN MATCHED THEN UPDATE SET
p.name = Inventory_CreateOrUpdateStocks.@Name,
p.description = Inventory_CreateOrUpdateStock.@Description,
p.text3 = Inventory_CreateOrUpdateStock.@Size,
p.text5 = Inventory_CreateOrUpdateStock.@Colour,
p.taxcode = Inventory_CreateOrUpdateStock.@TaxCode,
p.unit = Inventory_CreateOrUpdateStock.@Unit,
p.catagory = Inventory_CreateOrUpdateStock.@Category,
p.company = Inventory_CreateOrUpdateStock.@Section,
p.product = Inventory_CreateOrUpdateStock.@Product,
p.brand = Inventory_CreateOrUpdateStock.@Brand,
p.supplier = Inventory_CreateOrUpdateStock.@SupplierId,
p.text6 = Inventory_CreateOrUpdateStock.@Hsn,
p.intcode = CAST(Inventory_CreateOrUpdateStock.@Plu AS NUMERIC),
p.text4 = Inventory_CreateOrUpdateStock.@Shelf,
p.withinstate = Inventory_CreateOrUpdateStock.@BillingStatus,
p.minimunquantity
=Inventory_CreateOrUpdateStock.@MinimumQuantity,
p.maximumquantity =
Inventory_CreateOrUpdateStock.@MaximumQuantity,
p.number5 = Inventory_CreateOrUpdateStock.@ReOrderLevel,
p.nlc2 = Inventory_CreateOrUpdateStock.@MinimumSalePrice
WHEN NOT MATCHED
  THEN INSERT(p.code, p.name, p.description, p.text3, p.text5,
p.taxcode, p.unit, p.catagory, p.company, p.product, p.brand,
p.supplier,
p.text6, p.intcode, p.text4, p.withinstate, p.minimunquantity,
p.maximumquantity, p.number5, p.nlc2)
VALUES(Inventory_CreateOrUpdateStock.@ItemCode,
Inventory_CreateOrUpdateStock.@Name,
Inventory_CreateOrUpdateStock.@Description,
Inventory_CreateOrUpdateStock.@Size,
Inventory_CreateOrUpdateStock.@Colour,
Inventory_CreateOrUpdateStock.@TaxCode,
Inventory_CreateOrUpdateStock.@Unit,
Inventory_CreateOrUpdateStock.@Category,
Inventory_CreateOrUpdateStock.@Section,
Inventory_CreateOrUpdateStock.@Product,
Inventory_CreateOrUpdateStock.@Brand,
Inventory_CreateOrUpdateStock.@SupplierId,
Inventory_CreateOrUpdateStock.@Hsn,
Inventory_CreateOrUpdateStock.@Plu,
Inventory_CreateOrUpdateStock.@Shelf,
Inventory_CreateOrUpdateStock.@BillINgStatus,
Inventory_CreateOrUpdateStock.@MinimumQuantity,
Inventory_CreateOrUpdateStock.@MaximumQuantity,
Inventory_CreateOrUpdateStock.@ReOrderLevel,
Inventory_CreateOrUpdateStock.@MinimumSalePrice);
END
</code>```

**This is My stored procedure: I need to enter some data to a table acc_product if it does not exist i need to Insert or I need to update data. the procedure is getting saved but while executing it shows this error

Could not execute statement. Inventory_CreateOrUpdateStock does not return a result set SQLCODE=-872, ODBC 3 State="HY000" Line 1, column 1**

Body:
ALTER PROCEDURE "DBA"."Inventory_CreateOrUpdateStock"(
IN @ItemCode CHAR(10),
IN @Name VARCHAR(200),
IN @Description VARCHAR(100),
IN @Size VARCHAR(60),
IN @Colour VARCHAR(60),
IN @TaxCode CHAR(5),
IN @Unit CHAR(10),
IN @Category CHAR(20),
IN @Section VARCHAR(30),
IN @Product VARCHAR(30),
IN @Brand VARCHAR(30),
IN @SupplierId CHAR(5),
IN @Hsn VARCHAR(40),
IN @Plu NUMERIC(10),
IN @Shelf VARCHAR(60),
IN @BillINgStatus CHAR(1),
IN @MinimumQuantity NUMERIC(12),
IN @MaximumQuantity NUMERIC(12),
IN @ReOrderLevel NUMERIC(12),
IN @MinimumSalePrice NUMERIC(10) )
BEGIN

MERGE INTO acc_product p (code, name, description, text3, text5,
taxcode, unit, catagory, company, product, brand, supplier,
text6, intcode, text4, withinstate, minimunquantity,
maximumquantity, number5, nlc2)
USING Inventory_CreateOrUpdateStock (@ItemCode, @Name,
@Description, @Size, @Colour, @TaxCode, @Unit, @Category,
@Section, @Product, @Brand, @SupplierId,
@Hsn, @Plu, @Shelf, @BillINgStatus, @MinimumQuantity,
@MaximumQuantity, @ReOrderLevel, @MinimumSalePrice) ON p.code=
Inventory_CreateOrUpdateStock.@ItemCode
WHEN MATCHED THEN UPDATE SET
p.name = Inventory_CreateOrUpdateStocks.@Name,
p.description = Inventory_CreateOrUpdateStock.@Description,
p.text3 = Inventory_CreateOrUpdateStock.@Size,
p.text5 = Inventory_CreateOrUpdateStock.@Colour,
p.taxcode = Inventory_CreateOrUpdateStock.@TaxCode,
p.unit = Inventory_CreateOrUpdateStock.@Unit,
p.catagory = Inventory_CreateOrUpdateStock.@Category,
p.company = Inventory_CreateOrUpdateStock.@Section,
p.product = Inventory_CreateOrUpdateStock.@Product,
p.brand = Inventory_CreateOrUpdateStock.@Brand,
p.supplier = Inventory_CreateOrUpdateStock.@SupplierId,
p.text6 = Inventory_CreateOrUpdateStock.@Hsn,
p.intcode = CAST(Inventory_CreateOrUpdateStock.@Plu AS NUMERIC),
p.text4 = Inventory_CreateOrUpdateStock.@Shelf,
p.withinstate = Inventory_CreateOrUpdateStock.@BillingStatus,
p.minimunquantity
=Inventory_CreateOrUpdateStock.@MinimumQuantity,
p.maximumquantity =
Inventory_CreateOrUpdateStock.@MaximumQuantity,
p.number5 = Inventory_CreateOrUpdateStock.@ReOrderLevel,
p.nlc2 = Inventory_CreateOrUpdateStock.@MinimumSalePrice
WHEN NOT MATCHED
  THEN INSERT(p.code, p.name, p.description, p.text3, p.text5,
p.taxcode, p.unit, p.catagory, p.company, p.product, p.brand,
p.supplier,
p.text6, p.intcode, p.text4, p.withinstate, p.minimunquantity,
p.maximumquantity, p.number5, p.nlc2)
VALUES(Inventory_CreateOrUpdateStock.@ItemCode,
Inventory_CreateOrUpdateStock.@Name,
Inventory_CreateOrUpdateStock.@Description,
Inventory_CreateOrUpdateStock.@Size,
Inventory_CreateOrUpdateStock.@Colour,
Inventory_CreateOrUpdateStock.@TaxCode,
Inventory_CreateOrUpdateStock.@Unit,
Inventory_CreateOrUpdateStock.@Category,
Inventory_CreateOrUpdateStock.@Section,
Inventory_CreateOrUpdateStock.@Product,
Inventory_CreateOrUpdateStock.@Brand,
Inventory_CreateOrUpdateStock.@SupplierId,
Inventory_CreateOrUpdateStock.@Hsn,
Inventory_CreateOrUpdateStock.@Plu,
Inventory_CreateOrUpdateStock.@Shelf,
Inventory_CreateOrUpdateStock.@BillINgStatus,
Inventory_CreateOrUpdateStock.@MinimumQuantity,
Inventory_CreateOrUpdateStock.@MaximumQuantity,
Inventory_CreateOrUpdateStock.@ReOrderLevel,
Inventory_CreateOrUpdateStock.@MinimumSalePrice);
END

**This is My stored procedure: I need to enter some data to a table acc_product if it does not exist i need to Insert or I need to update data. the procedure is getting saved but while executing it shows this error

Could not execute statement. Inventory_CreateOrUpdateStock does not return a result set SQLCODE=-872, ODBC 3 State="HY000" Line 1, column 1**


问:
Grafana extracting time from metrics
I get a metric and I would like to create a query that will draw time (102 in the example) on the graph. How should such a query look like?</p>
```<code>2022-12-21 13:13:20
102
Log labels

instance    TEST

metric_name time_test_grouping
Detected fields

ts  2022-12-21T12:13:20.316Z

tsNs    1671624800316000000
</code>```

Title: Grafana extracting time from metrics

Body:
I get a metric and I would like to create a query that will draw time (102 in the example) on the graph. How should such a query look like?

2022-12-21 13:13:20
102
Log labels

instance    TEST

metric_name time_test_grouping
Detected fields

ts  2022-12-21T12:13:20.316Z

tsNs    1671624800316000000


问:
is there a way for setup cucumber and play wright on vs code?
I want to create a typescript project that integrated with cucumber js and playwright on VS Code, I installed playwright but i don't know how to configure cucumber on it, can you help me please?

Installed cucumber, but the required folders are not created inside the project, and when I run the default project, it gives an error, this error crbug/1173575, non-JS module files deprecated.
In fact, I want cucumber to be installed with Playwright and I can run it, but it doesn't work


问:
How to detect if app is opened from website?
I have a React web application, and when user clicks on a button, a want to open Android/iOS application if it's installed. If not, I want to redirect to Play/App Store.

From the code below, when the user clicks on the button and if he has an installed application, that application will open (and that's ok), but then if he clicks on the back button in application, it will return him to the web where the Store will already be open because the function for redirecting to the store will be called after 3 seconds.

My question is, is there any way to detect if application is installed/opened so I don't get redirected to the store? Or is there other way to write this logic?

```<code>const navigateHandler = () => {
    if (isAndroid) {
      const url = 'example://example.mysite.eu/login';
      window.location.replace(url);

      setTimeout(() => {
        window.location.replace(
          'https://play.google.com/store/apps/details?id=eu.example'
        );
      }, 3000);
    } else if (isIOS) {
      window.location.replace('example://');

      setTimeout(() => {
        window.location.replace(
          'https://apps.apple.com/rs/app/example/id?itsct=apps_box_badge&'
        );
      }, 3000);
    } else {
      navigate('/login', { replace: true });
    }
  };
</code>```

Body:
I have a React web application, and when user clicks on a button, a want to open Android/iOS application if it's installed. If not, I want to redirect to Play/App Store.

From the code below, when the user clicks on the button and if he has an installed application, that application will open (and that's ok), but then if he clicks on the back button in application, it will return him to the web where the Store will already be open because the function for redirecting to the store will be called after 3 seconds.

My question is, is there any way to detect if application is installed/opened so I don't get redirected to the store? Or is there other way to write this logic?

const navigateHandler = () => {
    if (isAndroid) {
      const url = 'example://example.mysite.eu/login';
      window.location.replace(url);

      setTimeout(() => {
        window.location.replace(
          'https://play.google.com/store/apps/details?id=eu.example'
        );
      }, 3000);
    } else if (isIOS) {
      window.location.replace('example://');

      setTimeout(() => {
        window.location.replace(
          'https://apps.apple.com/rs/app/example/id?itsct=apps_box_badge&'
        );
      }, 3000);
    } else {
      navigate('/login', { replace: true });
    }
  };


问:
nginx proxy reverse on docker - how add authentication for selected domain?
I want add to selected domain like test.domain.com, authentication on password.

Bellow my configuration docker-compose.yml for nginx

letsencrypt and docker-compose.yml for single domain.

docker-compose for nginx + le

```<code>services:
    nginx:
        container_name: nginx
        image: nginxproxy/nginx-proxy
        restart: unless-stopped
        ports:
            - 80:80
            - 443:443
        volumes:
            - /var/run/docker.sock:/tmp/docker.sock:ro
            - /var/docker/nginx/html:/usr/share/nginx/html
            - /var/docker/nginx/certs:/etc/nginx/certs
            - /var/docker/nginx/vhost:/etc/nginx/vhost.d
        logging:
            options:
                max-size: "10m"
                max-file: "3"

    letsencrypt-companion:
        container_name: nginx-le
        image: jrcs/letsencrypt-nginx-proxy-companion
        restart: unless-stopped
        volumes_from:
            - nginx
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
            - /var/docker/nginx/acme:/etc/acme.sh
        environment:
            DEFAULT_EMAIL: mail@mail.com
</code>```

docker-compose for single domain

```<code>services:
    web:
        container_name: test.domain.com
        image: kornkitti/express-hello-world
        expose:
            - "8080"
        environment:
            VIRTUAL_HOST: test.domain.com
            LETSENCRYPT_HOST:  test.domain.com
        networks:
          - proxy

networks:
  proxy:
    external:
      name: nginx_default
</code>```

I want for domain test.domain.com add autehtnication on password, for other domains no.

Body:
I want add to selected domain like test.domain.com, authentication on password.

Bellow my configuration docker-compose.yml for nginx

letsencrypt and docker-compose.yml for single domain.

docker-compose for nginx + le

services:
    nginx:
        container_name: nginx
        image: nginxproxy/nginx-proxy
        restart: unless-stopped
        ports:
            - 80:80
            - 443:443
        volumes:
            - /var/run/docker.sock:/tmp/docker.sock:ro
            - /var/docker/nginx/html:/usr/share/nginx/html
            - /var/docker/nginx/certs:/etc/nginx/certs
            - /var/docker/nginx/vhost:/etc/nginx/vhost.d
        logging:
            options:
                max-size: "10m"
                max-file: "3"

    letsencrypt-companion:
        container_name: nginx-le
        image: jrcs/letsencrypt-nginx-proxy-companion
        restart: unless-stopped
        volumes_from:
            - nginx
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
            - /var/docker/nginx/acme:/etc/acme.sh
        environment:
            DEFAULT_EMAIL: mail@mail.com

docker-compose for single domain

services:
    web:
        container_name: test.domain.com
        image: kornkitti/express-hello-world
        expose:
            - "8080"
        environment:
            VIRTUAL_HOST: test.domain.com
            LETSENCRYPT_HOST:  test.domain.com
        networks:
          - proxy

networks:
  proxy:
    external:
      name: nginx_default

I want for domain test.domain.com add autehtnication on password, for other domains no.