问:
Trying to checkout to a previous commit ID. I get the results: "warning: unable to rmdir"
My teammates on Github had been working on a repository. My job is simply to go back to previous commits and see all the submodules.

So far I downloaded the repository to my computer.

I'm applying git checkout to a previous commit ID and get the following at the start:

```<code>git checkout 20e8984854d21dcd78d7bc424d4d12f2c40ba943d
warning: unable to rmdir (directory): Directory not empty
warning: unable to rmdir (directory): Directory not empty
warning: unable to rmdir (directory): Directory not empty
warning: unable to rmdir (directory): Directory not empty
Updating files: 100% (6230/6230), done.
</code>```

Body:
My teammates on Github had been working on a repository. My job is simply to go back to previous commits and see all the submodules.

So far I downloaded the repository to my computer.

I'm applying git checkout to a previous commit ID and get the following at the start:

git checkout 20e8984854d21dcd78d7bc424d4d12f2c40ba943d
warning: unable to rmdir (directory): Directory not empty
warning: unable to rmdir (directory): Directory not empty
warning: unable to rmdir (directory): Directory not empty
warning: unable to rmdir (directory): Directory not empty
Updating files: 100% (6230/6230), done.


来源: stackexchange

问:
Horizontal scrollView not working on Android
I'm developing app with RN 0.69.6. I am trying to create scrollable item horizontally with ScrollView

Only on main screen in my app it works but on other screens in my app it doesn't work.

But, the scrolling it's also works on iOS but not on Android.

Output of npx react-native info  System: OS: Windows 10 10.0.19044 CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz Memory: 1.95 GB / 11.85 GB Binaries: Node: 16.14.2 - C:\\Program Files\\nodejs\\node.EXE Yarn: 1.22.19 - \~\\AppData\\Roaming\\npm\\yarn.CMD npm: 8.17.0 - C:\\Program Files\\nodejs\\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Not Found Visual Studio: Not Found Languages: Java: Not Found npmPackages: @react-native-community/cli: Not Found react: 18.0.0 =\> 18.0.0 react-native: 0.69.6 =\> 0.69.6 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found

```<code>renderHighlightVideoBanner = (banners) => {
    return (
      <View style={styles.highlightOverflowContainer}>
        <View style={styles.groupTitleContainer}>
          <AdjustableText additionalStyle={styles.headerLabel}>What To Watch</AdjustableText>
        </View>
        <ScrollView
          horizontal
          showsHorizontalScrollIndicator={false}
          contentContainerStyle={styles.horizontalScrollViewContainer}
        >
          {banners.data.map((value) => {
            return (
              <View style={styles.container}>
                <TouchableOpacity
                  style={styles.touchableHighlightSliderContainer}
                  onPress={() => this.navigateToVideoScreen(value)}
                >
                  <Image
                    resizeMode="cover"
                    style={styles.sliderImage}
                    source={{ uri: value.file_path + value.file_name }}
                  />
                </TouchableOpacity>
                <View style={styles.highlightTitleLabelContainer}>
                  <AdjustableText heading="label" additionalStyle={styles.headerLabel}>{value.title}</AdjustableText>
                  <AdjustableText heading="label">{value.subtitle}</AdjustableText>
                </View>
              </View>
            )
          })}
        </ScrollView>
      </View>
    )
  }
</code>```

The banner can scroll horizontally

ContentLicense: CC BY-SA 4.0

Body:
I'm developing app with RN 0.69.6. I am trying to create scrollable item horizontally with ScrollView

Only on main screen in my app it works but on other screens in my app it doesn't work.

But, the scrolling it's also works on iOS but not on Android.

Output of npx react-native info  System: OS: Windows 10 10.0.19044 CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz Memory: 1.95 GB / 11.85 GB Binaries: Node: 16.14.2 - C:\\Program Files\\nodejs\\node.EXE Yarn: 1.22.19 - \~\\AppData\\Roaming\\npm\\yarn.CMD npm: 8.17.0 - C:\\Program Files\\nodejs\\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Not Found Visual Studio: Not Found Languages: Java: Not Found npmPackages: @react-native-community/cli: Not Found react: 18.0.0 =\> 18.0.0 react-native: 0.69.6 =\> 0.69.6 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found

renderHighlightVideoBanner = (banners) => {
    return (
      <View style={styles.highlightOverflowContainer}>
        <View style={styles.groupTitleContainer}>
          <AdjustableText additionalStyle={styles.headerLabel}>What To Watch</AdjustableText>
        </View>
        <ScrollView
          horizontal
          showsHorizontalScrollIndicator={false}
          contentContainerStyle={styles.horizontalScrollViewContainer}
        >
          {banners.data.map((value) => {
            return (
              <View style={styles.container}>
                <TouchableOpacity
                  style={styles.touchableHighlightSliderContainer}
                  onPress={() => this.navigateToVideoScreen(value)}
                >
                  <Image
                    resizeMode="cover"
                    style={styles.sliderImage}
                    source={{ uri: value.file_path + value.file_name }}
                  />
                </TouchableOpacity>
                <View style={styles.highlightTitleLabelContainer}>
                  <AdjustableText heading="label" additionalStyle={styles.headerLabel}>{value.title}</AdjustableText>
                  <AdjustableText heading="label">{value.subtitle}</AdjustableText>
                </View>
              </View>
            )
          })}
        </ScrollView>
      </View>
    )
  }

The banner can scroll horizontally


问:
HMAC in Javascript does not match HMAC in Python because of quotes
I have a client in JavaScript that carries out hmac as follows:

```<code>generateHMAC: function (payload) {
return new Promise((resolve) => {
  let hmacpsk = app.get('secret_key');
  const hmac = crypto.createHmac('sha256', hmacpsk).update(JSON.stringify(payload)).digest('hex');
  resolve(hmac);
})
</code>```

},

The payload is as follows:

```<code>{"patients":[{"id":96,"position":[40.475268,-3.6957545],"area_id":38,"visit":30}],"doctors":[{"id":18,"position":[40.45993,-3.686387],"area_id":38,"start_timestamp":"2022-12-11T23:00:00.000Z","visit":240}],"areas":[{"area_id":38,"transport":"walking"}]}
</code>```

When performing JSON.stringify(payload) it appears like this:

```<code>"{\"patients\":[{\"id\":96,\"position\":[40.475268,-3.6957545],\"area_id\":38,\"visit\":30}],\"doctors\":[{\"id\":18,\"position\":[40.45993,-3.686387],\"area_id\":38,\"start_timestamp\":\"2022-12-11T23:00:00.000Z\",\"visit\":240}],\"areas\":[{\"area_id\":38,\"transport\":\"walking\"}]}"
</code>```

and the hash is the following:

```<code>84257087ef9cf31f376a8b39e36ac0d97de91d53c8e373cb1e936a51ca5664a2
</code>```

On the Python server side, I have the following code:

```<code>#get the body of the request
values = json.loads(request.get_data(as_text=True))
#generate new hmac
clave=hmac.new(b"secret_key", bytes(str(values), 'utf-8'), digestmod=hashlib.sha256).hexdigest()
print("The new key is:")
print (clave)
</code>```

The aspect of str(values) is as follows:

```<code>'{\'patients\':[{\'id\':96,\'position\':[40.475268,-3.6957545],\'area_id\':38,\'visit\':30}],\'doctors\':[{\'id\':18,\'position\':[40.45993,-3.686387],\'area_id\':38,\'start_timestamp\':\'2022-12-11T23:00:00.000Z\',\'visit\':240}],\'areas\':[{\'area_id\':38,\'transport\':\'walking\'}]}'
</code>```

And the hash I get is the following:

```<code>a156bdf7a0c05443337bbf02ebe555b9004d275089c6bc5dae2ebff64d01f170
</code>```

That as you can see differs from the one in the client. Do you know what is the problem? Maybe is related to quotes? I tried replacing quotes but the same problem arises.

Body:
I have a client in JavaScript that carries out hmac as follows:

generateHMAC: function (payload) {
return new Promise((resolve) => {
  let hmacpsk = app.get('secret_key');
  const hmac = crypto.createHmac('sha256', hmacpsk).update(JSON.stringify(payload)).digest('hex');
  resolve(hmac);
})

},

The payload is as follows:

{"patients":[{"id":96,"position":[40.475268,-3.6957545],"area_id":38,"visit":30}],"doctors":[{"id":18,"position":[40.45993,-3.686387],"area_id":38,"start_timestamp":"2022-12-11T23:00:00.000Z","visit":240}],"areas":[{"area_id":38,"transport":"walking"}]}

When performing JSON.stringify(payload) it appears like this:

"{\"patients\":[{\"id\":96,\"position\":[40.475268,-3.6957545],\"area_id\":38,\"visit\":30}],\"doctors\":[{\"id\":18,\"position\":[40.45993,-3.686387],\"area_id\":38,\"start_timestamp\":\"2022-12-11T23:00:00.000Z\",\"visit\":240}],\"areas\":[{\"area_id\":38,\"transport\":\"walking\"}]}"

and the hash is the following:

84257087ef9cf31f376a8b39e36ac0d97de91d53c8e373cb1e936a51ca5664a2

On the Python server side, I have the following code:

#get the body of the request
values = json.loads(request.get_data(as_text=True))
#generate new hmac
clave=hmac.new(b"secret_key", bytes(str(values), 'utf-8'), digestmod=hashlib.sha256).hexdigest()
print("The new key is:")
print (clave)

The aspect of str(values) is as follows:

'{\'patients\':[{\'id\':96,\'position\':[40.475268,-3.6957545],\'area_id\':38,\'visit\':30}],\'doctors\':[{\'id\':18,\'position\':[40.45993,-3.686387],\'area_id\':38,\'start_timestamp\':\'2022-12-11T23:00:00.000Z\',\'visit\':240}],\'areas\':[{\'area_id\':38,\'transport\':\'walking\'}]}'

And the hash I get is the following:

a156bdf7a0c05443337bbf02ebe555b9004d275089c6bc5dae2ebff64d01f170

That as you can see differs from the one in the client. Do you know what is the problem? Maybe is related to quotes? I tried replacing quotes but the same problem arises.


问:
Multiple authentications AzureAD and ASP.NET Identity using keycloak
Front End: Angular , ASP.NET MVC
Middleware:  ASP.NET WEB API  uses ASP.NET Identity (Localdb for login) and ASP.NET API  uses Azure AD

ASP.NET MVC using Asp.NET Identity

Angular using API Azure AD

Now I have to integrate Angular application in asp.net mvc using iframe. To enable single sign on how to integrate ASP.NET Identity and Azure AD in keycloak.

Any suggestions on this.


问:
Debug blazor component as external sources with symbols
I want to debug blazor components client-side.

It is ok for the "local" blazor components in my solution.
But, I would to debug blazor components as "external sources" via the symbols.

Is there a way to do that?

The end goal is to debug blazor components in nuget packages via sourcelinks


