问:
Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable
I'm a react native beginner.
If it's just a silly question,, oops, I'll appreciate bearing with me.

I've got this error.
It's an output of npm run ios after I edited something (sorry I don't know what it's the trigger.)

```<code>Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient.
        A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes

</code>```

Here is the app.js.

```<code>import React, { Component } from 'react';
import 'react-native-gesture-handler';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { createDrawerNavigator } from '@react-navigation/drawer';
import Login from './components/FirstPages/LoginPage';
import Signup from './components/FirstPages/SignupPage';
import First from './components/FirstPages/FirstPage';

const Stack = createStackNavigator();
const Drawer = createDrawerNavigator();

export default class App extends Component {
  constructor() {
    super();
  }

  render() {
    return (
      <NavigationContainer>
          <Stack.Navigator screenOptions={{
            headerShown: false,
          }}>
              <Stack.Screen name="First Screen" component={First} />
              <Stack.Screen name="Signup Screen" component={Signup} />
              <Stack.Screen name="Login Screen" component={Login} />
          </Stack.Navigator>
      </NavigationContainer>
    );
  }
}
</code>```

package.json

```<code>{
  "name": "app1",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-community/masked-view": "0.1.11",
    "@react-navigation/bottom-tabs": "6.5.2",
    "@react-navigation/drawer": "6.5.6",
    "@react-navigation/native": "6.1.1",
    "@react-navigation/native-stack": "6.9.7",
    "@react-navigation/stack": "6.3.10",
    "@rneui/base": "4.0.0-rc.7",
    "@rneui/themed": "4.0.0-rc.7",
    "deprecated-react-native-prop-types": "4.0.0",
    "lottie-react-native": "5.1.4",
    "react": "18.1.0",
    "react-native": "0.70.6",
    "react-native-check": "1.0.0",
    "react-native-gesture-handler": "2.8.0",
    "react-native-reanimated": "2.13.0",
    "react-native-safe-area-context": "4.4.1",
    "react-native-screens": "3.18.2",
    "react-native-swiper": "1.6.0",
    "react-native-textinput-effects": "0.6.3",
    "react-native-vector-icons": "9.2.0"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-eslint": "10.1.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.32.0",
    "eslint-plugin-react": "7.31.11",
    "eslint-plugin-react-native": "4.0.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "0.72.3",
    "react-test-renderer": "18.1.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

</code>```

LoginPage.js

```<code>import React, { Component } from 'react';
import { View, Text, StyleSheet } from 'react-native';
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
import { Sae } from 'react-native-textinput-effects';

class Login extends Component {
  constructor() {
    super();
    this.state = {
      name: null,
      email: null,
    };
  }

  render() {
    return (
      <View style={styles.total}>
        <View style={styles.AppName}>
          <Text style={{ fontSize: 50 }}>
            Hi!
          </Text>
        </View>
        <View style={styles.Inputs}>
          <Sae
          label="Email"
          iconClass={FontAwesomeIcon}
          iconName="pencil"
          iconColor="white"
          inputPadding={16}
          labelHeight={24}
          borderHeight={2}
          autoCapitalize="none"
          autoCorrect={false}
          />
          <Sae
          label="Password"
          iconClass={FontAwesomeIcon}
          iconName="pencil"
          iconColor="white"
          inputPadding={16}
          labelHeight={24}
          borderHeight={2}
          autoCapitalize="none"
          autoCorrect={false}
          />
        </View>
      </View>
    );
  }
}
const styles = StyleSheet.create({
  total: {
    flex: 1,
    backgroundColor: 'red',
  },
  AppName: {
    flex: 4,
    backgroundColor: 'green',
    alignItems: 'center',
    justifyContent: 'center',
  },
  Inputs: {
    flex: 5,
    backgroundColor: 'blue',
    alignItems: 'center',
    justifyContent: 'center',
  },
});
export default Login;
</code>```

SignupPage.js

```<code>import React, { Component } from 'react';
import { View, Text, StyleSheet } from 'react-native';
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
import { Sae } from 'react-native-textinput-effects';

class Signup extends Component {
  constructor() {
    super();
    this.state = {
      name: null,
      email: null,
    };
  }

  render() {
    return (
      <View style={styles.total}>
        <View style={styles.AppName}>
          <Text style={{ fontSize: 50 }}>
            Hi!
          </Text>
        </View>
        <View style={styles.Inputs}>
          <Sae
          label="Email"
          iconClass={FontAwesomeIcon}
          iconName="pencil"
          iconColor="white"
          inputPadding={16}
          labelHeight={24}
          borderHeight={2}
          autoCapitalize="none"
          autoCorrect={false}
          />
          <Sae
          label="Password"
          iconClass={FontAwesomeIcon}
          iconName="pencil"
          iconColor="white"
          inputPadding={16}
          labelHeight={24}
          borderHeight={2}
          autoCapitalize="none"
          autoCorrect={false}
          />
        </View>
      </View>
    );
  }
}
const styles = StyleSheet.create({
  total: {
    flex: 1,
    backgroundColor: 'red',
  },
  AppName: {
    flex: 4,
    backgroundColor: 'green',
    alignItems: 'center',
    justifyContent: 'center',
  },
  Inputs: {
    flex: 5,
    backgroundColor: 'blue',
    alignItems: 'center',
    justifyContent: 'center',
  },
});
export default Signup;
</code>```

FirstPage.js

```<code>import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { Button } from 'react-native-textinput-effects';

function FirstPage({ navigation }) {
  return (
    <View style={styles.total}>
      <View style={styles.AppName}>
        <Text style={{ fontSize: 50 }}>
            SMS
        </Text>
      </View>
      <View style={styles.Buttons}>
        <Button
          type="OutLine"
          title="Login"
          containerStyle={{ width: 110, height: 45, margin: 10 }}
          titleStyle={{ fontSize: 25 }}
          onPress={() => navigation.navigate('Login Screen')}
          />
        <Button
          type="OutLine"
          title="Sign up"
          containerStyle={{ width: 110, height: 45, margin: 10 }}
          titleStyle={{ fontSize: 25 }}
          onPress={() => navigation.navigate('Signup Screen')}
          />
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  total: {
    flex: 1,
  },
  AppName: {
    flex: 4,
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: 'green',
  },
  Buttons: {
    flex: 4.5,
    backgroundColor: 'yellow',
    alignItems: 'center',
    justifyContent: 'center',
  },
});
export default FirstPage;
</code>```

https://github.com/facebook/react-native/issues/34688

I found it, but it seemed there's no solution.

Body:
I'm a react native beginner.
If it's just a silly question,, oops, I'll appreciate bearing with me.

I've got this error.
It's an output of npm run ios after I edited something (sorry I don't know what it's the trigger.)

Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient.
        A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes

Here is the app.js.

import React, { Component } from 'react';
import 'react-native-gesture-handler';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { createDrawerNavigator } from '@react-navigation/drawer';
import Login from './components/FirstPages/LoginPage';
import Signup from './components/FirstPages/SignupPage';
import First from './components/FirstPages/FirstPage';

const Stack = createStackNavigator();
const Drawer = createDrawerNavigator();

export default class App extends Component {
  constructor() {
    super();
  }

  render() {
    return (
      <NavigationContainer>
          <Stack.Navigator screenOptions={{
            headerShown: false,
          }}>
              <Stack.Screen name="First Screen" component={First} />
              <Stack.Screen name="Signup Screen" component={Signup} />
              <Stack.Screen name="Login Screen" component={Login} />
          </Stack.Navigator>
      </NavigationContainer>
    );
  }
}

package.json