问:
how to create jira insight object using python code
I have a dataframe like:

```<code>Vehicle Prod    Overall_stat   EU    EU_variant     status  partnumber  Error
A223    W223    NOT_OK        JLB21  JLB21_variant  NOT_OK  A23321      software not found
C243    E453    NOT_OK        JGG12  JGG12_variant  NOT_OK  A23322      software not found
A223    W223    NOT_OK        JBL25  JBL25_variant      OK  A23323      hardware not found
B321    I992    NOT_OK        L993   L993_variant   OK      A23324      hardware not found
        R365    NOT_OK        L223   L223_variant   NOT_OK  A23325      software not found
        R543    OK            L342   L342_variant   OK      A23326      hardware not found
</code>```

i have to create a vehicle object in jira insight with all the values like: Prod, Overall_stat ,Eu for each distinct vehicle.
i have object schema name:"New_prod" and object schema key:"CSR"   inside this object schema i have object named :"vehicle". i need to create insight object for all these distinct vehicle . how to achieve the same?

Body:
I have a dataframe like:

Vehicle Prod    Overall_stat   EU    EU_variant     status  partnumber  Error
A223    W223    NOT_OK        JLB21  JLB21_variant  NOT_OK  A23321      software not found
C243    E453    NOT_OK        JGG12  JGG12_variant  NOT_OK  A23322      software not found
A223    W223    NOT_OK        JBL25  JBL25_variant      OK  A23323      hardware not found
B321    I992    NOT_OK        L993   L993_variant   OK      A23324      hardware not found
        R365    NOT_OK        L223   L223_variant   NOT_OK  A23325      software not found
        R543    OK            L342   L342_variant   OK      A23326      hardware not found

i have to create a vehicle object in jira insight with all the values like: Prod, Overall_stat ,Eu for each distinct vehicle.
i have object schema name:"New_prod" and object schema key:"CSR"   inside this object schema i have object named :"vehicle". i need to create insight object for all these distinct vehicle . how to achieve the same?


问:
How to test what a component renders with react-test-renderer
I have a component in which an API request is made and I get two github users with information about them. I need to write a test for a component that renders a list with users. How can i do this? Need to use jest and react-test-renderer. I need to compare whether the component renders the information that comes in.

//List Component

class List extends Component {

  constructor(props) {
    super(props);
    this.state = {};
  }

  async componentDidMount() {
    getUser(this.props.user)
      .then((response) => {
        this.setState(response.data);
      })
      .catch((error) => {
        this.setState({ error: "Error" });
      });
  }

  render() {
    return (

          {Object.keys(this.state).map((i) => (

              {i}: {this.state[i]}

          ))}

    );
  }
}```
</div>
</div>
</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>//List.test.js

describe("List Component", () => {
  it("renders correctly", () => {
    const wrapper = renderer.create(<List />);
    const testInstance = wrapper.root;
    expect(wrapper.toJSON()).toMatchSnapshot();
  });
});</code>```

Body:
I have a component in which an API request is made and I get two github users with information about them. I need to write a test for a component that renders a list with users. How can i do this? Need to use jest and react-test-renderer. I need to compare whether the component renders the information that comes in.

//List Component

class List extends Component {

  constructor(props) {
    super(props);
    this.state = {};
  }

  async componentDidMount() {
    getUser(this.props.user)
      .then((response) => {
        this.setState(response.data);
      })
      .catch((error) => {
        this.setState({ error: "Error" });
      });
  }

  render() {
    return (

          {Object.keys(this.state).map((i) => (

              {i}: {this.state[i]}

          ))}

    );
  }
}

//List.test.js

describe("List Component", () => {
  it("renders correctly", () => {
    const wrapper = renderer.create(<List />);
    const testInstance = wrapper.root;
    expect(wrapper.toJSON()).toMatchSnapshot();
  });
});


问:
How to use tsoa with express
In express.js I have controller defined like this:

```<code>@Route('notes')
export default class NoteController extends Controller {
    @Get('/')
    public async (req: Request, res: Response, _next: NextFunction): Promise<any> => {
        try {
            const Note: CreateNote = req.body;
            await notesQueries.createNote(Note);
            return res.status(200).send({
                data: {},
                code: 200,
                message: 'Note created!'
            });
        } catch (e) {
            console.log(e);
            return res.status(400).send({
                data: {},
                code: 400,
                message: 'Something happened on creating Note!'
            });
        }
    };
</code>```

When I run tsoa spec to generate swagger.json I got following error message:

```<code>There was a problem resolving type of 'Request'.
Generate swagger error.
GenerateMetadataError: Cannot read properties of undefined (reading 'text')
</code>```

Trying to figure what am I doing wrong? Anyone have idea?

Title: How to use tsoa with express

Body:
In express.js I have controller defined like this:

@Route('notes')
export default class NoteController extends Controller {
    @Get('/')
    public async (req: Request, res: Response, _next: NextFunction): Promise<any> => {
        try {
            const Note: CreateNote = req.body;
            await notesQueries.createNote(Note);
            return res.status(200).send({
                data: {},
                code: 200,
                message: 'Note created!'
            });
        } catch (e) {
            console.log(e);
            return res.status(400).send({
                data: {},
                code: 400,
                message: 'Something happened on creating Note!'
            });
        }
    };

When I run tsoa spec to generate swagger.json I got following error message:

There was a problem resolving type of 'Request'.
Generate swagger error.
GenerateMetadataError: Cannot read properties of undefined (reading 'text')

Trying to figure what am I doing wrong? Anyone have idea?


问:
It is not changing to upper case and is on replace only pls find the eror
it is the code about the domain and email

```<code>while True:
    print()
    email = input("Enter Your Email: ").strip()
    print()

    if email.count('@') == 1 and len(email[:email.index('@')]) > 0 and len(email[email.index('@') + 1:]) > 3:
        print("Username: ", email[:email.index('@')])
        print("Domain:   ", email[email.index('@') + 1:].upper())
    else:
        print("Invalid email!")
</code>```

i was trying to get the domain and the email separetly but it is showing the error

Body:
it is the code about the domain and email

while True:
    print()
    email = input("Enter Your Email: ").strip()
    print()

    if email.count('@') == 1 and len(email[:email.index('@')]) > 0 and len(email[email.index('@') + 1:]) > 3:
        print("Username: ", email[:email.index('@')])
        print("Domain:   ", email[email.index('@') + 1:].upper())
    else:
        print("Invalid email!")

i was trying to get the domain and the email separetly but it is showing the error


问:
Oracle Data Integrator - Performance improvement in ODI Mappings
Daily we are processing 10 to 15 billions of data through ODI Mappings. So our mappings are taking longer time to execute. What are the steps required to increase performance?

I increased JVM Initial and Maximum heap size also increased Array fetch size and Batch update size in Topology Data Servers. But still no use. We are using 'IKM Controle Append' for few mappings and 'IKM incremenatal update' for few mappings.


问:
Cannot convert value of type '()' to expected argument type '[API.Posters.Items]'
I am trying to pass data from Interactor to Presenter.
In Interactor I have switch , where I get result and I want to pass result into my array.

My error is: Cannot convert value of type '()' to expected argument type '[API.Posters.Items]'

[API.Posters.Items] - is my model

So, I have function:

```<code>func loadMyRecords(completion: @escaping (Result<MyRecordsContent, Error>) -> Void) {
        guard currentPage != .last else { return }

        currentRequest?.cancel()

        currentRequest = postersService.fetchRecords(fromRow: currentPage.fromRow, closedOnly: isClosedOnly) { [weak self] result in
            guard let self = self else {
                return
            }

            switch result {
            case let .success(rawModel):
                if let placeholder = rawModel.placeholder {
                    self.content = .placeholder(placeholder)
                } else {
                    var currentItems = self.content.item
                    var items = currentItems.append(contentsOf: rawModel.items) **<---ERROR (Cannot convert value of type '()' to expected argument type '[API.Posters.Items]')**
                    self.content = .items(items)
                }

                self.currentPage = .some(rawModel.nextRow)

                completion(.success(self.content))

            case let .failure(error):
                self.currentPage = .last

                completion(.failure(error))
            }
        }
    }
</code>```

Also, I have enum, where I switch content:

```<code>enum MyRecordsContent {
    case items([API.Posters.Items])
    case placeholder(API.Placeholder)
    case empty
    var item: [API.Posters.Items] {
        switch self {
        case .placeholder:
            return []
        case let .items(items):
            return items
        case .empty:
            return []
        }
    }
}
</code>```

Body:
I am trying to pass data from Interactor to Presenter.
In Interactor I have switch , where I get result and I want to pass result into my array.

My error is: Cannot convert value of type '()' to expected argument type '[API.Posters.Items]'

[API.Posters.Items] - is my model

So, I have function:

func loadMyRecords(completion: @escaping (Result<MyRecordsContent, Error>) -> Void) {
        guard currentPage != .last else { return }

        currentRequest?.cancel()

        currentRequest = postersService.fetchRecords(fromRow: currentPage.fromRow, closedOnly: isClosedOnly) { [weak self] result in
            guard let self = self else {
                return
            }

            switch result {
            case let .success(rawModel):
                if let placeholder = rawModel.placeholder {
                    self.content = .placeholder(placeholder)
                } else {
                    var currentItems = self.content.item
                    var items = currentItems.append(contentsOf: rawModel.items) **<---ERROR (Cannot convert value of type '()' to expected argument type '[API.Posters.Items]')**
                    self.content = .items(items)
                }

                self.currentPage = .some(rawModel.nextRow)

                completion(.success(self.content))

            case let .failure(error):
                self.currentPage = .last

                completion(.failure(error))
            }
        }
    }

Also, I have enum, where I switch content:

enum MyRecordsContent {
    case items([API.Posters.Items])
    case placeholder(API.Placeholder)
    case empty
    var item: [API.Posters.Items] {
        switch self {
        case .placeholder:
            return []
        case let .items(items):
            return items
        case .empty:
            return []
        }
    }
}


问:
Determine file type based on data, not extension, using Python
I have many archive files need to be decompress, but these files has random suffix, e.g.:

```<code>a.gho
b.cuw
c.ghi
</code>```

the real extension of these files maybe is .zip, .rar or .7z.

I would like to determine real file extension So I can decide which module I should use to decompress it, unrar or unzip.

Is it possible?

For now, the only way I can think of is to try to decompress file one by one. for example, for file a.gho:

```<code>try unrar g.rar
if not working, try unzip g.zip
</code>```

Obviously, this is inefficient. So, is there a better way to determine real file extension?

Body:
I have many archive files need to be decompress, but these files has random suffix, e.g.:

a.gho
b.cuw
c.ghi

the real extension of these files maybe is .zip, .rar or .7z.

I would like to determine real file extension So I can decide which module I should use to decompress it, unrar or unzip.

Is it possible?

For now, the only way I can think of is to try to decompress file one by one. for example, for file a.gho:

try unrar g.rar
if not working, try unzip g.zip

Obviously, this is inefficient. So, is there a better way to determine real file extension?


问:
Why i'm I getting "No routes matched location" when passing a dynamic path variable? (RRD6)
I want to render a dynamic path for one of my components. The component in question is sending the required ID by use of useParams, but when I want to render my component using path="comp/:id" it gives me a white screen and my web console says "No routes matched location /comp". It used to work perfectly before but when migrating to the newest version of RRD it no longer works

Here is an idea of how I am rendering my component

```<code><Route
    path="comp/:id"
    element={
      <React.Fragment>
        {someCondition ?
          <ErrorCatcher key="someKeys" from="Component">
            <Component/>
          </ErrorCatcher>
          :
          <OtherComponent
            props1="something"
            props2={stuff}
            etc...
          />
        }
      </React.Fragment>
    }
/>
</code>```

And in my Component for useParams I do:

```<code>
let { id } = useParams();

const selectedId = useMemo(() => {

    if (id === "something" || !id) {
        return SOMETHING;
    }

    let findIndex = FUNCT_FIND_INDEX(SOMETHING, "id", id);

    if (findIndex !== -1) {
        return SOMETHING[findIndex];
    }
    return OTHER_SOMETHING;

}, [id]);
</code>```

My router and root routes are essentially organized like this all in the App.js file render section

```<code><Routes>

   <Route path="someComponent/*"/>
   <Route path="anotherComponen/*"/>
   <Route path="comp/:id"/>
   <Route path="/"/>

</Routes>
</code>```

In theory this should work, but I am getting an error. What am I doing wrong?

Body:
I want to render a dynamic path for one of my components. The component in question is sending the required ID by use of useParams, but when I want to render my component using path="comp/:id" it gives me a white screen and my web console says "No routes matched location /comp". It used to work perfectly before but when migrating to the newest version of RRD it no longer works

Here is an idea of how I am rendering my component

<Route
    path="comp/:id"
    element={
      <React.Fragment>
        {someCondition ?
          <ErrorCatcher key="someKeys" from="Component">
            <Component/>
          </ErrorCatcher>
          :
          <OtherComponent
            props1="something"
            props2={stuff}
            etc...
          />
        }
      </React.Fragment>
    }
/>

And in my Component for useParams I do:

let { id } = useParams();

const selectedId = useMemo(() => {

    if (id === "something" || !id) {
        return SOMETHING;
    }

    let findIndex = FUNCT_FIND_INDEX(SOMETHING, "id", id);

    if (findIndex !== -1) {
        return SOMETHING[findIndex];
    }
    return OTHER_SOMETHING;

}, [id]);

My router and root routes are essentially organized like this all in the App.js file render section

<Routes>

   <Route path="someComponent/*"/>
   <Route path="anotherComponen/*"/>
   <Route path="comp/:id"/>
   <Route path="/"/>

</Routes>

In theory this should work, but I am getting an error. What am I doing wrong?


问:
Cannot redirect to another route inside html view file codeigniter
```<code><?php
$checkNotNull = checkNotNull($user_detail->user_id);
$logged_data = $this->session->userdata('logged');

if(!$checkNotNull && $logged_data['status'] == 1){
 header("location:".base_url()."accounts/kyc");
}

if (!$this->session->userdata('lang')) {
    $this->lang->load(DEFAULT_LANG, LANG_FOLDER);
} else {
    $lang_data = $this->session->userdata('lang');
    $this->lang->load($lang_data['language'] . '_lang', $lang_data['language']);
}

?>
</code>```

I am tring to redirect to another route if the checkNotNull variable is false and user has logged in.
I have used every technique to redirect but it is not helping out.Variable are checked thoroughly and the response is coming expected but when I use header function redirect function it goes to error page and shows too many redirects.
I am using codeigniter.

Body:
<?php
$checkNotNull = checkNotNull($user_detail->user_id);
$logged_data = $this->session->userdata('logged');

if(!$checkNotNull && $logged_data['status'] == 1){
 header("location:".base_url()."accounts/kyc");
}

if (!$this->session->userdata('lang')) {
    $this->lang->load(DEFAULT_LANG, LANG_FOLDER);
} else {
    $lang_data = $this->session->userdata('lang');
    $this->lang->load($lang_data['language'] . '_lang', $lang_data['language']);
}

?>

I am tring to redirect to another route if the checkNotNull variable is false and user has logged in.
I have used every technique to redirect but it is not helping out.Variable are checked thoroughly and the response is coming expected but when I use header function redirect function it goes to error page and shows too many redirects.
I am using codeigniter.


问:
Could I show customize solana token on phantom wallet?
If I upload my own solana spl token contract, could I show it on phantom wallet as assets?
Solana token2022 is not shown on phantom and explorer, only be shown as unknown program.</p>


问:
React Context why I'm running into error `useData No DataProvider available`
Hello I'm creating a library which handles the basic auth fetching for the users.

Currently I run into issue in tests that points me to useAuth hook with useData No DataProvider available error.

DataProvider is a simple store

```<code>import * as React from 'react';

import { dataStateReducer } from 'src/store/dataStateReducer';
import { DataDispatchContext, DataStateContext } from 'src/context/data/dataContext';
import { initialState } from 'src/store/dataState';

import type { DataProviderProps } from './DataProvider.types';

export const DataProvider = ({ children }: DataProviderProps) => {
  const [state, dispatch] = React.useReducer(dataStateReducer, initialState);

  return (
    <DataStateContext.Provider value={state}>
      <DataDispatchContext.Provider value={dispatch}>{children}</DataDispatchContext.Provider>
    </DataStateContext.Provider>
  );
};
</code>```

And hooks for this provider

```<code>import * as React from 'react';

import { DataStateContext } from 'src/context/data/dataContext';

export const useData = () => {
  const state = React.useContext(DataStateContext);

  if (!state) {
    throw Error('useData No DataProvider available');
  }

  return state;
};
</code>```
```<code>import * as React from 'react';

import { DataDispatchContext } from '../context/data/dataContext';

export const useDispatch = () => {
  const dispatch = React.useContext(DataDispatchContext);

  if (!dispatch) {
    throw Error('useDispatch No DataProvider available');
  }

  return dispatch;
};
</code>```

And the useAuth which explodes with mentioned error in the one test case

```<code>import * as React from 'react';

import { useData } from 'src/hooks/useData';

export const useAuth = () => {
  const { isLoadingAuth, user, company } = useData();

  const isAuthorized = !!user;

  return {
    isLoadingAuth,
    isAuthorized,
    user,
    company,
    companyName: company?.name,
  };
};
</code>```

And the test that is failing, note that DataProvider is included in the OAuthProvider

```<code>export const OAuthProvider = ({ token, authSpaUrl, apiUrl, children }: OAuthProviderProps) => {
  return (
    <ClientProvider url={apiUrl}>
      <DataProvider>
        <AuthProvider ottToken={ottToken} authSpaUrl={authSpaUrl}>
          {children}
        </AuthProvider>
      </DataProvider>
    </ClientProvider>
  );
};
</code>```
```<code>const OAuthProviderConsumer = () => {
  const { isLoadingAuth, isAuthorized } = useAuth();

  if (isLoadingAuth) {
    return <p>Loading auth...</p>;
  }

  if (isAuthorized) {
    return <div>Authorized</div>;
  }

  return <div>Not Authorized</div>;
};

const createWrapper = (token?: string) => {
  render(
    <OAuthProvider authSpaUrl={FAKE_SPA_AUTH_URL} apiUrl={FAKE_AUTH_DOMAIN} ottToken={token}>
      <OAuthProviderConsumer />
    </OAuthProvider>,
  );
};

describe('OAuthProvider - responsible for adding useAuth hook for user', () => {
  it('should validate the provided token and authorize the user if the token is valid', async () => {
    createWrapper(VALID_TOKEN);

    await waitForElementToBeRemoved(screen.getByText('Loading auth...'));

    expect(screen.getByText('Authorized')).toBeDefined();
  });
</code>```

Body:
Hello I'm creating a library which handles the basic auth fetching for the users.

Currently I run into issue in tests that points me to useAuth hook with useData No DataProvider available error.

DataProvider is a simple store

import * as React from 'react';

import { dataStateReducer } from 'src/store/dataStateReducer';
import { DataDispatchContext, DataStateContext } from 'src/context/data/dataContext';
import { initialState } from 'src/store/dataState';

import type { DataProviderProps } from './DataProvider.types';

export const DataProvider = ({ children }: DataProviderProps) => {
  const [state, dispatch] = React.useReducer(dataStateReducer, initialState);

  return (
    <DataStateContext.Provider value={state}>
      <DataDispatchContext.Provider value={dispatch}>{children}</DataDispatchContext.Provider>
    </DataStateContext.Provider>
  );
};

And hooks for this provider

import * as React from 'react';

import { DataStateContext } from 'src/context/data/dataContext';

export const useData = () => {
  const state = React.useContext(DataStateContext);

  if (!state) {
    throw Error('useData No DataProvider available');
  }

  return state;
};

import * as React from 'react';

import { DataDispatchContext } from '../context/data/dataContext';

export const useDispatch = () => {
  const dispatch = React.useContext(DataDispatchContext);

  if (!dispatch) {
    throw Error('useDispatch No DataProvider available');
  }

  return dispatch;
};

And the useAuth which explodes with mentioned error in the one test case

import * as React from 'react';

import { useData } from 'src/hooks/useData';

export const useAuth = () => {
  const { isLoadingAuth, user, company } = useData();

  const isAuthorized = !!user;

  return {
    isLoadingAuth,
    isAuthorized,
    user,
    company,
    companyName: company?.name,
  };
};

And the test that is failing, note that DataProvider is included in the OAuthProvider

export const OAuthProvider = ({ token, authSpaUrl, apiUrl, children }: OAuthProviderProps) => {
  return (
    <ClientProvider url={apiUrl}>
      <DataProvider>
        <AuthProvider ottToken={ottToken} authSpaUrl={authSpaUrl}>
          {children}
        </AuthProvider>
      </DataProvider>
    </ClientProvider>
  );
};

const OAuthProviderConsumer = () => {
  const { isLoadingAuth, isAuthorized } = useAuth();

  if (isLoadingAuth) {
    return
Loading auth...
;
  }

  if (isAuthorized) {
    return
Authorized
;
  }

  return
Not Authorized
;
};

const createWrapper = (token?: string) => {
  render(
    <OAuthProvider authSpaUrl={FAKE_SPA_AUTH_URL} apiUrl={FAKE_AUTH_DOMAIN} ottToken={token}>
      <OAuthProviderConsumer />
    </OAuthProvider>,
  );
};

describe('OAuthProvider - responsible for adding useAuth hook for user', () => {
  it('should validate the provided token and authorize the user if the token is valid', async () => {
    createWrapper(VALID_TOKEN);

    await waitForElementToBeRemoved(screen.getByText('Loading auth...'));

    expect(screen.getByText('Authorized')).toBeDefined();
  });


问:
unable to patch using kustomize for the resources deployed using helm
I have deployment ingress-nginx using helm

```<code>helm upgrade --install ingress-nginx-external ingress-nginx \
  --repo https://kubernetes.github.io/ingress-nginx \
  --namespace ingress-nginx-external --create-namespace \
  --version v4.4.0
</code>```

As a next step I am trying to patch the deployment using patchesStrategicMerge

```<code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: ingress-nginx-external-controller
  namespace: ingress-nginx-external
spec:
  template:
    spec:
      containers:
        - name: controller
          args:
            - /nginx-ingress-controller
            - --publish-service=$(POD_NAMESPACE)/ingress-nginx-external-controller
            - --election-id=ingress-controller-leader
            - --controller-class=k8s.io/ingress-nginx-external
            - --configmap=$(POD_NAMESPACE)/ingress-nginx-external-controller
            - --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services
            # - --udp-services-configmap=$(POD_NAMESPACE)/udp-services
            - --validating-webhook=:8443
            - --validating-webhook-certificate=/usr/local/certificates/cert
            - --validating-webhook-key=/usr/local/certificates/key
            - --ingress-class-by-name=true
</code>```

but I am getting the below error

```<code>Error: no matches for Id Deployment.v1.apps/ingress-nginx-external-controller.ingress-nginx-external; failed to find unique target for patch Deployment.v1.apps/ingress-nginx-external-controller.ingress-nginx-external
</code>```

Body:
I have deployment ingress-nginx using helm

helm upgrade --install ingress-nginx-external ingress-nginx \
  --repo https://kubernetes.github.io/ingress-nginx \
  --namespace ingress-nginx-external --create-namespace \
  --version v4.4.0

As a next step I am trying to patch the deployment using patchesStrategicMerge

apiVersion: apps/v1
kind: Deployment
metadata:
  name: ingress-nginx-external-controller
  namespace: ingress-nginx-external
spec:
  template:
    spec:
      containers:
        - name: controller
          args:
            - /nginx-ingress-controller
            - --publish-service=$(POD_NAMESPACE)/ingress-nginx-external-controller
            - --election-id=ingress-controller-leader
            - --controller-class=k8s.io/ingress-nginx-external
            - --configmap=$(POD_NAMESPACE)/ingress-nginx-external-controller
            - --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services
            # - --udp-services-configmap=$(POD_NAMESPACE)/udp-services
            - --validating-webhook=:8443
            - --validating-webhook-certificate=/usr/local/certificates/cert
            - --validating-webhook-key=/usr/local/certificates/key
            - --ingress-class-by-name=true

but I am getting the below error

Error: no matches for Id Deployment.v1.apps/ingress-nginx-external-controller.ingress-nginx-external; failed to find unique target for patch Deployment.v1.apps/ingress-nginx-external-controller.ingress-nginx-external


问:
Magento paypal iframe return home page url in iframe
Magento 2.3.7, I am having two issues one is on my the Magento checkout I am using paypal payment advance, when I click in my theme in the check continue to bring the iframe for the paypal payment from, the items I have selected to buy is remove from the cart. If I enter a valid credit information it process and let me know it was successful. If I enter a credit that is declined it return the home page in the iframe and erases my order information.

How do I stop it from erasing the item(s) I plan to purchase until before I get an credit card approval or if it decline don't clear out the items. I may put a the card in or may have to use another card.

I have tried check to see the iframe is loaded if so look for the return success url do something if not do nothing but it still clear out the order session and all items.
magento2/app/code/Magento/Checkout/view/frontend/web/js/view/payment/default.js  is where the placeOrder

`

```<code>  placeOrder: function (data, event) {
                var self = this,
                    placeOrder;

                if (event) {
                    event.preventDefault();
                }

                if (this.validate() && additionalValidators.validate()) {
                    this.isPlaceOrderActionAllowed(false);
                    placeOrder = placeOrderAction(this.getData(), this.redirectAfterPlaceOrder, this.messageContainer);

                    $.when(placeOrder).fail(function () {
                        self.isPlaceOrderActionAllowed(true);
                    }).done(this.afterPlaceOrder.bind(this));
                    return true;
                }
                return false;
            },

</code>```

`

Body:
Magento 2.3.7, I am having two issues one is on my the Magento checkout I am using paypal payment advance, when I click in my theme in the check continue to bring the iframe for the paypal payment from, the items I have selected to buy is remove from the cart. If I enter a valid credit information it process and let me know it was successful. If I enter a credit that is declined it return the home page in the iframe and erases my order information.

How do I stop it from erasing the item(s) I plan to purchase until before I get an credit card approval or if it decline don't clear out the items. I may put a the card in or may have to use another card.

I have tried check to see the iframe is loaded if so look for the return success url do something if not do nothing but it still clear out the order session and all items.
magento2/app/code/Magento/Checkout/view/frontend/web/js/view/payment/default.js  is where the placeOrder

`

  placeOrder: function (data, event) {
                var self = this,
                    placeOrder;

                if (event) {
                    event.preventDefault();
                }

                if (this.validate() && additionalValidators.validate()) {
                    this.isPlaceOrderActionAllowed(false);
                    placeOrder = placeOrderAction(this.getData(), this.redirectAfterPlaceOrder, this.messageContainer);

                    $.when(placeOrder).fail(function () {
                        self.isPlaceOrderActionAllowed(true);
                    }).done(this.afterPlaceOrder.bind(this));
                    return true;
                }
                return false;
            },

`


问:
Read and Decode base64 XML and convert it to PDF
I am having html document whose base64 data is stored in XML format(means when I decode that base64 data online I get an XML file). Now, I want to decode that base64 data and convert into PDF in my java code.

```<code>byte[] bytes = string.getBytes();
String encoded = Base64.getEncoder().encodeToString(bytes);
byte[] decode = Base64.getDecoder().decode(bytes);
String htmlStr= new String(decode);
byte[] fileArray = new byte[0];
final String testFilename = "test.pdf";
final File testFile = new File(System.getProperty("java.io.tmpdir"), testFilename);

try {
     HtmlConverter.convertToPdf(htmlContent,new FileOutputStream(localFile));
     fileBlob = FileUtil.read(localFile);
}catch (Exception e) {
     e.printStackTrace();
}
</code>```

I tried to convert the document above code but I am getting exception while converting to PDF using HtmlConverter as

```<code>java.lang.IllegalArgumentException: Invalid token detected at the beginning of the selector string: " "
    at com.itextpdf.styledxmlparser.css.parse.CssSelectorParser.parseSelectorItems(CssSelectorParser.java:133) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.selector.CssSelector.<init>(CssSelector.java:76) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.CssRuleSetParser.parseRuleSet(CssRuleSetParser.java:133) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.syntax.CssParserStateController.processProperties(CssParserStateController.java:390) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.syntax.CssParserStateController.storeCurrentProperties(CssParserStateController.java:315) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.syntax.BlockState.process(BlockState.java:70) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.syntax.CssParserStateController.process(CssParserStateController.java:179) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.CssStyleSheetParser.parse(CssStyleSheetParser.java:84) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.CssStyleSheetParser.parse(CssStyleSheetParser.java:111) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.CssStyleSheetParser.parse(CssStyleSheetParser.java:124) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.html2pdf.css.resolve.DefaultCssResolver.collectCssDeclarations(DefaultCssResolver.java:316) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.css.resolve.DefaultCssResolver.<init>(DefaultCssResolver.java:138) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.attach.impl.DefaultHtmlProcessor.processDocument(DefaultHtmlProcessor.java:251) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.attach.Attacher.attach(Attacher.java:78) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.HtmlConverter.convertToDocument(HtmlConverter.java:331) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.HtmlConverter.convertToPdf(HtmlConverter.java:141) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.HtmlConverter.convertToPdf(HtmlConverter.java:128) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.HtmlConverter.convertToPdf(HtmlConverter.java:105) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.HtmlConverter.convertToPdf(HtmlConverter.java:93) ~[html2pdf-4.0.3.jar:na]

</code>```

Body:
I am having html document whose base64 data is stored in XML format(means when I decode that base64 data online I get an XML file). Now, I want to decode that base64 data and convert into PDF in my java code.

byte[] bytes = string.getBytes();
String encoded = Base64.getEncoder().encodeToString(bytes);
byte[] decode = Base64.getDecoder().decode(bytes);
String htmlStr= new String(decode);
byte[] fileArray = new byte[0];
final String testFilename = "test.pdf";
final File testFile = new File(System.getProperty("java.io.tmpdir"), testFilename);

try {
     HtmlConverter.convertToPdf(htmlContent,new FileOutputStream(localFile));
     fileBlob = FileUtil.read(localFile);
}catch (Exception e) {
     e.printStackTrace();
}

I tried to convert the document above code but I am getting exception while converting to PDF using HtmlConverter as

java.lang.IllegalArgumentException: Invalid token detected at the beginning of the selector string: " "
    at com.itextpdf.styledxmlparser.css.parse.CssSelectorParser.parseSelectorItems(CssSelectorParser.java:133) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.selector.CssSelector.<init>(CssSelector.java:76) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.CssRuleSetParser.parseRuleSet(CssRuleSetParser.java:133) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.syntax.CssParserStateController.processProperties(CssParserStateController.java:390) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.syntax.CssParserStateController.storeCurrentProperties(CssParserStateController.java:315) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.syntax.BlockState.process(BlockState.java:70) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.syntax.CssParserStateController.process(CssParserStateController.java:179) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.CssStyleSheetParser.parse(CssStyleSheetParser.java:84) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.CssStyleSheetParser.parse(CssStyleSheetParser.java:111) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.styledxmlparser.css.parse.CssStyleSheetParser.parse(CssStyleSheetParser.java:124) ~[styled-xml-parser-7.2.3.jar:na]
    at com.itextpdf.html2pdf.css.resolve.DefaultCssResolver.collectCssDeclarations(DefaultCssResolver.java:316) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.css.resolve.DefaultCssResolver.<init>(DefaultCssResolver.java:138) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.attach.impl.DefaultHtmlProcessor.processDocument(DefaultHtmlProcessor.java:251) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.attach.Attacher.attach(Attacher.java:78) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.HtmlConverter.convertToDocument(HtmlConverter.java:331) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.HtmlConverter.convertToPdf(HtmlConverter.java:141) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.HtmlConverter.convertToPdf(HtmlConverter.java:128) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.HtmlConverter.convertToPdf(HtmlConverter.java:105) ~[html2pdf-4.0.3.jar:na]
    at com.itextpdf.html2pdf.HtmlConverter.convertToPdf(HtmlConverter.java:93) ~[html2pdf-4.0.3.jar:na]


问:
A ListView in a ViewPager2 does not refresh when updated offscreen and re-displayed
I've noticed this issue crop up in a few projects recently so I've made a simple example project which duplicates the problem (on my device, a samsung galaxy tab active2).

The code is at: https://github.com/bj0/test-listview

problem

The issue is that when a listview has its contents updated while it is offscreen, and then it is returned to the screen, the old contents are still displayed.  This happens every time:

The reproduce, the test app is a single activity with a ViewPager2 that has two pages.  The first page has a ListView with a couple initial items, and the second page has a button which will add an item to the ListView (and calls notifyDataSetChanged).

Swiping to the button page and pressing the button adds an item to the ListView, then swiping back to the first page displayed the ListView with its original items, but not the new item.  The ListView does refresh, however, if you then click and try to scroll up or down on the list.

cause?

The fact that the ListView refreshes when you click/scroll seems to indicate that it is correctly updated (i've verified the adapter is updated), but it's not redrawn until something happens (perhaps focus related?).

I'm not sure what to try next, has anyone seen this issue before?  Am I missing something in the setup?  I mostly followed example codes online to setup the classes.


问:
Can't Display an Three cube on GLView
i'm trying to make an simple cube to display on an Android mobile but the cube
doesn't show on the GLView, can someone pls help me with this. The VSCode doesn't had any Waring or Error so I don't know what wrong with the code @@
Thank you!
`

```<code>import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import { ExpoWebGLRenderingContext, GLView } from 'expo-gl';
import ExpoTHREE, { Renderer } from 'expo-three';
import { Screen, Mesh, MeshBasicMaterial, PerspectiveCamera, Scene, } from 'three';
import { THREE } from 'expo-three';

const ThreeD = (props) => {
    const onContextCreate = async (gl) => {
        const scene = new Scene();
        const camera = new PerspectiveCamera(
            45,
            gl.drawingBufferWidth / gl.drawingBufferHeight,
            1,
            1000
        )

        gl.canvas = { width: gl.drawingBufferWidth, height: gl.drawingBufferHeight }
        const renderer = new Renderer({ gl })
        renderer.setSize(gl.drawingBufferWidth, gl.drawingBufferHeight)

        const geometry = new THREE.BoxGeometry(1, 1, 1)
        const material = new MeshBasicMaterial({
            color: 'blue'
        })

        const cube = new Mesh(geometry, material)
        scene.add(cube)
        const render = () => {
            requestAnimationFrame(render)
            renderer.render(scene, camera)
            gl.endFrameEXP()
        }
        render()
    }
    return (
        <GLView
            style={styles.GLView}
            onContextCreate={onContextCreate}
        />
    );
}

const styles = StyleSheet.create({
    GLView: {
        width: 500,
        height: 500,
        backgroundColor: "#90ff90"
    },

});

export default ThreeD;
</code>```

`

`

```<code>import React, { useState, useEffect } from "react";
import {
  SafeAreaView,
  Image,
  View,
  Button,
  StyleSheet,
  Text,
  ScrollView,
  TouchableOpacity,
  Modal,
  Alert,
  TextInput,
  Pressable,
  BackHandler
} from "react-native";
import ThreeD from "../../Components/3D";

export default ThreeDimension = ({ navigation }) => {

  //Main code
  return (
    <SafeAreaView style={styles.container}>
      <View style={styles.banner}>
        <Text style={styles.title}>Tên kho lạnh</Text>
      </View>
      <View style={styles.threecontainer}>
        <ThreeD />
      </View>
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#000000',
  },

  threecontainer: {
    flex: 1,
    backgroundColor: '#90fff0',
  },
  banner: {
    height: "5%"
  },
  title: {
    fontSize: 20,
    color: "#DF8000",
    fontWeight: "bold",
    alignSelf: "center",
  },
  storagecontainer: {
    flex: 1,
  },

  storage: {
    backgroundColor: "#0099ff",
    padding: 50,
    margin: 10,
    borderWidth: 1,
    borderRadius: 10,
  },

  label: {
    fontWeight: 'bold',
  },

});
</code>```

`

I'm just need to get the cube to show in the scene, and learn more about threejs, expo-three, and expo-gl

Title: Can't Display an Three cube on GLView

Body:
i'm trying to make an simple cube to display on an Android mobile but the cube
doesn't show on the GLView, can someone pls help me with this. The VSCode doesn't had any Waring or Error so I don't know what wrong with the code @@
Thank you!
`

import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import { ExpoWebGLRenderingContext, GLView } from 'expo-gl';
import ExpoTHREE, { Renderer } from 'expo-three';
import { Screen, Mesh, MeshBasicMaterial, PerspectiveCamera, Scene, } from 'three';
import { THREE } from 'expo-three';

const ThreeD = (props) => {
    const onContextCreate = async (gl) => {
        const scene = new Scene();
        const camera = new PerspectiveCamera(
            45,
            gl.drawingBufferWidth / gl.drawingBufferHeight,
            1,
            1000
        )

        gl.canvas = { width: gl.drawingBufferWidth, height: gl.drawingBufferHeight }
        const renderer = new Renderer({ gl })
        renderer.setSize(gl.drawingBufferWidth, gl.drawingBufferHeight)

        const geometry = new THREE.BoxGeometry(1, 1, 1)
        const material = new MeshBasicMaterial({
            color: 'blue'
        })

        const cube = new Mesh(geometry, material)
        scene.add(cube)
        const render = () => {
            requestAnimationFrame(render)
            renderer.render(scene, camera)
            gl.endFrameEXP()
        }
        render()
    }
    return (
        <GLView
            style={styles.GLView}
            onContextCreate={onContextCreate}
        />
    );
}

const styles = StyleSheet.create({
    GLView: {
        width: 500,
        height: 500,
        backgroundColor: "#90ff90"
    },

});

export default ThreeD;

`

`

import React, { useState, useEffect } from "react";
import {
  SafeAreaView,
  Image,
  View,
  Button,
  StyleSheet,
  Text,
  ScrollView,
  TouchableOpacity,
  Modal,
  Alert,
  TextInput,
  Pressable,
  BackHandler
} from "react-native";
import ThreeD from "../../Components/3D";

export default ThreeDimension = ({ navigation }) => {

  //Main code
  return (
    <SafeAreaView style={styles.container}>
      <View style={styles.banner}>
        <Text style={styles.title}>Tên kho lạnh</Text>
      </View>
      <View style={styles.threecontainer}>
        <ThreeD />
      </View>
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#000000',
  },

  threecontainer: {
    flex: 1,
    backgroundColor: '#90fff0',
  },
  banner: {
    height: "5%"
  },
  title: {
    fontSize: 20,
    color: "#DF8000",
    fontWeight: "bold",
    alignSelf: "center",
  },
  storagecontainer: {
    flex: 1,
  },

  storage: {
    backgroundColor: "#0099ff",
    padding: 50,
    margin: 10,
    borderWidth: 1,
    borderRadius: 10,
  },

  label: {
    fontWeight: 'bold',
  },

});

`

I'm just need to get the cube to show in the scene, and learn more about threejs, expo-three, and expo-gl


问:
Why do the linux leak sanitizer report "bad pointer after pointing to a blank space?
Here I intentionally enter blank space,current->number is a pointer pointing to it.

The problem is, if I don't enter a blank space, there won't be any problem.

How to enter a blanck space without error?


问:
Deploy Simple RASA Chatbot with Azure App Service
I have created a very basic chatbot (With no actions and UI) and I can get the responses via webhooks API locally. Now I have uploaded all my files to an App Service in Azure platform, but when I run the rasa command it shows rasa server is up and running in "0.0.0.0:5005". Why is it not running in the server API?
Do I need to make changes in the credentials.yml and the endpoints.yml?

Also,
Do we have an API for model retraining?

What I expect is to get the chatbot response as a JSON response by accessing the server API endpoint.
*Rasa version -> 3.x, Python 3.8 version and UI is not needed.
*Command used:

```<code>rasa run --enable-api
</code>```

Body:
I have created a very basic chatbot (With no actions and UI) and I can get the responses via webhooks API locally. Now I have uploaded all my files to an App Service in Azure platform, but when I run the rasa command it shows rasa server is up and running in "0.0.0.0:5005". Why is it not running in the server API?
Do I need to make changes in the credentials.yml and the endpoints.yml?

Also,
Do we have an API for model retraining?

What I expect is to get the chatbot response as a JSON response by accessing the server API endpoint.
*Rasa version -> 3.x, Python 3.8 version and UI is not needed.
*Command used:

rasa run --enable-api


问:
ORM Django annotate to convert string field to sorted list
I have a table containing a string field with a value like the following:
'["value1", "value3", "value2"]'.
Using the Django ORM, I require to convert that string type value to a list containing the values sorted alphabetically.
It is necessary to keep the data type as string but to store a list inside it.
So far I managed to convert it to a list but I can't sort the data.</p>
```<code>.annotate(
    my_field=Cast('field', output_field=JSONField()),
)
</code>```

Body:
I have a table containing a string field with a value like the following:
'["value1", "value3", "value2"]'.
Using the Django ORM, I require to convert that string type value to a list containing the values sorted alphabetically.
It is necessary to keep the data type as string but to store a list inside it.
So far I managed to convert it to a list but I can't sort the data.

.annotate(
    my_field=Cast('field', output_field=JSONField()),
)


问:
Incorrect Number of Dimensions Error When Fitting a KNN Model
I am trying to fit a KNN classification model into the folds I created but I keep getting the same error:

"Fold1: preprocessor 1/1, model 1/1: Error in apply(weightClass, 1, order, decreasing = TRUE)[1, ]: incorrect number of dimensions"

I don't know what's wrong. This si the code that I have been using:

`

```<code>folds <- vfold_cv(data = weighted_cps_train, v = 5)

#Creating a recipe object:

weighted_cps_rec <-
  recipe(formula = offpov ~ ., data = weighted_cps_train) %>%
  step_dummy(immigrant,
             pubhous,
             foodstmp,
             sex,
             vetstat,
             labforce,
             diffany,
             himcaidly,
             himcarely,
             phinsur,
             anycovnw,
             kidcneed,
             workly)
  step_center(all_numeric_predictors()) %>%
  step_scale(all_numeric_predictors()) %>%
  step_nzv(all_numeric_predictors()) %>%
  step_other() %>%

# The COVID group included an additional step (downsample), but I'm not sure it would suit us.
# This is their code:

  themis::step_downsample(employed) %>% # subsampling due to class imbalances between employment class
  step_other()

# Creating a KNN model with hyper parameter tuning:

# Creating a KNN model specification:

weighted_cps_knn_mod <-
  nearest_neighbor(neighbors = tune()) %>%
  set_engine(engine = "kknn") %>%
  set_mode(mode = "classification")

# Creating a workflow:

weighted_cps_knn_workflow <-
  workflow() %>%
  add_model(spec = weighted_cps_knn_mod) %>%
  add_recipe(recipe = weighted_cps_rec)

# Creating a tuning grid:

weighted_cps_knn_grid <- grid_regular(neighbors(range = c(1, 15)), levels = 2)

# Estimating models with re-sampling for each row in the tuning grid:

weighted_cps_knn_res <- weighted_cps_knn_workflow %>%
  tune_grid(resamples = folds,
            grid = weighted_cps_knn_grid,
            control = control_grid(save_pred = TRUE),
            metrics = metric_set(accuracy))
</code>```

`

I tried to change the settings in the specifications of the model but nothing worked.

This is a snapshot of the data I'm using. It's from IPUMS CPS.

`

```<code>> dput(head(weighted_cps_train[]))
structure(list(statefip = c(12, 12, 53, 39, 4, 29), county = c(12086,
12109, NA, NA, 4013, NA)), row.names = c(269330L, 87519L, 332249L,
207945L, 322416L, 230928L), class = "data.frame")
> dput(head(iris[]))
structure(list(Sepal.Length = c(5.1, 4.9, 4.7, 4.6, 5, 5.4),
    Sepal.Width = c(3.5, 3, 3.2, 3.1, 3.6, 3.9), Petal.Length = c(1.4,
    1.4, 1.3, 1.5, 1.4, 1.7), Petal.Width = c(0.2, 0.2, 0.2,
    0.2, 0.2, 0.4), Species = structure(c(1L, 1L, 1L, 1L, 1L,
    1L), levels = c("setosa", "versicolor", "virginica"), class = "factor")), row.names = c(NA,
6L), class = "data.frame")
> dput(head(weighted_cps_train[, c(1, 3)]))
structure(list(statefip = c(12, 12, 53, 39, 4, 29), county = c(12086,
12109, NA, NA, 4013, NA)), row.names = c(269330L, 87519L, 332249L,
207945L, 322416L, 230928L), class = "data.frame")
> dput(head(weighted_cps_train[]))
structure(list(statefip = c(12, 12, 53, 39, 4, 29), metro = c(3,
3, 3, 1, 2, 3), county = c(12086, 12109, NA, NA, 4013, NA), ownershp = c(22,
10, 10, 10, 22, 10), hhincome = c(114000, 79433, 98417, 131840,
15000, 17301), pubhous = structure(c(1L, NA, NA, NA, 1L, NA), levels = c("0",
"1"), class = "factor"), foodstmp = structure(c(1L, 1L, 1L, 1L,
1L, 1L), levels = c("0", "1"), class = "factor"), stampmo = structure(c(0L,
0L, 0L, 0L, 0L, 0L), labels = structure(0:12, names = c("NIU",
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight",
"Nine", "Ten", "Eleven", "Twelve")), label = "Number of months received food stamps", var_desc = "STAMPMO specifies the number of months the household received Food Stamps during the previous calendar year. For information about the Food Stamp program, see (FOODSTMP).", class = c("haven_labelled",
"vctrs_vctr", "integer")), stampval = c(NA_real_, NA_real_, NA_real_,
NA_real_, NA_real_, NA_real_), asecwt = c(1665.09, 3296.28, 1719.06,
3452.21, 1793.53, 3496.75), age = structure(c(41L, 15L, 63L,
45L, 3L, 10L), labels = c(`Under 1 year` = 0L, `90 (90+, 1988-2002)` = 90L,
`99+` = 99L), label = "Age", var_desc = "Age gives each person's age at last birthday.", class = c("haven_labelled",
"vctrs_vctr", "integer")), sex = structure(c(2L, 2L, 1L, 2L,
2L, 2L), levels = c("0", "1"), class = "factor"), race = c(100,
100, 100, 100, 100, 100), marst = c(4, 6, 1, 4, 6, 6), vetstat = structure(c(1L,
NA, 1L, 1L, NA, NA), levels = c("0", "1"), class = "factor"),
    famsize = structure(c(2L, 4L, 2L, 2L, 5L, 6L), labels = structure(0:29, names = c("Missing",
    "1 family member present", "2 family members present", "3 family members present",
    "4 family members present", "5 family members present", "6 family members present",
    "7 family members present", "8 family members present", "9 family members present",
    "10 family members present", "11 family members present",
    "12 family members present", "13 family members present",
    "14 family members present", "15 family members present",
    "16 family members present", "17 family members present",
    "18 family members present", "19 family members present",
    "20 family members present", "21 family members present",
    "22 family members present", "23 family members present",
    "24 family members present", "25 family members present",
    "26 family members present", "27 family members present",
    "28 family members present", "29 family members present")), label = "Number of own family members in hh", var_desc = "FAMSIZE counts the number of own family members residing with each individual, including the person her/himself. Persons not living with others related to them by blood, marriage, or adoption are coded 1.\n\nNote that FAMSIZE is an IPUMS-derived variable using IPUMS-derived family interrelationships, which will not necessarily correspond to the Census Bureau's family definitions. See FTYPE, FAMKIND, and FAMREL for variables that correspond to Census family units. IPUMS does not currently offer a corresponding variable for the size of the Census family unit, but variables necessitating this information such as POVERTY already take the Census family unit size into account.\n\nAn Introduction to the Family Interrelationship Variables can be found on IPUMS-USA. On this page you'll find information on how IPUMS family interrelationship variables are constructed, common uses of these variables, and specific examples of how these variables can be used efficiently.", class = c("haven_labelled",
    "vctrs_vctr", "integer")), nchild = structure(c(0L, 0L, 0L,
    0L, 0L, 0L), labels = c(`0 children present` = 0L, `1 child present` = 1L,
    `9+` = 9L), label = "Number of own children in household", var_desc = "NCHILD counts the number of own children (of any age or marital status) residing with each individual. NCHILD includes step-children and adopted children as well as biological children. Persons with no children present are coded 0.\n\nNote that NCHILD is an IPUMS-derived variable using IPUMS-derived family interrelationships. Thus NCHILD may differ from any family information that comes from just the Census family definitions. See for example FTYPE, FAMKIND, and FAMREL for more on Census family units.", class = c("haven_labelled",
    "vctrs_vctr", "integer")), nchlt5 = structure(c(0L, 0L, 0L,
    0L, 0L, 0L), labels = c(`No children under age 5` = 0L, `1 child under age 5` = 1L,
    `9+` = 9L), label = "Number of own children under age 5 in hh", var_desc = "NCHLT5 counts the number of own children age 4 and under residing with each individual. NCHLT5 includes step-children and adopted children as well as biological children. Persons with no children under 5 present are coded 0.\n\nNote that NCHLT5 is an IPUMS-derived variable using IPUMS-derived family interrelationships. Thus NCHLT5 may differ from any family information that comes from just the Census family definitions. See for example FTYPE, FAMKIND, and FAMREL for more on Census family units.", class = c("haven_labelled",
    "vctrs_vctr", "integer")), bpl = c(30005, 9900, 9900, 9900,
    20000, 9900), yrimmig = c(1995, NA, NA, NA, 2019, NA), citizen = c(4,
    1, 1, 1, 5, 1), hispan = c(612, 0, 0, 0, 100, 0), empstat = c(10,
    34, 36, 10, NA, NA), labforce = structure(c(2L, 1L, 1L, 2L,
    NA, NA), levels = c("0", "1"), class = "factor"), occ = c(4300,
    0, 0, 430, 0, 0), ind = c(8590, 0, 0, 3570, 0, 0), classwkr = c(28,
    NA, NA, 21, NA, NA), uhrsworkt = c(40, NA, NA, 45, NA, NA
    ), educ = c(111, 40, 111, 81, NA, NA), diffany = structure(c(1L,
    1L, 1L, 1L, NA, NA), levels = c("0", "1"), class = "factor"),
    occly = c(4300, 0, 0, 430, 0, 0), indly = c(8590, 0, 0, 3570,
    0, 0), classwly = c(28, NA, NA, 22, NA, NA), workly = structure(c(2L,
    1L, 1L, 2L, NA, NA), levels = c("0", "1"), class = "factor"),
    incfarm = c(0, 0, 0, 0, NA, NA), incss = c(0, 0, 2400, 0,
    NA, NA), incint = c(0, 10, 21, 250, NA, NA), offpov = structure(c(1L,
    1L, 1L, 1L, 2L, 2L), levels = c("0", "1"), class = "factor"),
    poverty = c(23, 23, 23, 23, 10, 10), migrate1 = c(1, 1, 1,
    4, 1, 1), himcaidly = structure(c(1L, 1L, 1L, 1L, 2L, 2L), levels = c("0",
    "1"), class = "factor"), himcarely = structure(c(1L, 1L,
    1L, 1L, NA, NA), levels = c("0", "1"), class = "factor"),
    phinsur = structure(c(2L, 2L, 2L, 2L, 1L, 2L), levels = c("0",
    "1"), class = "factor"), moop = c(100, 11840, 50425, 8750,
    150, 12110), anycovnw = structure(c(1L, 1L, 1L, 1L, 1L, 1L
    ), levels = c("0", "1"), class = "factor"), kidcneed = structure(c(NA,
    NA, NA, NA, 1L, 1L), levels = c("0", "1"), class = "factor"),
    union = c(NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_), immigrant = structure(c(2L, 1L, 1L, 1L, 2L, 1L
    ), levels = c("0", "1"), class = "factor")), row.names = c(269330L,
87519L, 332249L, 207945L, 322416L, 230928L), class = "data.frame")
</code>```

`

Body:
I am trying to fit a KNN classification model into the folds I created but I keep getting the same error:

"Fold1: preprocessor 1/1, model 1/1: Error in apply(weightClass, 1, order, decreasing = TRUE)[1, ]: incorrect number of dimensions"

I don't know what's wrong. This si the code that I have been using:

`

folds <- vfold_cv(data = weighted_cps_train, v = 5)

#Creating a recipe object:

weighted_cps_rec <-
  recipe(formula = offpov ~ ., data = weighted_cps_train) %>%
  step_dummy(immigrant,
             pubhous,
             foodstmp,
             sex,
             vetstat,
             labforce,
             diffany,
             himcaidly,
             himcarely,
             phinsur,
             anycovnw,
             kidcneed,
             workly)
  step_center(all_numeric_predictors()) %>%
  step_scale(all_numeric_predictors()) %>%
  step_nzv(all_numeric_predictors()) %>%
  step_other() %>%

# The COVID group included an additional step (downsample), but I'm not sure it would suit us.
# This is their code:

  themis::step_downsample(employed) %>% # subsampling due to class imbalances between employment class
  step_other()

# Creating a KNN model with hyper parameter tuning:

# Creating a KNN model specification:

weighted_cps_knn_mod <-
  nearest_neighbor(neighbors = tune()) %>%
  set_engine(engine = "kknn") %>%
  set_mode(mode = "classification")

# Creating a workflow:

weighted_cps_knn_workflow <-
  workflow() %>%
  add_model(spec = weighted_cps_knn_mod) %>%
  add_recipe(recipe = weighted_cps_rec)

# Creating a tuning grid:

weighted_cps_knn_grid <- grid_regular(neighbors(range = c(1, 15)), levels = 2)

# Estimating models with re-sampling for each row in the tuning grid:

weighted_cps_knn_res <- weighted_cps_knn_workflow %>%
  tune_grid(resamples = folds,
            grid = weighted_cps_knn_grid,
            control = control_grid(save_pred = TRUE),
            metrics = metric_set(accuracy))

`

I tried to change the settings in the specifications of the model but nothing worked.

This is a snapshot of the data I'm using. It's from IPUMS CPS.

`

> dput(head(weighted_cps_train[]))
structure(list(statefip = c(12, 12, 53, 39, 4, 29), county = c(12086,
12109, NA, NA, 4013, NA)), row.names = c(269330L, 87519L, 332249L,
207945L, 322416L, 230928L), class = "data.frame")
> dput(head(iris[]))
structure(list(Sepal.Length = c(5.1, 4.9, 4.7, 4.6, 5, 5.4),
    Sepal.Width = c(3.5, 3, 3.2, 3.1, 3.6, 3.9), Petal.Length = c(1.4,
    1.4, 1.3, 1.5, 1.4, 1.7), Petal.Width = c(0.2, 0.2, 0.2,
    0.2, 0.2, 0.4), Species = structure(c(1L, 1L, 1L, 1L, 1L,
    1L), levels = c("setosa", "versicolor", "virginica"), class = "factor")), row.names = c(NA,
6L), class = "data.frame")
> dput(head(weighted_cps_train[, c(1, 3)]))
structure(list(statefip = c(12, 12, 53, 39, 4, 29), county = c(12086,
12109, NA, NA, 4013, NA)), row.names = c(269330L, 87519L, 332249L,
207945L, 322416L, 230928L), class = "data.frame")
> dput(head(weighted_cps_train[]))
structure(list(statefip = c(12, 12, 53, 39, 4, 29), metro = c(3,
3, 3, 1, 2, 3), county = c(12086, 12109, NA, NA, 4013, NA), ownershp = c(22,
10, 10, 10, 22, 10), hhincome = c(114000, 79433, 98417, 131840,
15000, 17301), pubhous = structure(c(1L, NA, NA, NA, 1L, NA), levels = c("0",
"1"), class = "factor"), foodstmp = structure(c(1L, 1L, 1L, 1L,
1L, 1L), levels = c("0", "1"), class = "factor"), stampmo = structure(c(0L,
0L, 0L, 0L, 0L, 0L), labels = structure(0:12, names = c("NIU",
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight",
"Nine", "Ten", "Eleven", "Twelve")), label = "Number of months received food stamps", var_desc = "STAMPMO specifies the number of months the household received Food Stamps during the previous calendar year. For information about the Food Stamp program, see (FOODSTMP).", class = c("haven_labelled",
"vctrs_vctr", "integer")), stampval = c(NA_real_, NA_real_, NA_real_,
NA_real_, NA_real_, NA_real_), asecwt = c(1665.09, 3296.28, 1719.06,
3452.21, 1793.53, 3496.75), age = structure(c(41L, 15L, 63L,
45L, 3L, 10L), labels = c(`Under 1 year` = 0L, `90 (90+, 1988-2002)` = 90L,
`99+` = 99L), label = "Age", var_desc = "Age gives each person's age at last birthday.", class = c("haven_labelled",
"vctrs_vctr", "integer")), sex = structure(c(2L, 2L, 1L, 2L,
2L, 2L), levels = c("0", "1"), class = "factor"), race = c(100,
100, 100, 100, 100, 100), marst = c(4, 6, 1, 4, 6, 6), vetstat = structure(c(1L,
NA, 1L, 1L, NA, NA), levels = c("0", "1"), class = "factor"),
    famsize = structure(c(2L, 4L, 2L, 2L, 5L, 6L), labels = structure(0:29, names = c("Missing",
    "1 family member present", "2 family members present", "3 family members present",
    "4 family members present", "5 family members present", "6 family members present",
    "7 family members present", "8 family members present", "9 family members present",
    "10 family members present", "11 family members present",
    "12 family members present", "13 family members present",
    "14 family members present", "15 family members present",
    "16 family members present", "17 family members present",
    "18 family members present", "19 family members present",
    "20 family members present", "21 family members present",
    "22 family members present", "23 family members present",
    "24 family members present", "25 family members present",
    "26 family members present", "27 family members present",
    "28 family members present", "29 family members present")), label = "Number of own family members in hh", var_desc = "FAMSIZE counts the number of own family members residing with each individual, including the person her/himself. Persons not living with others related to them by blood, marriage, or adoption are coded 1.\n\nNote that FAMSIZE is an IPUMS-derived variable using IPUMS-derived family interrelationships, which will not necessarily correspond to the Census Bureau's family definitions. See FTYPE, FAMKIND, and FAMREL for variables that correspond to Census family units. IPUMS does not currently offer a corresponding variable for the size of the Census family unit, but variables necessitating this information such as POVERTY already take the Census family unit size into account.\n\nAn Introduction to the Family Interrelationship Variables can be found on IPUMS-USA. On this page you'll find information on how IPUMS family interrelationship variables are constructed, common uses of these variables, and specific examples of how these variables can be used efficiently.", class = c("haven_labelled",
    "vctrs_vctr", "integer")), nchild = structure(c(0L, 0L, 0L,
    0L, 0L, 0L), labels = c(`0 children present` = 0L, `1 child present` = 1L,
    `9+` = 9L), label = "Number of own children in household", var_desc = "NCHILD counts the number of own children (of any age or marital status) residing with each individual. NCHILD includes step-children and adopted children as well as biological children. Persons with no children present are coded 0.\n\nNote that NCHILD is an IPUMS-derived variable using IPUMS-derived family interrelationships. Thus NCHILD may differ from any family information that comes from just the Census family definitions. See for example FTYPE, FAMKIND, and FAMREL for more on Census family units.", class = c("haven_labelled",
    "vctrs_vctr", "integer")), nchlt5 = structure(c(0L, 0L, 0L,
    0L, 0L, 0L), labels = c(`No children under age 5` = 0L, `1 child under age 5` = 1L,
    `9+` = 9L), label = "Number of own children under age 5 in hh", var_desc = "NCHLT5 counts the number of own children age 4 and under residing with each individual. NCHLT5 includes step-children and adopted children as well as biological children. Persons with no children under 5 present are coded 0.\n\nNote that NCHLT5 is an IPUMS-derived variable using IPUMS-derived family interrelationships. Thus NCHLT5 may differ from any family information that comes from just the Census family definitions. See for example FTYPE, FAMKIND, and FAMREL for more on Census family units.", class = c("haven_labelled",
    "vctrs_vctr", "integer")), bpl = c(30005, 9900, 9900, 9900,
    20000, 9900), yrimmig = c(1995, NA, NA, NA, 2019, NA), citizen = c(4,
    1, 1, 1, 5, 1), hispan = c(612, 0, 0, 0, 100, 0), empstat = c(10,
    34, 36, 10, NA, NA), labforce = structure(c(2L, 1L, 1L, 2L,
    NA, NA), levels = c("0", "1"), class = "factor"), occ = c(4300,
    0, 0, 430, 0, 0), ind = c(8590, 0, 0, 3570, 0, 0), classwkr = c(28,
    NA, NA, 21, NA, NA), uhrsworkt = c(40, NA, NA, 45, NA, NA
    ), educ = c(111, 40, 111, 81, NA, NA), diffany = structure(c(1L,
    1L, 1L, 1L, NA, NA), levels = c("0", "1"), class = "factor"),
    occly = c(4300, 0, 0, 430, 0, 0), indly = c(8590, 0, 0, 3570,
    0, 0), classwly = c(28, NA, NA, 22, NA, NA), workly = structure(c(2L,
    1L, 1L, 2L, NA, NA), levels = c("0", "1"), class = "factor"),
    incfarm = c(0, 0, 0, 0, NA, NA), incss = c(0, 0, 2400, 0,
    NA, NA), incint = c(0, 10, 21, 250, NA, NA), offpov = structure(c(1L,
    1L, 1L, 1L, 2L, 2L), levels = c("0", "1"), class = "factor"),
    poverty = c(23, 23, 23, 23, 10, 10), migrate1 = c(1, 1, 1,
    4, 1, 1), himcaidly = structure(c(1L, 1L, 1L, 1L, 2L, 2L), levels = c("0",
    "1"), class = "factor"), himcarely = structure(c(1L, 1L,
    1L, 1L, NA, NA), levels = c("0", "1"), class = "factor"),
    phinsur = structure(c(2L, 2L, 2L, 2L, 1L, 2L), levels = c("0",
    "1"), class = "factor"), moop = c(100, 11840, 50425, 8750,
    150, 12110), anycovnw = structure(c(1L, 1L, 1L, 1L, 1L, 1L
    ), levels = c("0", "1"), class = "factor"), kidcneed = structure(c(NA,
    NA, NA, NA, 1L, 1L), levels = c("0", "1"), class = "factor"),
    union = c(NA_real_, NA_real_, NA_real_, NA_real_, NA_real_,
    NA_real_), immigrant = structure(c(2L, 1L, 1L, 1L, 2L, 1L
    ), levels = c("0", "1"), class = "factor")), row.names = c(269330L,
87519L, 332249L, 207945L, 322416L, 230928L), class = "data.frame")

`


问:
how to make a constant activity with many variable images, data..... : android studio
i create a (table) list of names, and images of those names in drawable, and each image i create an activity   so when i click the name it show the image in new activity .
(100 names means 100 activities)
the question is:
how to make one constant activity instead of many activities having image as variable?
(100 names need main activity and constant activity)

I watch many tutorials but didn't find the answer


问:
java.io.FileNotFoundException: class path resource [spring/container-service.xml] cannot be opened because it does not exist
We are upgrading a library and are running into an error when loading the App context:

AbstractApplicationContext appCtx = new ClassPathXmlApplicationContext("/spring/**/*.xml");

The relevant xml (container-service.xml) has never been part of this project, but is mentioned in the xmls of a few dependencies. Even when these dependencies are excluded, we see the below error. I am wondering how we can resolve this? is there an issue with the the way the application context is being loaded? Thank you!

The error is:

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:/spring/container-service.xml]
Offending resource: class path resource [spring/attribute-management-remote-service.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring/container-service.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring/container-service.xml] cannot be opened because it does not exist
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:72)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:119)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:104)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:240)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:191)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:176)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:149)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:96)
at