{
  "name": "app1",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-community/masked-view": "0.1.11",
    "@react-navigation/bottom-tabs": "6.5.2",
    "@react-navigation/drawer": "6.5.6",
    "@react-navigation/native": "6.1.1",
    "@react-navigation/native-stack": "6.9.7",
    "@react-navigation/stack": "6.3.10",
    "@rneui/base": "4.0.0-rc.7",
    "@rneui/themed": "4.0.0-rc.7",
    "deprecated-react-native-prop-types": "4.0.0",
    "lottie-react-native": "5.1.4",
    "react": "18.1.0",
    "react-native": "0.70.6",
    "react-native-check": "1.0.0",
    "react-native-gesture-handler": "2.8.0",
    "react-native-reanimated": "2.13.0",
    "react-native-safe-area-context": "4.4.1",
    "react-native-screens": "3.18.2",
    "react-native-swiper": "1.6.0",
    "react-native-textinput-effects": "0.6.3",
    "react-native-vector-icons": "9.2.0"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-eslint": "10.1.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.32.0",
    "eslint-plugin-react": "7.31.11",
    "eslint-plugin-react-native": "4.0.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "0.72.3",
    "react-test-renderer": "18.1.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

LoginPage.js

import React, { Component } from 'react';
import { View, Text, StyleSheet } from 'react-native';
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
import { Sae } from 'react-native-textinput-effects';

class Login extends Component {
  constructor() {
    super();
    this.state = {
      name: null,
      email: null,
    };
  }

  render() {
    return (
      <View style={styles.total}>
        <View style={styles.AppName}>
          <Text style={{ fontSize: 50 }}>
            Hi!
          </Text>
        </View>
        <View style={styles.Inputs}>
          <Sae
          label="Email"
          iconClass={FontAwesomeIcon}
          iconName="pencil"
          iconColor="white"
          inputPadding={16}
          labelHeight={24}
          borderHeight={2}
          autoCapitalize="none"
          autoCorrect={false}
          />
          <Sae
          label="Password"
          iconClass={FontAwesomeIcon}
          iconName="pencil"
          iconColor="white"
          inputPadding={16}
          labelHeight={24}
          borderHeight={2}
          autoCapitalize="none"
          autoCorrect={false}
          />
        </View>
      </View>
    );
  }
}
const styles = StyleSheet.create({
  total: {
    flex: 1,
    backgroundColor: 'red',
  },
  AppName: {
    flex: 4,
    backgroundColor: 'green',
    alignItems: 'center',
    justifyContent: 'center',
  },
  Inputs: {
    flex: 5,
    backgroundColor: 'blue',
    alignItems: 'center',
    justifyContent: 'center',
  },
});
export default Login;

SignupPage.js

import React, { Component } from 'react';
import { View, Text, StyleSheet } from 'react-native';
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
import { Sae } from 'react-native-textinput-effects';

class Signup extends Component {
  constructor() {
    super();
    this.state = {
      name: null,
      email: null,
    };
  }

  render() {
    return (
      <View style={styles.total}>
        <View style={styles.AppName}>
          <Text style={{ fontSize: 50 }}>
            Hi!
          </Text>
        </View>
        <View style={styles.Inputs}>
          <Sae
          label="Email"
          iconClass={FontAwesomeIcon}
          iconName="pencil"
          iconColor="white"
          inputPadding={16}
          labelHeight={24}
          borderHeight={2}
          autoCapitalize="none"
          autoCorrect={false}
          />
          <Sae
          label="Password"
          iconClass={FontAwesomeIcon}
          iconName="pencil"
          iconColor="white"
          inputPadding={16}
          labelHeight={24}
          borderHeight={2}
          autoCapitalize="none"
          autoCorrect={false}
          />
        </View>
      </View>
    );
  }
}
const styles = StyleSheet.create({
  total: {
    flex: 1,
    backgroundColor: 'red',
  },
  AppName: {
    flex: 4,
    backgroundColor: 'green',
    alignItems: 'center',
    justifyContent: 'center',
  },
  Inputs: {
    flex: 5,
    backgroundColor: 'blue',
    alignItems: 'center',
    justifyContent: 'center',
  },
});
export default Signup;

FirstPage.js

import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { Button } from 'react-native-textinput-effects';

function FirstPage({ navigation }) {
  return (
    <View style={styles.total}>
      <View style={styles.AppName}>
        <Text style={{ fontSize: 50 }}>
            SMS
        </Text>
      </View>
      <View style={styles.Buttons}>
        <Button
          type="OutLine"
          title="Login"
          containerStyle={{ width: 110, height: 45, margin: 10 }}
          titleStyle={{ fontSize: 25 }}
          onPress={() => navigation.navigate('Login Screen')}
          />
        <Button
          type="OutLine"
          title="Sign up"
          containerStyle={{ width: 110, height: 45, margin: 10 }}
          titleStyle={{ fontSize: 25 }}
          onPress={() => navigation.navigate('Signup Screen')}
          />
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  total: {
    flex: 1,
  },
  AppName: {
    flex: 4,
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: 'green',
  },
  Buttons: {
    flex: 4.5,
    backgroundColor: 'yellow',
    alignItems: 'center',
    justifyContent: 'center',
  },
});
export default FirstPage;

https://github.com/facebook/react-native/issues/34688

I found it, but it seemed there's no solution.


来源: stackexchange

问:
prioritize group in sequelize
I have a table named Products that is associated with another table named BaseProducts.
for getting the list of Products, I need to group the Products with BaseProductId.
but the problem is that I need to return only those products that has more quantity and the most cheapest. so I used Order. but it does not work.

```<code>    const e = await Product.findAll({
        order: [
            ["quantity", "DESC"],
            ["price", "ASC"],
            ["name", "ASC"]
        ],
        group: "baseProductId",
        limit:  100,
        offset: 0,
    });
</code>```

here it's like it returns random items when using group. but I want to only include those Items that has first, more Quantity, second the most cheapest, and third sort alphabetically.

here is the sql generated by sequelize:

```<code>SELECT `id`, `name`, `nameEn`, `sku`, `barcode`, `quantity`, `price`, `finalPrice`, `sort`, `status`, `kianSync`, `createdAt`, `updatedAt`, `deletedAt`, `baseProductId` FROM `Products` AS `Product`
WHERE (`Product`.`deletedAt` IS NULL)
GROUP BY `baseProductId`
ORDER BY `Product`.`quantity` DESC, `Product`.`price` ASC, `Product`.`name` ASC
LIMIT 0, 100;
</code>```

this is with group by:

```<code>[
        {
            "id": "3d2d181a-23f9-47b6-abee-ab61d1a86d02",
            "name": "rrrrrrrr",
            "nameEn": "nameEn",
            "sku": "sku",
            "barcode": "barcode",
            "quantity": 1,
            "price": 1000,
            "finalPrice": 1000,
            "sort": 1,
            "status": "status",
            "kianSync": 1,
            "createdAt": "2023-01-02T06:53:26.000Z",
            "updatedAt": "2023-01-02T06:53:26.000Z",
            "deletedAt": null,
            "baseProductId": null
        }
    ]
</code>```

this is without group by:

```<code>[
        {
            "id": "83939936-2c40-4921-9046-e40a1313bf77",
            "name": "rrrrrrrr",
            "nameEn": "nameEn",
            "sku": "sku",
            "barcode": "barcode",
            "quantity": 2,
            "price": 1000,
            "finalPrice": 1000,
            "sort": 2,
            "status": "status",
            "kianSync": 1,
            "createdAt": "2023-01-02T06:53:26.000Z",
            "updatedAt": "2023-01-02T06:53:26.000Z",
            "deletedAt": null,
            "baseProductId": null
        },
        {
            "id": "8184b96c-1175-4de2-98c4-9faf231dabdc",
            "name": "rrrrrrrr",
            "nameEn": "nameEn",
            "sku": "sku",
            "barcode": "barcode",
            "quantity": 2,
            "price": 2000,
            "finalPrice": 2000,
            "sort": 3,
            "status": "status",
            "kianSync": 1,
            "createdAt": "2023-01-02T06:53:26.000Z",
            "updatedAt": "2023-01-02T06:53:26.000Z",
            "deletedAt": null,
            "baseProductId": null
        },
        {
            "id": "3d2d181a-23f9-47b6-abee-ab61d1a86d02",
            "name": "rrrrrrrr",
            "nameEn": "nameEn",
            "sku": "sku",
            "barcode": "barcode",
            "quantity": 1,
            "price": 1000,
            "finalPrice": 1000,
            "sort": 1,
            "status": "status",
            "kianSync": 1,
            "createdAt": "2023-01-02T06:53:26.000Z",
            "updatedAt": "2023-01-02T06:53:26.000Z",
            "deletedAt": null,
            "baseProductId": null
        }
    ]
</code>```

ContentLicense: CC BY-SA 4.0

Title: prioritize group in sequelize

Body:
I have a table named Products that is associated with another table named BaseProducts.
for getting the list of Products, I need to group the Products with BaseProductId.
but the problem is that I need to return only those products that has more quantity and the most cheapest. so I used Order. but it does not work.

    const e = await Product.findAll({
        order: [
            ["quantity", "DESC"],
            ["price", "ASC"],
            ["name", "ASC"]
        ],
        group: "baseProductId",
        limit:  100,
        offset: 0,
    });

here it's like it returns random items when using group. but I want to only include those Items that has first, more Quantity, second the most cheapest, and third sort alphabetically.

here is the sql generated by sequelize:

SELECT `id`, `name`, `nameEn`, `sku`, `barcode`, `quantity`, `price`, `finalPrice`, `sort`, `status`, `kianSync`, `createdAt`, `updatedAt`, `deletedAt`, `baseProductId` FROM `Products` AS `Product`
WHERE (`Product`.`deletedAt` IS NULL)
GROUP BY `baseProductId`
ORDER BY `Product`.`quantity` DESC, `Product`.`price` ASC, `Product`.`name` ASC
LIMIT 0, 100;

this is with group by:

[
        {
            "id": "3d2d181a-23f9-47b6-abee-ab61d1a86d02",
            "name": "rrrrrrrr",
            "nameEn": "nameEn",
            "sku": "sku",
            "barcode": "barcode",
            "quantity": 1,
            "price": 1000,
            "finalPrice": 1000,
            "sort": 1,
            "status": "status",
            "kianSync": 1,
            "createdAt": "2023-01-02T06:53:26.000Z",
            "updatedAt": "2023-01-02T06:53:26.000Z",
            "deletedAt": null,
            "baseProductId": null
        }
    ]

this is without group by:

[
        {
            "id": "83939936-2c40-4921-9046-e40a1313bf77",
            "name": "rrrrrrrr",
            "nameEn": "nameEn",
            "sku": "sku",
            "barcode": "barcode",
            "quantity": 2,
            "price": 1000,
            "finalPrice": 1000,
            "sort": 2,
            "status": "status",
            "kianSync": 1,
            "createdAt": "2023-01-02T06:53:26.000Z",
            "updatedAt": "2023-01-02T06:53:26.000Z",
            "deletedAt": null,
            "baseProductId": null
        },
        {
            "id": "8184b96c-1175-4de2-98c4-9faf231dabdc",
            "name": "rrrrrrrr",
            "nameEn": "nameEn",
            "sku": "sku",
            "barcode": "barcode",
            "quantity": 2,
            "price": 2000,
            "finalPrice": 2000,
            "sort": 3,
            "status": "status",
            "kianSync": 1,
            "createdAt": "2023-01-02T06:53:26.000Z",
            "updatedAt": "2023-01-02T06:53:26.000Z",
            "deletedAt": null,
            "baseProductId": null
        },
        {
            "id": "3d2d181a-23f9-47b6-abee-ab61d1a86d02",
            "name": "rrrrrrrr",
            "nameEn": "nameEn",
            "sku": "sku",
            "barcode": "barcode",
            "quantity": 1,
            "price": 1000,
            "finalPrice": 1000,
            "sort": 1,
            "status": "status",
            "kianSync": 1,
            "createdAt": "2023-01-02T06:53:26.000Z",
            "updatedAt": "2023-01-02T06:53:26.000Z",
            "deletedAt": null,
            "baseProductId": null
        }
    ]


问:
C# EF6 | The problem of reserving an identity without adding a row in case an exception occurred in data entry
I have an identity problem An exception occurred while entering data into the table And suddenly he records an identity every time an exception occurs

Example:

Before insert data:

after intentional any exception:

I entered correct data after the last error occurred
He added the row with an unordered identity
Identity 3 is missing

```<code>public async Task<T?> CreateAsync(T entity)
        {
            using RetailDbContext context = _contextFactory.CreateDbContext();
            EntityEntry<T> createResult = await context.Set<T>().AddAsync(entity);
            await context.SaveChangesAsync();
            return createResult.Entity;
        }
</code>```

insert unordered identity

Body:
I have an identity problem An exception occurred while entering data into the table And suddenly he records an identity every time an exception occurs

Example:

Before insert data:

after intentional any exception:

I entered correct data after the last error occurred
He added the row with an unordered identity
Identity 3 is missing

public async Task<T?> CreateAsync(T entity)
        {
            using RetailDbContext context = _contextFactory.CreateDbContext();
            EntityEntry<T> createResult = await context.Set<T>().AddAsync(entity);
            await context.SaveChangesAsync();
            return createResult.Entity;
        }

insert unordered identity


问:
How to utilize a function defined in another component in other components in React
I have a component A

```<code>export default const A = () => {
    const GetItemX = () => {
        alert("Devine calling);
    }

    const GetItemY = () => {
        alert("Another function in this component");
    }
}
</code>```

And another component B

```<code>export default const B = () => {
    const callGetItemX = getItemX();
    }
}
</code>```

How would I get the function getItemX to work inside component B?

Body:
I have a component A

export default const A = () => {
    const GetItemX = () => {
        alert("Devine calling);
    }

    const GetItemY = () => {
        alert("Another function in this component");
    }
}

And another component B

export default const B = () => {
    const callGetItemX = getItemX();
    }
}

How would I get the function getItemX to work inside component B?


问:
Add export definitions for multiple files
My goal is to add typings to an existing JS project for intellisense (Visual Studio Code). There are several files (one for each "command") that all need to export the same things.

These types are intended to stay separate (only appear in code comments and external files). I have a definitions file for this. Each command file references this same definition file.

But looking at the result, none of the type information (that is not implied by the code) is being picked up in the source file. Is this the proper way to do this and what is being done wrong?

A command:

/// <reference path="../cmd.d.ts" />

export const cmd = new SlashCommandBuilder();

// Does not say what pnone was supposed to return
export const perms = pnone()

// Does not know what interactions is or the return type
export async function execute(interaction) {

}
```
<p>The definition (cmd.d.ts):</p>
<pre class="lang-js prettyprint-override"><code>export const cmd: SlashCommandBuilder

export const perms: (interaction: Interaction) => boolean

export async function execute(interaction: Interaction): Promise<void>
</code>```

Body:
My goal is to add typings to an existing JS project for intellisense (Visual Studio Code). There are several files (one for each "command") that all need to export the same things.

These types are intended to stay separate (only appear in code comments and external files). I have a definitions file for this. Each command file references this same definition file.

But looking at the result, none of the type information (that is not implied by the code) is being picked up in the source file. Is this the proper way to do this and what is being done wrong?

A command:

/// <reference path="../cmd.d.ts" />

export const cmd = new SlashCommandBuilder();

// Does not say what pnone was supposed to return
export const perms = pnone()

// Does not know what interactions is or the return type
export async function execute(interaction) {

}

The definition (cmd.d.ts):

export const cmd: SlashCommandBuilder

export const perms: (interaction: Interaction) => boolean

export async function execute(interaction: Interaction): Promise<void>


问:
Spring @CookieValue is null while sending request from POSTMAN
From chrome browser When i send request to endpoint /slogin, cookie value is getting set and also i am able to retrieve the same value in endpoint rlogin but when i am sending it from POSTMAN i am not able to get refreshToken cookie value in endpoint rlogin , how can i make it working?

Setting cookie like this

```<code>@PostMapping(path = "/slogin", consumes = MediaType.APPLICATION_JSON_VALUE)
private ResponseEntity<String> loginUser(@Valid @RequestBody User user)
.....
.....
ResponseCookie springCookie = ResponseCookie.from("refresh-tokens", refreshToken)
        .httpOnly(true)
        .secure(true)
        .path("/auth/rlogin")
        .maxAge(60)//30days=2592000
        .sameSite("None")
        .domain("localhost")
        .build();
</code>```

This is refreshToken coming as null

```<code>@PostMapping(path = "/rlogin")
 private ResponseEntity<String> refreshLoginUser(@CookieValue(name = "refresh-tokens", defaultValue = "null") String refreshToken)
         throws ClientProtocolException, IOException {
     try {
         HttpClient httpclient = HttpClientBuilder.create().build();
</code>```

springsecurity

```<code>package com.webservice.ansoftsys.configs;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.Ordered;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.oauth2.provider.token.DefaultTokenServices;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;

@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class SecurityConfig extends WebSecurityConfigurerAdapter {

   @Value("${security.signing-key}")
   private String signingKey;

   @Value("${security.encoding-strength}")
   private Integer encodingStrength;

   @Value("${security.security-realm}")
   private String securityRealm;

   @Bean
   @Override
   protected AuthenticationManager authenticationManager() throws Exception {
      return super.authenticationManager();
   }

   @Bean
   public BCryptPasswordEncoder passwordEncoder() {
      return new BCryptPasswordEncoder();
   }

   @Override
   protected void configure(HttpSecurity http) throws Exception {
      http
              .sessionManagement()
              .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
              .and()
              .httpBasic()
              .realmName(securityRealm)
              .and()
              .csrf()
              .disable();

   }

   @Bean
   public JwtAccessTokenConverter accessTokenConverter() {
      JwtAccessTokenConverter converter = new JwtAccessTokenConverter();
      converter.setSigningKey(signingKey);
      return converter;
   }

   @Bean
   public TokenStore tokenStore() {
      return new JwtTokenStore(accessTokenConverter());
   }

   @Bean
   @Primary
    //Making this primary to avoid any accidental duplication with another token service instance of the same name
   public DefaultTokenServices tokenServices() {
      DefaultTokenServices defaultTokenServices = new DefaultTokenServices();
      defaultTokenServices.setTokenStore(tokenStore());
      defaultTokenServices.setSupportRefreshToken(true);
      return defaultTokenServices;
   }

   @Bean
   public FilterRegistrationBean<CorsFilter> corsFilter() {
       UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
       CorsConfiguration config = new CorsConfiguration();
       config.setAllowCredentials(true);
       config.addAllowedOriginPattern("*");
       config.addAllowedHeader("*");
       config.addAllowedMethod("*");
      config.setAllowCredentials(true);
       source.registerCorsConfiguration("/**", config);
       FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source));
       bean.setOrder(Ordered.HIGHEST_PRECEDENCE);
       return bean;
   }

}
</code>```

enter image description here
enter image description here

I have tried the above code, i am expecting the cookie value to be available in the endpoint rlogin

Body:
From chrome browser When i send request to endpoint /slogin, cookie value is getting set and also i am able to retrieve the same value in endpoint rlogin but when i am sending it from POSTMAN i am not able to get refreshToken cookie value in endpoint rlogin , how can i make it working?

Setting cookie like this

@PostMapping(path = "/slogin", consumes = MediaType.APPLICATION_JSON_VALUE)
private ResponseEntity<String> loginUser(@Valid @RequestBody User user)
.....
.....
ResponseCookie springCookie = ResponseCookie.from("refresh-tokens", refreshToken)
        .httpOnly(true)
        .secure(true)
        .path("/auth/rlogin")
        .maxAge(60)//30days=2592000
        .sameSite("None")
        .domain("localhost")
        .build();

This is refreshToken coming as null

@PostMapping(path = "/rlogin")
 private ResponseEntity<String> refreshLoginUser(@CookieValue(name = "refresh-tokens", defaultValue = "null") String refreshToken)
         throws ClientProtocolException, IOException {
     try {
         HttpClient httpclient = HttpClientBuilder.create().build();

springsecurity

package com.webservice.ansoftsys.configs;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.Ordered;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.oauth2.provider.token.DefaultTokenServices;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;

@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class SecurityConfig extends WebSecurityConfigurerAdapter {

   @Value("${security.signing-key}")
   private String signingKey;

   @Value("${security.encoding-strength}")
   private Integer encodingStrength;

   @Value("${security.security-realm}")
   private String securityRealm;

   @Bean
   @Override
   protected AuthenticationManager authenticationManager() throws Exception {
      return super.authenticationManager();
   }

   @Bean
   public BCryptPasswordEncoder passwordEncoder() {
      return new BCryptPasswordEncoder();
   }

   @Override
   protected void configure(HttpSecurity http) throws Exception {
      http
              .sessionManagement()
              .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
              .and()
              .httpBasic()
              .realmName(securityRealm)
              .and()
              .csrf()
              .disable();

   }

   @Bean
   public JwtAccessTokenConverter accessTokenConverter() {
      JwtAccessTokenConverter converter = new JwtAccessTokenConverter();
      converter.setSigningKey(signingKey);
      return converter;
   }

   @Bean
   public TokenStore tokenStore() {
      return new JwtTokenStore(accessTokenConverter());
   }

   @Bean
   @Primary
    //Making this primary to avoid any accidental duplication with another token service instance of the same name
   public DefaultTokenServices tokenServices() {
      DefaultTokenServices defaultTokenServices = new DefaultTokenServices();
      defaultTokenServices.setTokenStore(tokenStore());
      defaultTokenServices.setSupportRefreshToken(true);
      return defaultTokenServices;
   }

   @Bean
   public FilterRegistrationBean<CorsFilter> corsFilter() {
       UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
       CorsConfiguration config = new CorsConfiguration();
       config.setAllowCredentials(true);
       config.addAllowedOriginPattern("*");
       config.addAllowedHeader("*");
       config.addAllowedMethod("*");
      config.setAllowCredentials(true);
       source.registerCorsConfiguration("/**", config);
       FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source));
       bean.setOrder(Ordered.HIGHEST_PRECEDENCE);
       return bean;
   }

}

enter image description here
enter image description here

I have tried the above code, i am expecting the cookie value to be available in the endpoint rlogin


问:
OAuth authentication won't redirect to app
I am trying to create app that connects to "Microsoft Dynamics 365" using OAuth, I have found that "aad_oauth.dart" would help me to get the authentication token by allowing the user to enter the email & password and return the token, I managed to setup everything but my issue now is when the user log in through the web page, it shows this message and never go back to the app again:

Error Message when the user logged in.

Here is the code I used to do the authentication

```<code>  static final Config config = Config(
      tenant: '00000000-0000-0000-0000-000000000000',
      clientId: '00000000-0000-0000-0000-000000000000',
      scope: 'openid profile offline_access',
      navigatorKey: navigatorKey,
      redirectUri: "com.example.flutterApplication2://msauthv2",
      loader: SizedBox());
  final AadOAuth oauth = AadOAuth(config);

final result = await oauth.login();
</code>```

Body:
I am trying to create app that connects to "Microsoft Dynamics 365" using OAuth, I have found that "aad_oauth.dart" would help me to get the authentication token by allowing the user to enter the email & password and return the token, I managed to setup everything but my issue now is when the user log in through the web page, it shows this message and never go back to the app again:

Error Message when the user logged in.

Here is the code I used to do the authentication

  static final Config config = Config(
      tenant: '00000000-0000-0000-0000-000000000000',
      clientId: '00000000-0000-0000-0000-000000000000',
      scope: 'openid profile offline_access',
      navigatorKey: navigatorKey,
      redirectUri: "com.example.flutterApplication2://msauthv2",
      loader: SizedBox());
  final AadOAuth oauth = AadOAuth(config);

final result = await oauth.login();


问:
php is not changing header to application/json ( data sent from python to get json response)
Hi I have this php code:

```<code><?php
$firstname = htmlspecialchars($_GET["firstname"]);
$lastname = htmlspecialchars($_GET["lastname"]);
$password = htmlspecialchars($_GET["password"]);
$result['username']=$firstname;
header('Content-Type: application/json; charset=utf-8');
echo json_encode($result);
exit ;
?>
</code>```

And this python code:

```<code>import requests
def send(firstname,lastname,password):
    userdata = {"firstname": firstname, "lastname":lastname , "password": password}
    resp = requests.post('http://www.example.com/php.php', params=userdata)
    print ( 'Content-Type:'  )
    print( resp.headers['Content-Type'])
    getdata = resp.json()
    print (getdata[ 'username'  ]  )

send('yama','last','password')
</code>```

My python output is:

```<code>Content-Type:
text/html

Traceback (most recent call last):
  File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>
    start(fakepyfile,mainpyfile)
  File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
    exec(open(mainpyfile).read(),  __main__.__dict__)
  File "<string>", line 35, in <module>
  File "<string>", line 32, in send
  File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</code>```

So you can see in my output that Content-Type:
text/html and it is not application/json, What should I do?
I know this question is dublicated but I tryed everything on stackoverflow answers and my codes still not working for me!

Body:
Hi I have this php code:

<?php
$firstname = htmlspecialchars($_GET["firstname"]);
$lastname = htmlspecialchars($_GET["lastname"]);
$password = htmlspecialchars($_GET["password"]);
$result['username']=$firstname;
header('Content-Type: application/json; charset=utf-8');
echo json_encode($result);
exit ;
?>

And this python code:

import requests
def send(firstname,lastname,password):
    userdata = {"firstname": firstname, "lastname":lastname , "password": password}
    resp = requests.post('http://www.example.com/php.php', params=userdata)
    print ( 'Content-Type:'  )
    print( resp.headers['Content-Type'])
    getdata = resp.json()
    print (getdata[ 'username'  ]  )

send('yama','last','password')

My python output is:

Content-Type:
text/html

Traceback (most recent call last):
  File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>
    start(fakepyfile,mainpyfile)
  File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
    exec(open(mainpyfile).read(),  __main__.__dict__)
  File "<string>", line 35, in <module>
  File "<string>", line 32, in send
  File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

So you can see in my output that Content-Type:
text/html and it is not application/json, What should I do?
I know this question is dublicated but I tryed everything on stackoverflow answers and my codes still not working for me!


问:
How to use React Navigation with endless routes?
I have an app where users can navigate almost endlessly to new screens (I'm using Stack Navigator). There are about 15 different screens, but every screen can be opened with a huge number of different IDs (showing data for different companies, etc). For example in the Company route, the user can open many different Person screens based on employees, and again from Person screens the user can navigate to many different screens, so the navigation is basically endless.

Because React Navigation keeps all screens in memory, after navigating maybe 20-30 different screens, the app becomes very laggy. And because the number of routes is basically endless, it's impossible to keep all screens in memory.

I end up replacing the screen (navigation.replace) instead of pushing it when the user navigates to a new screen. That way there is only one screen in the memory at a time. I also made an array where I push the name and parameters of the new route every time, so when user goes back, I get the previous routes from that array and I replace current screen with the screen from that history array. It works fine, but of course, going back is not as fast as using React Navigation in the standard way.

So the first question: what is the most efficient and CORRECT way of using React Navigation in my case?

Second question: because I have just one screen on React Navigation's history, the swipe back does not work on iOS. Is there an easy way to change swipe back to call my own back function instead of React Navigation's default back?


问:
Registration user with uploading image
i tried to create API using Laravel 8 and here are my code for register new user

```<code> public function register(Request $request)
    {

          $validasi = $request->validate([
            'name' => 'required|string|max:255',
            'email' => 'required|string|email|max:255|unique:users',
            'user_id' => 'unique:users',
            'password' => 'required|string|min:8',
            'foto_ktp' => 'file|mimes:png,jpg',
        ]);
        try {
            $fileName = time() . $request->file('foto_ktp')->getClientOriginalName();
            $path = $request->file('foto_ktp')->storeAs('uploads/foto_ktp', $fileName);
            $validasi['foto_ktp'] = $path;

            $user = User::create([
                'name' => $request->name,
                'email' => $request->email,
                'user_id' => $request->id,
                'foto_ktp' => $request->foto_ktp,
                'password' => Hash::make($request->password),
            ]);
            $user->save();

            $token = $user->createToken('auth_token')->plainTextToken;

            return response()->json([
                'data' => $user,
                'message' => 'Account Has Successfully Created',
                'token' => $token,
                'token_type' => 'Bearer',
                'code' => 200
            ]);
        } catch (\Exception $e) {
            return response()->json([
                'message' => 'Something wrong, user was not resgistered successfully',
                'errors' => $e->getMessage(),

            ]);
        }
    }
</code>```

when i tried the routes of API in Postman, the data will return like this

```<code>{
    "data": {
        "name": "test",
        "email": "test@gmail.com",
        "updated_at": "2023-01-02T06:54:01.000000Z",
        "created_at": "2023-01-02T06:54:01.000000Z",
        "id": 22,
        "foto_ktp": {}
    },
    "message": "Account Has Successfully Created",
    "token": "19|RXUZB40Oc35XCY4OMU6TPpqLJsmTRdFVpqsdNaS5",
    "token_type": "Bearer",
    "code": 200
}
</code>```

foto_ktp will return {} and i checked it in database, foto_ktp field will store this data C:\xampp\tmp\php53D.tmp

I'm quite new in Laravel and i have tried to search any references but i haven't gotten it. Is there any suggestion what should i do? I used Laravel 8 for developing the API

Title: Registration user with uploading image

Body:
i tried to create API using Laravel 8 and here are my code for register new user

 public function register(Request $request)
    {

          $validasi = $request->validate([
            'name' => 'required|string|max:255',
            'email' => 'required|string|email|max:255|unique:users',
            'user_id' => 'unique:users',
            'password' => 'required|string|min:8',
            'foto_ktp' => 'file|mimes:png,jpg',
        ]);
        try {
            $fileName = time() . $request->file('foto_ktp')->getClientOriginalName();
            $path = $request->file('foto_ktp')->storeAs('uploads/foto_ktp', $fileName);
            $validasi['foto_ktp'] = $path;

            $user = User::create([
                'name' => $request->name,
                'email' => $request->email,
                'user_id' => $request->id,
                'foto_ktp' => $request->foto_ktp,
                'password' => Hash::make($request->password),
            ]);
            $user->save();

            $token = $user->createToken('auth_token')->plainTextToken;

            return response()->json([
                'data' => $user,
                'message' => 'Account Has Successfully Created',
                'token' => $token,
                'token_type' => 'Bearer',
                'code' => 200
            ]);
        } catch (\Exception $e) {
            return response()->json([
                'message' => 'Something wrong, user was not resgistered successfully',
                'errors' => $e->getMessage(),

            ]);
        }
    }

when i tried the routes of API in Postman, the data will return like this

{
    "data": {
        "name": "test",
        "email": "test@gmail.com",
        "updated_at": "2023-01-02T06:54:01.000000Z",
        "created_at": "2023-01-02T06:54:01.000000Z",
        "id": 22,
        "foto_ktp": {}
    },
    "message": "Account Has Successfully Created",
    "token": "19|RXUZB40Oc35XCY4OMU6TPpqLJsmTRdFVpqsdNaS5",
    "token_type": "Bearer",
    "code": 200
}

foto_ktp will return {} and i checked it in database, foto_ktp field will store this data C:\xampp\tmp\php53D.tmp

I'm quite new in Laravel and i have tried to search any references but i haven't gotten it. Is there any suggestion what should i do? I used Laravel 8 for developing the API


问:
How can I insert a JSON array in to a postgres column that is of type JSON[]?
I am trying to get some test data in to a column inside a PostgreSQL table, seems simple enough but have tried the following methods using pgAdmin 4 and nothing works. It is simply an array of JSON objects that will later be read in by a spring entity it is mapped to.

Simply using the GUI to double click a box in a row under the column

Expected - saves the JSON array

Actual - can not save

```<code>[{
    "appName": "UCRM",
    "scopes": [
      "read",
      "write"
    ]
  },
  {
    "appName": "OCTA",
    "scopes": [
      "read",
      "write",
      "delete"
    ]
  }]
</code>```

error after trying to save the above JSON

using a script to insert the same data to every row that has that column

Expected - saves JSON array to every column "app_acl" for every row

Actual - It does insert in to the table but, saves a invalid JSON array and making it useless as shown below

script in question:

```<code>UPDATE application_acl SET app_acl = array[
  '{
    "appName": "UCRM",
    "scopes": [
      "read",
      "write"
    ]
  }',
  '{
    "appName": "OCTA",
    "scopes": [
      "read",
      "write",
      "delete"
    ]
  }'
]::json[];

</code>```

output:

```<code>{"{
    \"appName\": \"UCRM\",
    \"scopes\": [
      \"read\",
      \"write\"
    ]
  }","{
    \"appName\": \"OCTA\",
    \"scopes\": [
      \"read\",
      \"write\",
      \"delete\"
    ]
  }"}
</code>```

Body:
I am trying to get some test data in to a column inside a PostgreSQL table, seems simple enough but have tried the following methods using pgAdmin 4 and nothing works. It is simply an array of JSON objects that will later be read in by a spring entity it is mapped to.

Simply using the GUI to double click a box in a row under the column

Expected - saves the JSON array

Actual - can not save

[{
    "appName": "UCRM",
    "scopes": [
      "read",
      "write"
    ]
  },
  {
    "appName": "OCTA",
    "scopes": [
      "read",
      "write",
      "delete"
    ]
  }]

error after trying to save the above JSON

using a script to insert the same data to every row that has that column

Expected - saves JSON array to every column "app_acl" for every row

Actual - It does insert in to the table but, saves a invalid JSON array and making it useless as shown below

script in question:

UPDATE application_acl SET app_acl = array[
  '{
    "appName": "UCRM",
    "scopes": [
      "read",
      "write"
    ]
  }',
  '{
    "appName": "OCTA",
    "scopes": [
      "read",
      "write",
      "delete"
    ]
  }'
]::json[];