问:
where is the `r` from in nested java lambda expression `r -> executor.execute(() -> send(r, requestTypeUrl))`
Original code:

abstract void computeWatch(String typeUrl, Supplier<Watch> watchCreator);
```
<pre class="lang-java prettyprint-override"><code>
      computeWatch(requestTypeUrl, () -> discoveryServer.configWatcher.createWatch(
          ads(),
          request,
          ackedResources(requestTypeUrl),
          r -> executor.execute(() -> send(r, requestTypeUrl)),
          hasClusterChanged
      ));
</code>```

The createWatch()

  Watch createWatch(
      boolean ads,
      XdsRequest request,
      Set<String> knownResourceNames,
      Consumer<Response> responseConsumer,
      boolean hasClusterChanged);
```
<p><strong>Question</strong>:</p>
<p><code>r -> executor.execute(() -> send(r, requestTypeUrl))</code></p>
<p>So where does the <code>Response r</code> declaration?</p>
<p>No parameter for this <code>() -> send(r, requestTypeUrl)</code>?</p>
<p>and one parameter for this <code>r -> executor.execute(**r**)</code>?</p>
<pre class="lang-java prettyprint-override"><code>void funA () {
    send (r, requestTypeUrl);
}

void funB (Response r) {
    executor.execute(funA());
}
</code>```