output:

{"{
    \"appName\": \"UCRM\",
    \"scopes\": [
      \"read\",
      \"write\"
    ]
  }","{
    \"appName\": \"OCTA\",
    \"scopes\": [
      \"read\",
      \"write\",
      \"delete\"
    ]
  }"}


问:
Axios response body is not returned for HTTP Response 400 when responseType is set to blob
I'm using Axios and its interceptors to exchagne data with the API.

However, recently I noticed that when API returns HTTP Status Code 400, meaning that I have not sent parameters correctly, Axios does not show me the HTTP Response Message's body.

This is an example of request/response from Chrome's Network tab:

```<code>Request URL: https://api.example.com/blobProxy/get?url=
Request Method: GET
Status Code: 400
Remote Address: 127.0.0.1:443
Referrer Policy: strict-origin-when-cross-origin
</code>```

And this is the response body that API sends back, which I can see in the Response tab of the Networks tab when I select the request:

```<code>{
  "type": "Error",
  "text": "Ensure validation: string is either null, or whitespace."
}
</code>```

And in my interceptor, I check error.response.status === 400 then access the response body using error.response.data and log it to console. But this is what I get:

```<code>Api.jsx:89 Uncaught (in promise) Error: 601
application/json
function arrayBuffer() { [native code] }
function slice() { [native code] }
function stream() { [native code] }
function text() { [native code] }

    at errorInterceptor (Api.jsx:89:11)
    at async download (Api.jsx:129:10)
</code>```