Three nested lambda express. I am confused about where Response r from? And what it is expanding method look like? Thank you for your consideraiton.

EDIT 1

computeWatch(requestTypeUrl, funC());

Watch funC () {
    discoveryServer.configWatcher.createWatch(
          ads(),
          request,
          ackedResources(requestTypeUrl),
          funB(),
          hasClusterChanged
      )
}

void funA () {
    send (r, requestTypeUrl);
}

void funB (Response r) {
    executor.execute(funA());
}
```
<p>Where is the <code>r</code> from?</p>
<p><strong>EDIT 2</strong></p>
<pre class="lang-java prettyprint-override"><code>// The original r
Response r;

Consumer<Response> consumer1 = funC();
consumer1.accept(r);   // Calling Consumer method

computeWatch(requestTypeUrl, funC());

Watch funC () {
    discoveryServer.configWatcher.createWatch(
          ads(),
          request,
          ackedResources(requestTypeUrl),
          funB(r),
          hasClusterChanged
      )
}

</code>```

EDIT 3

      Consumer<Response> responseConsumer = new Consumer<Response>() {
        @Override
        public void accept(Response response) {
          System.out.println(myGlobalPrefix + response.resources());
          System.out.println("+++++++++++++++++++++");
          executor.execute(new Runnable() {

            @Override
            public void run() {
              send(response, requestTypeUrl);
              System.out.println(myGlobalPrefix + response.toString());
              System.out.println(myGlobalPrefix + requestTypeUrl);
            }
          });
        }
      };

      System.out.println(myGlobalPrefix + responseConsumer.toString());
      computeWatch(requestTypeUrl, ()->discoveryServer.configWatcher.createWatch(
              ads(),
              request,
              ackedResources(requestTypeUrl),
              responseConsumer,
              hasClusterChanged
      ));
```

Body:
Original code:

abstract void computeWatch(String typeUrl, Supplier<Watch> watchCreator);

      computeWatch(requestTypeUrl, () -> discoveryServer.configWatcher.createWatch(
          ads(),
          request,
          ackedResources(requestTypeUrl),
          r -> executor.execute(() -> send(r, requestTypeUrl)),
          hasClusterChanged
      ));

The createWatch()

  Watch createWatch(
      boolean ads,
      XdsRequest request,
      Set<String> knownResourceNames,
      Consumer<Response> responseConsumer,
      boolean hasClusterChanged);

Question:

r -> executor.execute(() -> send(r, requestTypeUrl))

So where does the Response r declaration?

No parameter for this () -> send(r, requestTypeUrl)?

and one parameter for this r -> executor.execute(**r**)?

void funA () {
    send (r, requestTypeUrl);
}

void funB (Response r) {
    executor.execute(funA());
}

Three nested lambda express. I am confused about where Response r from? And what it is expanding method look like? Thank you for your consideraiton.

EDIT 1

computeWatch(requestTypeUrl, funC());

Watch funC () {
    discoveryServer.configWatcher.createWatch(
          ads(),
          request,
          ackedResources(requestTypeUrl),
          funB(),
          hasClusterChanged
      )
}

void funA () {
    send (r, requestTypeUrl);
}

void funB (Response r) {
    executor.execute(funA());
}

Where is the r from?

EDIT 2

// The original r
Response r;

Consumer<Response> consumer1 = funC();
consumer1.accept(r);   // Calling Consumer method

computeWatch(requestTypeUrl, funC());

Watch funC () {
    discoveryServer.configWatcher.createWatch(
          ads(),
          request,
          ackedResources(requestTypeUrl),
          funB(r),
          hasClusterChanged
      )
}

EDIT 3

      Consumer<Response> responseConsumer = new Consumer<Response>() {
        @Override
        public void accept(Response response) {
          System.out.println(myGlobalPrefix + response.resources());
          System.out.println("+++++++++++++++++++++");
          executor.execute(new Runnable() {

            @Override
            public void run() {
              send(response, requestTypeUrl);
              System.out.println(myGlobalPrefix + response.toString());
              System.out.println(myGlobalPrefix + requestTypeUrl);
            }
          });
        }
      };

      System.out.println(myGlobalPrefix + responseConsumer.toString());
      computeWatch(requestTypeUrl, ()->discoveryServer.configWatcher.createWatch(
              ads(),
              request,
              ackedResources(requestTypeUrl),
              responseConsumer,
              hasClusterChanged
      ));


问:
How to dynamically generate SVG image from java code in thymeleaf?
I am stuck at one point where I have to display a SVG image on the springboot webpage, which is generated from Graphviz code in Java.
Any help is highly appreciated.

This is my controller class.

```<code>    @RequestMapping(value = "/e2emap", method = RequestMethod.GET)
    public String getE2E_WebPage(Model model
            @RequestParam(name = Query_refresh_param, required = false) String refreshInterval) throws IOException {
        final var graph = graphGenerator.createGraph();
        final String graphString = java.util.Base64.getEncoder().encodeToString(graph);

        model.addAttribute("graphVariable", graphString);
        model.addAttribute("graph", graph);

        return "Dynamic";
</code>```

Here is the Dynamic.html file.

```<code><!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
 <meta charset = "UTF-8" />
 <link href="../static/css/styles.css" data-th-href="@{/css/styles.css}" rel="stylesheet" />
 <title>SRE End-2-End flow</title>
</head>
<body>
 <div class="title"><a class="a-sre-e2e" >SRE End-2-End Flow</a></div>
 <meta http-equiv= "refresh" content = "15 " />
 <p>
 <form action="/e2emap" method="get">
 <span class="variable-title">Target Environment</span>
 <select class="variable-combobox-values" name="target_env" id="target_env" onchange="submit()">
 <option th:each="env : ${environments}" th:text="${env}" th:selected="${env}==${targetEnv}">sample-env</option>
   </select>
  </form>
  <h1 th:text="${targetEnv}">bla-bla</h1>
  <span>
  <img th:src="@{'data:graph/svg;base64' + ${graph}}"> </img> Image
  </span>
</body>
</html>
</code>```

Some points to specify:
method createGraph() is the main method that uses graphviz to generate the graph and returns the graph in byteArray[] form.

The html has a drop down list to select different values. On-click, it should display the graph, which is not happening at the moment.

Body:
I am stuck at one point where I have to display a SVG image on the springboot webpage, which is generated from Graphviz code in Java.
Any help is highly appreciated.

This is my controller class.

    @RequestMapping(value = "/e2emap", method = RequestMethod.GET)
    public String getE2E_WebPage(Model model
            @RequestParam(name = Query_refresh_param, required = false) String refreshInterval) throws IOException {
        final var graph = graphGenerator.createGraph();
        final String graphString = java.util.Base64.getEncoder().encodeToString(graph);

        model.addAttribute("graphVariable", graphString);
        model.addAttribute("graph", graph);

        return "Dynamic";

Here is the Dynamic.html file.

<!DOCTYPE html>

 <meta charset = "UTF-8" />
 <link href="../static/css/styles.css" data-th-href="@{/css/styles.css}" rel="stylesheet" />
 <title>SRE End-2-End flow</title>

SRE End-2-End Flow

 <meta http-equiv= "refresh" content = "15 " />

 <form action="/e2emap" method="get">
 Target Environment
 <select class="variable-combobox-values" name="target_env" id="target_env" onchange="submit()">
 <option th:each="env : ${environments}" th:text="${env}" th:selected="${env}==${targetEnv}">sample-env</option>
   </select>
  </form>

bla-bla

    Image

Some points to specify:
method createGraph() is the main method that uses graphviz to generate the graph and returns the graph in byteArray[] form.

The html has a drop down list to select different values. On-click, it should display the graph, which is not happening at the moment.


问:
I can't execut OpenDebugA7
Error while executing OpenDebugA7 from cpptools in dap nvim
zsh: no such file or directory ./OpenDebugA7
I'm using termux aarch64 and linux aarch64 release of cpptools

I would know what's the wrong!

Title: I can't execut OpenDebugA7


问:
How do I add SSL configuration to JBOSS standalone file for a Spring Boot application?
We have a Spring Boot application that we need to deploy to a JBOSS server. We have a requirement to keep all configuration in the JBOSS standalone.xml file. I need to get SSL set up on the Spring Boot application, but every guide I find shows how to add it to application.properties. How can I tell the Spring Boot application to use the SSL configuration from the JBOSS standalone.xml file?</p>


问:
how to execute loop after completion of onchange event
for each value, i have to trigger onchange event. However, with the current code, onchange event is not triggering for each value.

it works fine with one single array value. However, it is causing issue with multiple values. i think we need to trigger one onchange event at a time. once it is complete, then move to next array value and trigger onchange event again.
my code is:

```<code>for ( var i=0; i <= getzip.length-1; i++)
     {
           $('span:contains('+getzip[i]+')').parent().parent().find('td:nth-child(4) > Span > input').not('[disabled="disabled"]').attr('checked', true);
           $('span:contains('+getzip[i]+')').parent().parent().find('td:nth-child(4) > Span').trigger('onchange');

     }
</code>```

Thanks,

Tried with above code but it is not giving expected result.

Body:
for each value, i have to trigger onchange event. However, with the current code, onchange event is not triggering for each value.

it works fine with one single array value. However, it is causing issue with multiple values. i think we need to trigger one onchange event at a time. once it is complete, then move to next array value and trigger onchange event again.
my code is:

for ( var i=0; i <= getzip.length-1; i++)
     {
           $('span:contains('+getzip[i]+')').parent().parent().find('td:nth-child(4) > Span > input').not('[disabled="disabled"]').attr('checked', true);
           $('span:contains('+getzip[i]+')').parent().parent().find('td:nth-child(4) > Span').trigger('onchange');

     }

Thanks,

Tried with above code but it is not giving expected result.


问:
Get a specific value of a string_split in MSSQL
I have a string like this

0011.06.123.7-0

SELECT STRING_SPLIT(NUMBER,'.')

returns

Values

0011

06

123

And now I only and always need the third value, in this case '123'
How do I select this proberly?

I already tried to get the third value with the Rownumber, but that didn't worked out.