This is my download method:

```<code>const download = async (url) => {
  return await
    axiosApi.get(url, {
      crossDomain: true,
      responseType: 'blob'
    })
      .then(response => new File([response?.data], 'File'))
}
</code>```

How can I get response data in Axios when the error is 400 and the responseType is set to blob?

Body:
I'm using Axios and its interceptors to exchagne data with the API.

However, recently I noticed that when API returns HTTP Status Code 400, meaning that I have not sent parameters correctly, Axios does not show me the HTTP Response Message's body.

This is an example of request/response from Chrome's Network tab:

Request URL: https://api.example.com/blobProxy/get?url=
Request Method: GET
Status Code: 400
Remote Address: 127.0.0.1:443
Referrer Policy: strict-origin-when-cross-origin

And this is the response body that API sends back, which I can see in the Response tab of the Networks tab when I select the request:

{
  "type": "Error",
  "text": "Ensure validation: string is either null, or whitespace."
}

And in my interceptor, I check error.response.status === 400 then access the response body using error.response.data and log it to console. But this is what I get:

Api.jsx:89 Uncaught (in promise) Error: 601
application/json
function arrayBuffer() { [native code] }
function slice() { [native code] }
function stream() { [native code] }
function text() { [native code] }

    at errorInterceptor (Api.jsx:89:11)
    at async download (Api.jsx:129:10)

This is my download method:

const download = async (url) => {
  return await
    axiosApi.get(url, {
      crossDomain: true,
      responseType: 'blob'
    })
      .then(response => new File([response?.data], 'File'))
}

How can I get response data in Axios when the error is 400 and the responseType is set to blob?


问:
Django generate thumbnail from video, but it encodes it
Im using django-video-encoding this and django-rq to generate a thumbnail but instead it generates another video AND it makes it smaller(in size)

here is signals.py:

```<code>`
from django.db.models.signals import post_save
from django.dispatch import receiver
from typing import Type
from . import tasks , signals
from .models import Post
from django_rq import enqueue

@receiver(post_save, sender=Post)
def create_thumbnail(sender, instance, **kwargs):
    enqueue(tasks.create_thumbnail, instance.pk)

</code>```

here is tasks.py:

```<code>`
from django.core.files import File
from video_encoding.backends import get_backend
import os
from .models import Post

def create_thumbnail(post_pk):
   video = Post.objects.get(pk=post_pk)
   if not video.video:
      print('no video file attached')
      # no video file attached

   if video.thumbnail:
        print('thumbnail has already been generated')
      # thumbnail has already been generated

   encoding_backend = get_backend()
   thumbnail_path = encoding_backend.get_thumbnail(video.video.path)
   path = video.video.url
   filename = os.path.basename(path),

   try:
      with open(thumbnail_path, 'rb') as file_handler:
         django_file = File(file_handler)
         video.thumbnail.save(filename[0], django_file)
      video.save()
   finally:
      os.unlink(thumbnail_path)`
</code>```

and models.py:

```<code>`from django.db import models
from django.contrib.auth.models import User
from django.core.validators import FileExtensionValidator
from django.contrib.contenttypes.fields import GenericRelation
from video_encoding.fields import VideoField, ImageField
from video_encoding.models import Format

class Post(models.Model):
    author = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
    title = models.CharField(max_length=500)
    description = models.TextField()
    format_set = GenericRelation(Format)
    video = VideoField(upload_to='uploads/video_files/%y/%d', validators =  [FileExtensionValidator(allowed_extensions=['mp4'])])
    thumbnail = ImageField(blank=True)
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

    def __str__(self) -> str:
        return self.title + "\n" + self.description`
</code>```

I want just to generate a thumbnail at this point, maybe encode videos later, but i honesty have no idea what im doing, i just followed the tutorial from github.

Here are some more detailed photos from the dajngo-rq:

pic - rq work log

pic1 - post in admin panel

pic2 - django-rq

I dont understand why it encodes videos when there is no encode task, from the examples ive seen on github there should be a 'convert_video' in signals.py but in mine is none

Body:
Im using django-video-encoding this and django-rq to generate a thumbnail but instead it generates another video AND it makes it smaller(in size)

here is signals.py:

`
from django.db.models.signals import post_save
from django.dispatch import receiver
from typing import Type
from . import tasks , signals
from .models import Post
from django_rq import enqueue

@receiver(post_save, sender=Post)
def create_thumbnail(sender, instance, **kwargs):
    enqueue(tasks.create_thumbnail, instance.pk)

here is tasks.py:

`
from django.core.files import File
from video_encoding.backends import get_backend
import os
from .models import Post

def create_thumbnail(post_pk):
   video = Post.objects.get(pk=post_pk)
   if not video.video:
      print('no video file attached')
      # no video file attached

   if video.thumbnail:
        print('thumbnail has already been generated')
      # thumbnail has already been generated

   encoding_backend = get_backend()
   thumbnail_path = encoding_backend.get_thumbnail(video.video.path)
   path = video.video.url
   filename = os.path.basename(path),

   try:
      with open(thumbnail_path, 'rb') as file_handler:
         django_file = File(file_handler)
         video.thumbnail.save(filename[0], django_file)
      video.save()
   finally:
      os.unlink(thumbnail_path)`

and models.py:

`from django.db import models
from django.contrib.auth.models import User
from django.core.validators import FileExtensionValidator
from django.contrib.contenttypes.fields import GenericRelation
from video_encoding.fields import VideoField, ImageField
from video_encoding.models import Format

class Post(models.Model):
    author = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
    title = models.CharField(max_length=500)
    description = models.TextField()
    format_set = GenericRelation(Format)
    video = VideoField(upload_to='uploads/video_files/%y/%d', validators =  [FileExtensionValidator(allowed_extensions=['mp4'])])
    thumbnail = ImageField(blank=True)
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

    def __str__(self) -> str:
        return self.title + "\n" + self.description`

I want just to generate a thumbnail at this point, maybe encode videos later, but i honesty have no idea what im doing, i just followed the tutorial from github.

Here are some more detailed photos from the dajngo-rq:

pic - rq work log

pic1 - post in admin panel

pic2 - django-rq

I dont understand why it encodes videos when there is no encode task, from the examples ive seen on github there should be a 'convert_video' in signals.py but in mine is none


问:
Canvas is not showing the output on page reload but on hot-reload it does in React
i've been trying working on Canvas inside React but once i'm reloading the page its not showing output but if i'm changing anything in the code with hot-reload it is showing the output,

const [screenWidth, setScreenWidth] = useState(1);
const [screenHeight, setScreenHeight] = useState(2527);
const canvasRef = useRef(null);

useEffect(() => {
    const canvas = canvasRef.current
    const ctx = canvas.getContext('2d')
    function windowResizeOnLoad() {
        setScreenWidth((window.innerWidth-2));
    };
    function windowResizeOnResize() {
        setScreenWidth((window.innerWidth - 2));
    };
    windowResizeOnLoad();
    window.addEventListener('resize', windowResizeOnResize);

    ctx.beginPath();
    ctx.strokeStyle = '#D4AF38';
    ctx.moveTo(100, 10);
    ctx.bezierCurveTo(100, 90, 1100, 320, 100, 600);
    ctx.stroke();
}, [])```
<pre class="snippet-code-html lang-html prettyprint-override"><code><canvas width={screenWidth} height={screenHeight} ref={canvasRef}></canvas></code>```

Body:
i've been trying working on Canvas inside React but once i'm reloading the page its not showing output but if i'm changing anything in the code with hot-reload it is showing the output,

const [screenWidth, setScreenWidth] = useState(1);
const [screenHeight, setScreenHeight] = useState(2527);
const canvasRef = useRef(null);

useEffect(() => {
    const canvas = canvasRef.current
    const ctx = canvas.getContext('2d')
    function windowResizeOnLoad() {
        setScreenWidth((window.innerWidth-2));
    };
    function windowResizeOnResize() {
        setScreenWidth((window.innerWidth - 2));
    };
    windowResizeOnLoad();
    window.addEventListener('resize', windowResizeOnResize);

    ctx.beginPath();
    ctx.strokeStyle = '#D4AF38';
    ctx.moveTo(100, 10);
    ctx.bezierCurveTo(100, 90, 1100, 320, 100, 600);
    ctx.stroke();
}, [])

<canvas width={screenWidth} height={screenHeight} ref={canvasRef}></canvas>


问:
Is there no support for reconnection in socket cluster ios client library?
I have implemented a socket cluster server. Also have an android app that is using it and the connection is very stable and data exchange is also good.I have a spring server as well and that also works absolutely fine. When implementing socket cluster on IOS i.e. its swift client im facing issue during re-connection. After socket disconnects, re-connection is not working. I cant see any function that has a re-connection policy, not only that on disconnection the library internally is not calling the connect function either. What is the right way to solve this issue.

```<code>public func setBasicListener(onConnect : ((ScClient)-> Void)?, onConnectError : ((ScClient, Error?)-> Void)?, onDisconnect : ((ScClient, Error?)-> Void)?) {
    self.onConnect = onConnect
    self.onDisconnect = onDisconnect
    self.onConnectError = onConnectError
}

public func websocketDidDisconnect(socket: WebSocketClient, error: Error?) {
    onDisconnect?(self, error)
}
</code>```

Even on onConnectError there is no function that triggers the connect.

Body:
I have implemented a socket cluster server. Also have an android app that is using it and the connection is very stable and data exchange is also good.I have a spring server as well and that also works absolutely fine. When implementing socket cluster on IOS i.e. its swift client im facing issue during re-connection. After socket disconnects, re-connection is not working. I cant see any function that has a re-connection policy, not only that on disconnection the library internally is not calling the connect function either. What is the right way to solve this issue.

public func setBasicListener(onConnect : ((ScClient)-> Void)?, onConnectError : ((ScClient, Error?)-> Void)?, onDisconnect : ((ScClient, Error?)-> Void)?) {
    self.onConnect = onConnect
    self.onDisconnect = onDisconnect
    self.onConnectError = onConnectError
}

public func websocketDidDisconnect(socket: WebSocketClient, error: Error?) {
    onDisconnect?(self, error)
}

Even on onConnectError there is no function that triggers the connect.


问:
ReferenceError: halalMeatInstance is not defined
I was doing a test in truffle. But i encountered this error, "ReferenceError: halalMeatInstance is not defined". I am pretty new in this truffle test thingy, actually this is my first time playing around with smart contracts and truffle test realm. It will be really helpful if anyone can point me out the mistake i made and give a solution. Thank you so much! the test file code is added below.

```<code>const { expectedEvent, BN } = require("@openzeppelin/test-helpers");
const HDWalletProvider = require("@truffle/hdwallet-provider");
const Web3 = require("Web3");

const HalalMeat = artifacts.require("HalalMeat");

contract("HalalMeat", (accounts) => {

    before(async () => {
        this.owner = accounts[0];

        this.MEAT_BRANDS = {
            GHagro: "Golden Harvest Agro Industries",
            Kazifood: "Kazi Food Industries",
            AGagro: "Ahsan Group Agro Foods",
            Bengalmeat: "Bengal Meat ltd",
            Sagro: "Sadek Agro ltd"
        };

        //enums
        this.ModeEnums = {
            ISSUER: { val: "ISSUER", pos: 0 },
            VERIFIER: { val: "VERIFIER", pos: 1 },
            PROVER: { val: "PROVER", pos: 2 }
        };

        this.StatusEnums = {
            //MANUFACTURED, DELIVERING_INTERNATIONAL, STORED, DELIVERING_LOCAL, DELIVERED
            manufactured: { val: "IMANUFACTURED", pos: 0 },
            delivering1: { val: "DELIVERING_INTERNATIONAL", pos: 1 },
            stored: { val: "STORED", pos: 2 },
            delivering2: { val: "DELIVERING_LOCAL", pos: 3 },
            delivered: { val: "DELIVERED", pos: 4 }
        };

        this.defaultEntities = {
            farmA: { id: accounts[1], mode: this.ModeEnums.PROVER.val },
            farmB: { id: accounts[2], mode: this.ModeEnums.PROVER.val },
            inspector: { id: accounts[3], mode: this.ModeEnums.ISSUER.val },
            distributorGlobal: { id: accounts[4], mode: this.ModeEnums.VERIFIER.val },
            distributorLocal: { id: accounts[5], mode: this.ModeEnums.VERIFIER.val },
            seller: { id: accounts[6], mode: this.ModeEnums.ISSUER.val },
            customer: { id: accounts[7], mode: this.ModeEnums.PROVER.val }
        };

    this.defaultMeatBatches ={
      0: { brand: this.MEAT_BRANDS.Bengalmeat, farm: this.defaultEntities.farmA.id },
      1: { brand: this.MEAT_BRANDS.Sagro, farm: this.defaultEntities.farmA.id },
      2: { brand: this.MEAT_BRANDS.Kazifood, farm: this.defaultEntities.farmA.id },
      3: { brand: this.MEAT_BRANDS.GHagro, farm: this.defaultEntities.farmA.id },
      4: { brand: this.MEAT_BRANDS.AGagro, farm: this.defaultEntities.farmA.id },
      5: { brand: this.MEAT_BRANDS.Bengalmeat, farm: this.defaultEntities.farmB.id },
      6: { brand: this.MEAT_BRANDS.Sagro, farm: this.defaultEntities.farmB.id },
      7: { brand: this.MEAT_BRANDS.Kazifood, farm: this.defaultEntities.farmB.id },
      8: { brand: this.MEAT_BRANDS.GHagro, farm: this.defaultEntities.farmB.id },
      9: { brand: this.MEAT_BRANDS.AGagro, farm: this.defaultEntities.farmB.id }

    };

        this.halalMeatInstance = await HalalMeat.deployed();
    this.providerOrUrl = "http://localhost:8545";

    });

    it('should add entities successfully', async () => {
    for(const entity in this.defaultEntities){
      const { id, mode } = this.defaultEntities[entity];

      const result = await halalMeatInstance.addEntity(
        id,
        mode,
        { from: this.owner}
      );

      console.log(result);
      expectedEvent(result.receipt, "AddEntity", {
        entityId: id,
        entityMode: mode
      });

      //assert.equal(actual, expected, errorMessage);
    }
    });
});
</code>```

i tried truffle test. got reference error but was expecting an emit event.

Contract: HalalMeaton list from solc-bin. Attempt #1
1) should add entities successfullybin. Attempt #1
> No events were emitted

0 passing (99ms)
1 failing

Contract: HalalMeat
should add entities successfully:
ReferenceError: halalMeatInstance is not defined
at Context. (test\halalmeat.js:74:22)
at processTicksAndRejections (node:internal/process/task_queues:95:5)

this is the error message i got when i used truffle test

Body:
I was doing a test in truffle. But i encountered this error, "ReferenceError: halalMeatInstance is not defined". I am pretty new in this truffle test thingy, actually this is my first time playing around with smart contracts and truffle test realm. It will be really helpful if anyone can point me out the mistake i made and give a solution. Thank you so much! the test file code is added below.

const { expectedEvent, BN } = require("@openzeppelin/test-helpers");
const HDWalletProvider = require("@truffle/hdwallet-provider");
const Web3 = require("Web3");

const HalalMeat = artifacts.require("HalalMeat");

contract("HalalMeat", (accounts) => {

    before(async () => {
        this.owner = accounts[0];

        this.MEAT_BRANDS = {
            GHagro: "Golden Harvest Agro Industries",
            Kazifood: "Kazi Food Industries",
            AGagro: "Ahsan Group Agro Foods",
            Bengalmeat: "Bengal Meat ltd",
            Sagro: "Sadek Agro ltd"
        };

        //enums
        this.ModeEnums = {
            ISSUER: { val: "ISSUER", pos: 0 },
            VERIFIER: { val: "VERIFIER", pos: 1 },
            PROVER: { val: "PROVER", pos: 2 }
        };

        this.StatusEnums = {
            //MANUFACTURED, DELIVERING_INTERNATIONAL, STORED, DELIVERING_LOCAL, DELIVERED
            manufactured: { val: "IMANUFACTURED", pos: 0 },
            delivering1: { val: "DELIVERING_INTERNATIONAL", pos: 1 },
            stored: { val: "STORED", pos: 2 },
            delivering2: { val: "DELIVERING_LOCAL", pos: 3 },
            delivered: { val: "DELIVERED", pos: 4 }
        };

        this.defaultEntities = {
            farmA: { id: accounts[1], mode: this.ModeEnums.PROVER.val },
            farmB: { id: accounts[2], mode: this.ModeEnums.PROVER.val },
            inspector: { id: accounts[3], mode: this.ModeEnums.ISSUER.val },
            distributorGlobal: { id: accounts[4], mode: this.ModeEnums.VERIFIER.val },
            distributorLocal: { id: accounts[5], mode: this.ModeEnums.VERIFIER.val },
            seller: { id: accounts[6], mode: this.ModeEnums.ISSUER.val },
            customer: { id: accounts[7], mode: this.ModeEnums.PROVER.val }
        };

    this.defaultMeatBatches ={
      0: { brand: this.MEAT_BRANDS.Bengalmeat, farm: this.defaultEntities.farmA.id },
      1: { brand: this.MEAT_BRANDS.Sagro, farm: this.defaultEntities.farmA.id },
      2: { brand: this.MEAT_BRANDS.Kazifood, farm: this.defaultEntities.farmA.id },
      3: { brand: this.MEAT_BRANDS.GHagro, farm: this.defaultEntities.farmA.id },
      4: { brand: this.MEAT_BRANDS.AGagro, farm: this.defaultEntities.farmA.id },
      5: { brand: this.MEAT_BRANDS.Bengalmeat, farm: this.defaultEntities.farmB.id },
      6: { brand: this.MEAT_BRANDS.Sagro, farm: this.defaultEntities.farmB.id },
      7: { brand: this.MEAT_BRANDS.Kazifood, farm: this.defaultEntities.farmB.id },
      8: { brand: this.MEAT_BRANDS.GHagro, farm: this.defaultEntities.farmB.id },
      9: { brand: this.MEAT_BRANDS.AGagro, farm: this.defaultEntities.farmB.id }

    };

        this.halalMeatInstance = await HalalMeat.deployed();
    this.providerOrUrl = "http://localhost:8545";

    });

    it('should add entities successfully', async () => {
    for(const entity in this.defaultEntities){
      const { id, mode } = this.defaultEntities[entity];

      const result = await halalMeatInstance.addEntity(
        id,
        mode,
        { from: this.owner}
      );

      console.log(result);
      expectedEvent(result.receipt, "AddEntity", {
        entityId: id,
        entityMode: mode
      });

      //assert.equal(actual, expected, errorMessage);
    }
    });
});

i tried truffle test. got reference error but was expecting an emit event.

Contract: HalalMeaton list from solc-bin. Attempt #1
1) should add entities successfullybin. Attempt #1
> No events were emitted

0 passing (99ms)
1 failing

Contract: HalalMeat
should add entities successfully:
ReferenceError: halalMeatInstance is not defined
at Context. (test\halalmeat.js:74:22)
at processTicksAndRejections (node:internal/process/task_queues:95:5)

this is the error message i got when i used truffle test


问:
Dual monitors not recognised by Apache Netbeans
I am trying to connect a TV to the Laptop. I want to display one JFrame on Laptop and another on my TV. But my code only recognises the Laptop monitor. It does not seem to recognise the TV as a second monitor.

I am experiment with this code:

```<code> public static void disponscreen() {
    System.out.println("Hello from the Disp on screen  Function!");

    Integer j=0;
         GraphicsEnvironment ge = GraphicsEnvironment.
   getLocalGraphicsEnvironment();
   GraphicsDevice[] gs = ge.getScreenDevices();
   System.out.println("No of monitord"+ge.getDefaultScreenDevice());

    System.out.println("No of monitord"+gs.length);
      GraphicsDevice gd = gs[0];
      GraphicsConfiguration[] gc = gd.getConfigurations();

         JFrame f = new JFrame("simple gui");

              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JLabel textLabel = new JLabel("I'm a label in the window");
              textLabel.setPreferredSize(new Dimension(300, 100));
             f.getContentPane().add(textLabel, BorderLayout.CENTER);
              //Display the window.       frame.setLocationRelativeTo(null);       frame.pack();       frame.setVisible(true);    }    public static void main(String[] args) {       createWindow();    } }
            f.setVisible(true);

    }
         public static void main(String[] args) {
    System.out.println("Hello from the Java Main Function!");
    disponscreen();

  }
</code>```

gs.length is 1 regardless of connecting or not connecting a TV

I expect to have gs.length = 2.

Body:
I am trying to connect a TV to the Laptop. I want to display one JFrame on Laptop and another on my TV. But my code only recognises the Laptop monitor. It does not seem to recognise the TV as a second monitor.

I am experiment with this code:

 public static void disponscreen() {
    System.out.println("Hello from the Disp on screen  Function!");

    Integer j=0;
         GraphicsEnvironment ge = GraphicsEnvironment.
   getLocalGraphicsEnvironment();
   GraphicsDevice[] gs = ge.getScreenDevices();
   System.out.println("No of monitord"+ge.getDefaultScreenDevice());

    System.out.println("No of monitord"+gs.length);
      GraphicsDevice gd = gs[0];
      GraphicsConfiguration[] gc = gd.getConfigurations();

         JFrame f = new JFrame("simple gui");

              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JLabel textLabel = new JLabel("I'm a label in the window");
              textLabel.setPreferredSize(new Dimension(300, 100));
             f.getContentPane().add(textLabel, BorderLayout.CENTER);
              //Display the window.       frame.setLocationRelativeTo(null);       frame.pack();       frame.setVisible(true);    }    public static void main(String[] args) {       createWindow();    } }
            f.setVisible(true);

    }
         public static void main(String[] args) {
    System.out.println("Hello from the Java Main Function!");
    disponscreen();

  }

gs.length is 1 regardless of connecting or not connecting a TV

I expect to have gs.length = 2.


问:
enable spaces for initializer list in .editorconfig VSCode for c++
I'm trying to use autoformatter in VSCode and I can't seem to find how to configure that multiple arguments of ctor would be indented in (as shown here).

consider this code:

```<code>class A{
public:
    A(const SomeType& firstArg, const AnotherType& secondArg, int thirdArg)
        : _first(firstArg),
        _second(secondArg),
        _third(thirdArg){
    _first.doStuff();
}

private:
    const SomeType& _first;
    const AnotherType& _second;
    int _third;
};
</code>```

if I run the autoformatter, all the lines of the initializer list are indented back, and the code looks this this:

```<code>class A{
public:
    A(const SomeType& firstArg, const AnotherType& secondArg, int thirdArg)
    : _first(firstArg),
    _second(secondArg),
    _third(thirdArg){
    _first.doStuff();
    }
...
};
</code>```

which is unreadable in my opinion.
I've seen approaches which suggests to put the commas at the start of the line, but I don't like it very much.

does anyone know how to enforce the indentation format?

Body:
I'm trying to use autoformatter in VSCode and I can't seem to find how to configure that multiple arguments of ctor would be indented in (as shown here).

consider this code:

class A{
public:
    A(const SomeType& firstArg, const AnotherType& secondArg, int thirdArg)
        : _first(firstArg),
        _second(secondArg),
        _third(thirdArg){
    _first.doStuff();
}

private:
    const SomeType& _first;
    const AnotherType& _second;
    int _third;
};

if I run the autoformatter, all the lines of the initializer list are indented back, and the code looks this this:

class A{
public:
    A(const SomeType& firstArg, const AnotherType& secondArg, int thirdArg)
    : _first(firstArg),
    _second(secondArg),
    _third(thirdArg){
    _first.doStuff();
    }
...
};

which is unreadable in my opinion.
I've seen approaches which suggests to put the commas at the start of the line, but I don't like it very much.

does anyone know how to enforce the indentation format?