问:
Angular Datatable - when the component is rendered for the first time I'm not getting any data
I am facing a really hard time working with the angular data table, I'm using ajax to get data from the API the problem is when the component is rendered for the first time I'm not getting any data after this if I click on the column to order the data it works well

I am initializing the dtOptions in the ngOnInit Method so I expected to get the data when the component is rendered for the first time

first

after I click on a column to order the data or I try to use the search bar
image

I'm getting this error in the console

```<code>main.ts:11 ERROR TypeError: Cannot read properties of undefined (reading 'length')
    at Jb (node_modules\datatables.net\js\jquery.dataTables.min.js:40:238)
    at Aa (node_modules\datatables.net\js\jquery.dataTables.min.js:62:175)
    at f (node_modules\datatables.net\js\jquery.dataTables.min.js:111:104)
    at HTMLTableElement.<anonymous> (node_modules\datatables.net\js\jquery.dataTables.min.js:111:157)
    at Function.each (node_modules\jquery\dist\jquery.js:385:1)
    at jQuery.fn.init.each (node_modules\jquery\dist\jquery.js:207:1)
    at jQuery.fn.init.u [as dataTable] (node_modules\datatables.net\js\jquery.dataTables.min.js:101:182)
    at l.fn.DataTable (node_modules\datatables.net\js\jquery.dataTables.min.js:191:467)
    at angular-datatables.directive.js:80:58
    at timer (zone.js:2405:41)
</code>```

Environment:

NodeJS version: 18.0.0

Angular version: 14.1.0

Angular CLI version: 14.1.0

jQuery version: 3.6.1

DataTables version: ^14.0.0

angular-datatables version: ^14.0.0

//ngOnInit

```<code> ngOnInit() {
    const me = this;
 // get language
 this.langServiceSupscribtion = this.sharedService.lang.subscribe((l) => {
  this.lang = l;
});

this.dtOptions = {
  paging: true,
  pagingType: 'full_numbers',
  pageLength: 10,
  autoWidth: true,
  serverSide: true,
  searching: true,
  ajax: (dataTablesParameters: any, callback, settings) => {
    console.log(dataTablesParameters);
    dataTablesParameters.searchCriteria = me._searchCriteria;
    me.transactionService
      .getAllTransactionsFunctional(dataTablesParameters)
      .subscribe((resp) => {
        if (resp['succeeded']) {
          me.transactionsList = resp['data'];
          console.log(me.transactionsList);
          callback({
            recordsTotal: resp['recordsTotal'],
            recordsFiltered: resp['recordsFiltered'],
            data: [],
          });
        } else {
          console.log("resp['errors']");
        }
      });
  },
  columns: [
    { data: 'transactionType' },
    { data: 'radionuclideName' },
    { data: 'radioActivity' },
    { data: 'createdOn' },
    { data: 'facilityEn' },
    { data: 'licenseNumber' },
    { data: 'permitNumber' },
    { data: 'manufacturerSerialNo' },
    { data: 'sourceStatus' },
    { data: null },
  ],
};
</code>```

}

// HTML

```<code> <table
          datatable
          [dtOptions]="dtOptions"
          id="sourcesDataTable"
          class="table datatable table-responsive table-striped table-bordered row-border table-hover table-sm w-100 overflow-auto"
        >
          <thead>
            <tr>
              <th class="select-filter">
                {{ "landingPage.transactionType" | translate }}
              </th>
              <th class="select-filter">
                {{ "landingPage.radionuclide" | translate }}
              </th>
              <th class="select-filter">
                {{ "landingPage.radioactivity" | translate }}
              </th>
              <th class="select-filter">
                {{ "landingPage.transactionDate" | translate }}
              </th>
              <th class="select-filter">
                {{ "landingPage.facility" | translate }}
              </th>
              <th class="select-filter">
                {{ "landingPage.license" | translate }}
              </th>
              <th class="select-filter">
                {{ "landingPage.permit" | translate }}
              </th>
              <th class="select-filter">
                {{ "landingPage.manufacturerSerialNo" | translate }}
              </th>
              <th class="select-filter">
                {{ "landingPage.transactionStatus" | translate }}
              </th>
              <th>{{ "landingPage.view" | translate }}</th>
            </tr>
          </thead>
          <tbody *ngIf="transactionsList?.length != 0">
            <tr *ngFor="let t of transactionsList">
              <td>{{ t.transactionType }}</td>
              <td>{{ t.radionuclideName }}</td>
              <td>{{ t.radioActivity }}</td>
              <td>{{ t.createdOn }}</td>
              <td>{{ t.facilityEn }}</td>
              <td>{{ t.licenseNumber }}</td>
              <td>{{ t.permitNumber }}</td>
              <td>{{ t.manufacturerSerialNo }}</td>
              <td>{{ t.sourceStatus }}</td>
              <td class="px-2">
                <button
                  class="edit btn btn-success btn-sm mx-1"
                  style="width: 100%"
                >
                  <fa-icon [icon]="faListDots"> </fa-icon>
                </button>
              </td>
            </tr>
          </tbody>
          <tbody *ngIf="transactionsList?.length == 0">
            <tr>
              <td colspan="10" class="no-data-available">
                {{ "no_data" | translate }}
              </td>
            </tr>
          </tbody>
          <tfoot>
            <th>
              <input
                class="search-input"
                name="transactionType"
                type="text"
                placeholder="{{
                  'landingPage.transactionTypePlaceholder' | translate
                }}"
                style="width: 100%"
              />
            </th>
            <th>
              <input
                class="search-input"
                name="radionuclide"
                type="text"
                placeholder="{{
                  'landingPage.radionuclidePlaceholder' | translate
                }}"
                style="width: 100%"
              />
            </th>
            <th>
              <input
                class="search-input"
                name="radioactivity"
                type="text"
                placeholder="{{
                  'landingPage.radioactivityPlaceholder' | translate
                }}"
                style="width: 100%"
              />
            </th>
            <th>
              <input
                class="search-input"
                name="transactionType"
                type="text"
                placeholder="{{
                  'landingPage.transactionDatePlaceholder' | translate
                }}"
                style="width: 100%"
              />
            </th>
            <th>
              <input
                class="search-input"
                name="transactionType"
                type="text"
                placeholder="{{
                  'landingPage.facilityPlaceholder' | translate
                }}"
                style="width: 100%"
              />
            </th>
            <th>
              <input
                class="search-input"
                name="transactionType"
                type="text"
                placeholder="{{ 'landingPage.licensePlaceholder' | translate }}"
                style="width: 100%"
              />
            </th>
            <th>
              <input
                class="search-input"
                name="transactionType"
                type="text"
                placeholder="{{ 'landingPage.permitPlaceholder' | translate }}"
                style="width: 100%"
              />
            </th>
            <th>
              <input
                class="search-input"
                name="transactionType"
                type="text"
                placeholder="{{
                  'landingPage.manufacturerSerialNoPlaceholder' | translate
                }}"
                style="width: 100%"
              />
            </th>
            <th>
              <input
                class="search-input"
                name="transactionType"
                type="text"
                placeholder="{{
                  'landingPage.transactionStatusPlaceholder' | translate
                }}"
                style="width: 100%"
              />
            </th>
            <th></th>
          </tfoot>
        </table>
</code>```

Body:
I am facing a really hard time working with the angular data table, I'm using ajax to get data from the API the problem is when the component is rendered for the first time I'm not getting any data after this if I click on the column to order the data it works well

I am initializing the dtOptions in the ngOnInit Method so I expected to get the data when the component is rendered for the first time

first

after I click on a column to order the data or I try to use the search bar
image

I'm getting this error in the console

main.ts:11 ERROR TypeError: Cannot read properties of undefined (reading 'length')
    at Jb (node_modules\datatables.net\js\jquery.dataTables.min.js:40:238)
    at Aa (node_modules\datatables.net\js\jquery.dataTables.min.js:62:175)
    at f (node_modules\datatables.net\js\jquery.dataTables.min.js:111:104)
    at HTMLTableElement.<anonymous> (node_modules\datatables.net\js\jquery.dataTables.min.js:111:157)
    at Function.each (node_modules\jquery\dist\jquery.js:385:1)
    at jQuery.fn.init.each (node_modules\jquery\dist\jquery.js:207:1)
    at jQuery.fn.init.u [as dataTable] (node_modules\datatables.net\js\jquery.dataTables.min.js:101:182)
    at l.fn.DataTable (node_modules\datatables.net\js\jquery.dataTables.min.js:191:467)
    at angular-datatables.directive.js:80:58
    at timer (zone.js:2405:41)

Environment:

NodeJS version: 18.0.0

Angular version: 14.1.0

Angular CLI version: 14.1.0

jQuery version: 3.6.1

DataTables version: ^14.0.0

angular-datatables version: ^14.0.0

//ngOnInit

 ngOnInit() {
    const me = this;
 // get language
 this.langServiceSupscribtion = this.sharedService.lang.subscribe((l) => {
  this.lang = l;
});

this.dtOptions = {
  paging: true,
  pagingType: 'full_numbers',
  pageLength: 10,
  autoWidth: true,
  serverSide: true,
  searching: true,
  ajax: (dataTablesParameters: any, callback, settings) => {
    console.log(dataTablesParameters);
    dataTablesParameters.searchCriteria = me._searchCriteria;
    me.transactionService
      .getAllTransactionsFunctional(dataTablesParameters)
      .subscribe((resp) => {
        if (resp['succeeded']) {
          me.transactionsList = resp['data'];
          console.log(me.transactionsList);
          callback({
            recordsTotal: resp['recordsTotal'],
            recordsFiltered: resp['recordsFiltered'],
            data: [],
          });
        } else {
          console.log("resp['errors']");
        }
      });
  },
  columns: [
    { data: 'transactionType' },
    { data: 'radionuclideName' },
    { data: 'radioActivity' },
    { data: 'createdOn' },
    { data: 'facilityEn' },
    { data: 'licenseNumber' },
    { data: 'permitNumber' },
    { data: 'manufacturerSerialNo' },
    { data: 'sourceStatus' },
    { data: null },
  ],
};

}

// HTML

                {{ "landingPage.transactionType" | translate }}

                {{ "landingPage.radionuclide" | translate }}

                {{ "landingPage.radioactivity" | translate }}

                {{ "landingPage.transactionDate" | translate }}

                {{ "landingPage.facility" | translate }}

                {{ "landingPage.license" | translate }}

                {{ "landingPage.permit" | translate }}

                {{ "landingPage.manufacturerSerialNo" | translate }}

                {{ "landingPage.transactionStatus" | translate }}

              {{ "landingPage.view" | translate }}

              {{ t.transactionType }}
              {{ t.radionuclideName }}
              {{ t.radioActivity }}
              {{ t.createdOn }}
              {{ t.facilityEn }}
              {{ t.licenseNumber }}
              {{ t.permitNumber }}
              {{ t.manufacturerSerialNo }}
              {{ t.sourceStatus }}

                <button
                  class="edit btn btn-success btn-sm mx-1"
                  style="width: 100%"
                >
                  <fa-icon [icon]="faListDots"> </fa-icon>
                </button>

                {{ "no_data" | translate }}

              <input
                class="search-input"
                name="transactionType"
                type="text"
                placeholder="{{
                  'landingPage.transactionTypePlaceholder' | translate
                }}"
                style="width: 100%"
              />

              <input
                class="search-input"
                name="radionuclide"
                type="text"
                placeholder="{{
                  'landingPage.radionuclidePlaceholder' | translate
                }}"
                style="width: 100%"
              />

              <input
                class="search-input"
                name="radioactivity"
                type="text"
                placeholder="{{
                  'landingPage.radioactivityPlaceholder' | translate
                }}"
                style="width: 100%"
              />

              <input
                class="search-input"
                name="transactionType"
                type="text"
                placeholder="{{
                  'landingPage.transactionDatePlaceholder' | translate
                }}"
                style="width: 100%"
              />

              <input
                class="search-input"
                name="transactionType"
                type="text"
                placeholder="{{
                  'landingPage.facilityPlaceholder' | translate
                }}"
                style="width: 100%"
              />

              <input
                class="search-input"
                name="transactionType"
                type="text"
                placeholder="{{ 'landingPage.licensePlaceholder' | translate }}"
                style="width: 100%"
              />

              <input
                class="search-input"
                name="transactionType"
                type="text"
                placeholder="{{ 'landingPage.permitPlaceholder' | translate }}"
                style="width: 100%"
              />

              <input
                class="search-input"
                name="transactionType"
                type="text"
                placeholder="{{
                  'landingPage.manufacturerSerialNoPlaceholder' | translate
                }}"
                style="width: 100%"
              />

              <input
                class="search-input"
                name="transactionType"
                type="text"
                placeholder="{{
                  'landingPage.transactionStatusPlaceholder' | translate
                }}"
                style="width: 100%"
              />


来源: stackexchange

问:
How to Get App Approved After Rejection From Play Console?
Hear Me Out Please!
I have checked out all the related questions and nothing is helping so far.

My Problem
My app was not on the Play Store, I was distributing it directly and updating the app by downloading the new version using the app itself and then installing it. To install the app I had to request REQUEST_INSTALL_PACKAGES permission.

Now
Now I wanted to publish it to play store. It's my first time publishing an app to Play Store. I uploaded the app and it got rejected reason was the above-mentioned permission. The EMail they send me is something like this:

```<code>    Issue details

    We found an issue in the following area(s):

    SPLIT_BUNDLE 20221007
Additionally, follow these steps to bring your app into compliance:

Please remove the use of REQUEST_INSTALL_PACKAGES permission from your app.
</code>```

Full Mail Image Link: https://imgur.com/a/mLmEDsS

After This
I have removed the permission and all its code from my app, created a new build and resubmitted, after a day it also got rejected quoting the same issue. I tried with 6 or 7 builds and they all got rejected.

I don't understand for some reason, the google review team is not reviewing the latest version I upload but the same first version 20221007. And then they send me the same email.

My Question
What Am I doing wrong? how do I submit the new version?
So that my app gets verified and published. Honestly Saying I Am Frustrated Right Now.

ContentLicense: CC BY-SA 4.0

Body:
Hear Me Out Please!
I have checked out all the related questions and nothing is helping so far.

My Problem
My app was not on the Play Store, I was distributing it directly and updating the app by downloading the new version using the app itself and then installing it. To install the app I had to request REQUEST_INSTALL_PACKAGES permission.

Now
Now I wanted to publish it to play store. It's my first time publishing an app to Play Store. I uploaded the app and it got rejected reason was the above-mentioned permission. The EMail they send me is something like this:

    Issue details

    We found an issue in the following area(s):

    SPLIT_BUNDLE 20221007
Additionally, follow these steps to bring your app into compliance:

Please remove the use of REQUEST_INSTALL_PACKAGES permission from your app.

Full Mail Image Link: https://imgur.com/a/mLmEDsS

After This
I have removed the permission and all its code from my app, created a new build and resubmitted, after a day it also got rejected quoting the same issue. I tried with 6 or 7 builds and they all got rejected.

I don't understand for some reason, the google review team is not reviewing the latest version I upload but the same first version 20221007. And then they send me the same email.

My Question
What Am I doing wrong? how do I submit the new version?
So that my app gets verified and published. Honestly Saying I Am Frustrated Right Now.


问:
Get Scope details of google sheet
Can I get all assigned permission of google sheet from api. which permissions allow to user</p>

Title: Get Scope details of google sheet


问:
React JS app not opening in browser due to caching whenever a new edit is pushed to the server
I am using React JS. Whenever a new edit is pushed to the server, accessing the application becomes problematic. The app appears blank in browser. I have tried some ways of deleting cache but the issue is still happening

I have tried the following ways.

I have edited the head tag in index.html in this way

```<code><meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='expires' content='0'>
<meta http-equiv='pragma' content='no-cache'>
</code>```

I have also added the following JS code on website load using useEffect hook.

```<code>const clearCacheData = () =>
{
   let version = localStorage.getItem('version');
   if(version != packageJson.version)
      {
        if('caches' in window){
          caches.keys().then((names) => {
            names.forEach((name) => {
              caches.delete(name);
          },
          console.log("cache is cleared"));
          });
          window.location.reload(true);
      };
      localStorage.clear();
      localStorage.setItem('version',packageJson.version);
      }
  }

React.useEffect(() => {
    clearCacheData();
},[])

</code>```

Body:
I am using React JS. Whenever a new edit is pushed to the server, accessing the application becomes problematic. The app appears blank in browser. I have tried some ways of deleting cache but the issue is still happening

I have tried the following ways.

I have edited the head tag in index.html in this way

<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='expires' content='0'>
<meta http-equiv='pragma' content='no-cache'>

I have also added the following JS code on website load using useEffect hook.

const clearCacheData = () =>
{
   let version = localStorage.getItem('version');
   if(version != packageJson.version)
      {
        if('caches' in window){
          caches.keys().then((names) => {
            names.forEach((name) => {
              caches.delete(name);
          },
          console.log("cache is cleared"));
          });
          window.location.reload(true);
      };
      localStorage.clear();
      localStorage.setItem('version',packageJson.version);
      }
  }

React.useEffect(() => {
    clearCacheData();
},[])


问:
Safari SVG mask-image lines on responsive img when changing windows size
I am using a a SVG image-mask on a responsive image. When I change window size, some strange white lines appear (only in Safari):
https://www.loom.com/share/a1f43b501fab49d596da77e0721a4e21

I use this CSS code on the img:

```<code>            .big-image img {
            -webkit-mask-image: url('data:image/svg+xml;utf8,<svg width="2226" height="1745" viewBox="0 0 2226 1745" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2225.86 1744.2L94.7251 1436.7C33.917 1427.93 -7.91689 1371.05 1.82585 1310.39L212.208 0.500535L2225.86 0.500486L2225.86 1744.2Z" fill="%23000000"/></svg>');
            mask-image: url('data:image/svg+xml;utf8,<svg width="2226" height="1745" viewBox="0 0 2226 1745" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2225.86 1744.2L94.7251 1436.7C33.917 1427.93 -7.91689 1371.05 1.82585 1310.39L212.208 0.500535L2225.86 0.500486L2225.86 1744.2Z" fill="%23000000"/></svg>');
            -webkit-mask-size: cover;
            mask-size: cover;
        }
</code>```

Body:
I am using a a SVG image-mask on a responsive image. When I change window size, some strange white lines appear (only in Safari):
https://www.loom.com/share/a1f43b501fab49d596da77e0721a4e21

I use this CSS code on the img:

            .big-image img {
            -webkit-mask-image: url('data:image/svg+xml;utf8,<svg width="2226" height="1745" viewBox="0 0 2226 1745" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2225.86 1744.2L94.7251 1436.7C33.917 1427.93 -7.91689 1371.05 1.82585 1310.39L212.208 0.500535L2225.86 0.500486L2225.86 1744.2Z" fill="%23000000"/></svg>');
            mask-image: url('data:image/svg+xml;utf8,<svg width="2226" height="1745" viewBox="0 0 2226 1745" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2225.86 1744.2L94.7251 1436.7C33.917 1427.93 -7.91689 1371.05 1.82585 1310.39L212.208 0.500535L2225.86 0.500486L2225.86 1744.2Z" fill="%23000000"/></svg>');
            -webkit-mask-size: cover;
            mask-size: cover;
        }


问:
Text to speech with word level timestamp not support use voice name
I want to get word level timestamp in google could text-to-speech from this page: https://cloud.google.com/text-to-speech/docs/reference/rest/v1beta1/text/synthesize#timepointtype

But when I create the voiceConfig object and set the attribute name to "

```<code>en-US-Neural2-C
</code>```

"
but I cannot get the timestamp, if I remove the attribute name, I can get the timestamp response.

Here is my code:
`

```<code>private static void testText2SpeechWithSSML(String name, String ssml) {
        try {
            TextToSpeechClient textToSpeechClient = TextToSpeechClient.create();
            SynthesisInput input = SynthesisInput.newBuilder().setSsml(ssml).build();
            VoiceSelectionParams voiceSelectionParams = VoiceSelectionParams.newBuilder().setLanguageCode("en-us").setSsmlGender(SsmlVoiceGender.SSML_VOICE_GENDER_UNSPECIFIED).setName("en-US-Neural2-C")
                    .build();
            AudioConfig audioConfig = AudioConfig.newBuilder().setAudioEncoding(AudioEncoding.MP3).build();
            SynthesizeSpeechRequest synthesizeSpeechRequest = SynthesizeSpeechRequest.newBuilder().setAudioConfig(audioConfig)
                    .setInput(input).setVoice(voiceSelectionParams).addEnableTimePointing(SynthesizeSpeechRequest.TimepointType.SSML_MARK).build();
            long start = System.currentTimeMillis();
            SynthesizeSpeechResponse response = textToSpeechClient.synthesizeSpeech(synthesizeSpeechRequest);
            ByteString audioContents = response.getAudioContent();
//            System.out.println("response："+response.toString());
            try (OutputStream outputStream = new FileOutputStream(name + ".mp3")) {
                outputStream.write(audioContents.toByteArray());
            }
            System.out.println("request cost：" + (System.currentTimeMillis() - start) + "ms");
            start = System.currentTimeMillis();
            System.out.println("get word level timestamp: " + response.getTimepointsCount());
            response.getTimepointsList().forEach(timepoint -> {
                System.out.println("word：" + timepoint.getMarkName() + " offset：" + timepoint.getTimeSeconds());
            });
            System.out.println("word level cost:" + (System.currentTimeMillis() - start) + "ms");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
</code>```

`
If I remvoe the attribute name in voiceConfig, I can get the timestamp:
word：In offset：0.009999999776482582

Body:
I want to get word level timestamp in google could text-to-speech from this page: https://cloud.google.com/text-to-speech/docs/reference/rest/v1beta1/text/synthesize#timepointtype

But when I create the voiceConfig object and set the attribute name to "

en-US-Neural2-C

"
but I cannot get the timestamp, if I remove the attribute name, I can get the timestamp response.

Here is my code:
`

private static void testText2SpeechWithSSML(String name, String ssml) {
        try {
            TextToSpeechClient textToSpeechClient = TextToSpeechClient.create();
            SynthesisInput input = SynthesisInput.newBuilder().setSsml(ssml).build();
            VoiceSelectionParams voiceSelectionParams = VoiceSelectionParams.newBuilder().setLanguageCode("en-us").setSsmlGender(SsmlVoiceGender.SSML_VOICE_GENDER_UNSPECIFIED).setName("en-US-Neural2-C")
                    .build();
            AudioConfig audioConfig = AudioConfig.newBuilder().setAudioEncoding(AudioEncoding.MP3).build();
            SynthesizeSpeechRequest synthesizeSpeechRequest = SynthesizeSpeechRequest.newBuilder().setAudioConfig(audioConfig)
                    .setInput(input).setVoice(voiceSelectionParams).addEnableTimePointing(SynthesizeSpeechRequest.TimepointType.SSML_MARK).build();
            long start = System.currentTimeMillis();
            SynthesizeSpeechResponse response = textToSpeechClient.synthesizeSpeech(synthesizeSpeechRequest);
            ByteString audioContents = response.getAudioContent();
//            System.out.println("response："+response.toString());
            try (OutputStream outputStream = new FileOutputStream(name + ".mp3")) {
                outputStream.write(audioContents.toByteArray());
            }
            System.out.println("request cost：" + (System.currentTimeMillis() - start) + "ms");
            start = System.currentTimeMillis();
            System.out.println("get word level timestamp: " + response.getTimepointsCount());
            response.getTimepointsList().forEach(timepoint -> {
                System.out.println("word：" + timepoint.getMarkName() + " offset：" + timepoint.getTimeSeconds());
            });
            System.out.println("word level cost:" + (System.currentTimeMillis() - start) + "ms");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

`
If I remvoe the attribute name in voiceConfig, I can get the timestamp:
word：In offset：0.009999999776482582


问:
What productId should I use purchases.subscriptions.acknowledge method?
I wanted to acknowledge a subscription purchase made by user.

According to Google docs I have to send a subscriptionID, but according to purchases.subscriptionsv2.get it may return more than one line item, each line item contains its own subscriptionId (productId)

The question is, which subscriptionId should I use in "acknowledge" if a purchase has more than one line items with different subscriptionId?

From the Doc it's not clear what to do.


问:
Why is this C++ base class protected inner type not visible from a derived template?
I am trying to make use of the Curiously Recurring Template Pattern, in which a base class template Base is defined and a client derived type Derived is expected to inherit from Base<Derived>. I am finding that I am able to reference inner types of Base without qualification from within Derived when Derived is not a template, but am unable to do so when Derived is a template.

Below is a minimal example that fails to compile and demonstrates the problem.

namespace dtl
{

template <class Derived>
class Base
{
protected:
    template <typename... Ts> struct A1 {};
    struct A2 {};
};

}  // namespace dtl

class Derived1 : public dtl::Base<Derived1>
{
    struct B : A1<A2> {};  // works
};

template <int x>
class Derived2 : public dtl::Base<Derived2<x>>
{
    struct B : A1<A2> {};  // fails
};

int main()
{
    Derived1();
    Derived2<0>();
}
```
<p>Compiler-reported errors are not illuminating:</p>
```test2.cpp:22:18: error: expected template-name before ‘<’ token
   22 |     struct B : A1<A2> {};  // fails
      |                  ^
test2.cpp:22:18: error: expected ‘{’ before ‘<’ token
test2.cpp:22:18: error: expected unqualified-id before ‘<’ token
```

Why does this problem occur, and what are the workarounds?

Body:
I am trying to make use of the Curiously Recurring Template Pattern, in which a base class template Base is defined and a client derived type Derived is expected to inherit from Base<Derived>. I am finding that I am able to reference inner types of Base without qualification from within Derived when Derived is not a template, but am unable to do so when Derived is a template.

Below is a minimal example that fails to compile and demonstrates the problem.

namespace dtl
{

template <class Derived>
class Base
{
protected:
    template <typename... Ts> struct A1 {};
    struct A2 {};
};

}  // namespace dtl

class Derived1 : public dtl::Base<Derived1>
{
    struct B : A1<A2> {};  // works
};

template <int x>
class Derived2 : public dtl::Base<Derived2<x>>
{
    struct B : A1<A2> {};  // fails
};

int main()
{
    Derived1();
    Derived2<0>();
}

Compiler-reported errors are not illuminating:

test2.cpp:22:18: error: expected template-name before ‘<’ token
   22 |     struct B : A1<A2> {};  // fails
      |                  ^
test2.cpp:22:18: error: expected ‘{’ before ‘<’ token
test2.cpp:22:18: error: expected unqualified-id before ‘<’ token

Why does this problem occur, and what are the workarounds?


问:
How to create groups in Keycloak from .net core application
Anyone knows how to integrate and create groups in Keycloak from the .net core application..
Please reply....

Thanks,

I tried to create groups from my asp.net core application but didnt workout..


问:
How to reproduce c++ negative indexing behavior with 2D array in JavaScript?
I'm trying to convert a c++ repo I found to js. But I ran across a roadblock.

the author of the original c++ code is indexing into a 2d array with a negative -1 when i and j are equal to 0 arr2d[i-1][j], arr2d[i][j-1]. I thought this was a bug but the code runs and gives the correct results as intended. My knowledge of c++ is pretty limited and I know you can't access values in an array with negative indices in js.

I created a small test with c++ to try and understand what's going

```<code>#include <iostream>

using namespace std;

int main()
{
    double map[3][3] = {{.123412,.452105,1},{.52342,-.56326,.904},{.1262,.14268,-.7411}};

    cout<<map[-1][1];

    return 0;
}

</code>```

map[-1][1]   returns  1       (the first array last value)
map[-1][0]   returns  .452105 (the first array middle value)
map[-1][-1]  returns  .123412 (the first array first value)

Can someone help me understand what's happing and is there any way I can reproduce this behavior to get the same result in JavaScript?

Body:
I'm trying to convert a c++ repo I found to js. But I ran across a roadblock.

the author of the original c++ code is indexing into a 2d array with a negative -1 when i and j are equal to 0 arr2d[i-1][j], arr2d[i][j-1]. I thought this was a bug but the code runs and gives the correct results as intended. My knowledge of c++ is pretty limited and I know you can't access values in an array with negative indices in js.

I created a small test with c++ to try and understand what's going

#include <iostream>

using namespace std;

int main()
{
    double map[3][3] = {{.123412,.452105,1},{.52342,-.56326,.904},{.1262,.14268,-.7411}};

    cout<<map[-1][1];

    return 0;
}

map[-1][1]   returns  1       (the first array last value)
map[-1][0]   returns  .452105 (the first array middle value)
map[-1][-1]  returns  .123412 (the first array first value)

Can someone help me understand what's happing and is there any way I can reproduce this behavior to get the same result in JavaScript?


问:
Xcode 'GoogleUtilities/GULNSDATA+zlib.h' file not found, after adding FirebaseRemoteConfig to Podfile
None of the (vaguely) similar questions have answers which help here. I added pod 'GoogleUtilities' to the Podfile and that did not help. What is wrong here?


问:
customize the datafield in laravel pagination
i need to custamize the data part in pagination response.

my result is like this.

```<code>{
                "fileid": 1426,
                "path": "https://f000.backblazeb2.com/file/memorrowd/167023500538020.jpg",
                "file_name": "167023500538020.jpg",
                "duration": "",
                "thumb": null,
                "title": null,
                "file_size": 88513,
                "category": null,
                "description": null,
                "user_id": 478,
                "file_type": "Image",
                "upload_date": "2022-12-06 05:10:07",
                "created_at": "2022-12-06T05:10:07.000000Z",
                "updated_at": "2022-12-06T05:10:07.000000Z"
            }
        ],
        "first_page_url": "https://localhost/memorrowd.com7-12/api/filedisplay?page=1",
        "from": 1,
        "last_page": 6,
        "last_page_url": "https://localhost/memorrowd.com7-12/api/filedisplay?page=6",
        "next_page_url": "https://localhost/memorrowd.com7-12/api/filedisplay?page=2",
        "path": "https://localhost/memorrowd.com7-12/api/filedisplay",
        "per_page": "5",
        "prev_page_url": null,
        "to": 5,
        "total": 27
</code>```

but i need the data part like this..

```<code>"user_details": [
        {
            "fileid": 1422,
            "path": "https://f000.backblazeb2.com/file/memorrowd/167021664414694.jpg",
            "title": "",
            "category": "",
            "description": "",
            "thumb": "",
            "duration": "",
            "date": "06 December 2022",
            "time": "12:04 AM",
            "upload_date": "2022-12-06 00:04:07"
        },

</code>```

how can i do...

Body:
i need to custamize the data part in pagination response.

my result is like this.

{
                "fileid": 1426,
                "path": "https://f000.backblazeb2.com/file/memorrowd/167023500538020.jpg",
                "file_name": "167023500538020.jpg",
                "duration": "",
                "thumb": null,
                "title": null,
                "file_size": 88513,
                "category": null,
                "description": null,
                "user_id": 478,
                "file_type": "Image",
                "upload_date": "2022-12-06 05:10:07",
                "created_at": "2022-12-06T05:10:07.000000Z",
                "updated_at": "2022-12-06T05:10:07.000000Z"
            }
        ],
        "first_page_url": "https://localhost/memorrowd.com7-12/api/filedisplay?page=1",
        "from": 1,
        "last_page": 6,
        "last_page_url": "https://localhost/memorrowd.com7-12/api/filedisplay?page=6",
        "next_page_url": "https://localhost/memorrowd.com7-12/api/filedisplay?page=2",
        "path": "https://localhost/memorrowd.com7-12/api/filedisplay",
        "per_page": "5",
        "prev_page_url": null,
        "to": 5,
        "total": 27

but i need the data part like this..

"user_details": [
        {
            "fileid": 1422,
            "path": "https://f000.backblazeb2.com/file/memorrowd/167021664414694.jpg",
            "title": "",
            "category": "",
            "description": "",
            "thumb": "",
            "duration": "",
            "date": "06 December 2022",
            "time": "12:04 AM",
            "upload_date": "2022-12-06 00:04:07"
        },

how can i do...


问:
amplify configure Error fetching release: aborted
I am new to AWS. In the official documentation for using AWS Amplify in Flutter, it states to first install the amplify cli and then run amplify configure. When I run amplify configure, it takes a long time in showing Downloading release from https://package.cli.amplify.aws/10.5.1/amplify-pkg-win-x64.tgz and after that, it gives me Error fetching release: aborted error.
What is the solution for this? Thanks in advance.

Note: I have node.js v18.12.1, npm 9.1.3 and git version 2.34.1.windows.1 installed.


问:
Using ellipsis and line-clamp but the last line shouldn't have full width
This is how I want it to look (The last line shouldn't have full width):

Code:

p {
  white-space: pre-wrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum congue, ex eget dapibus egestas, dui orci ornare sapien, et vehicula purus lacus at sem. Aliquam eu placerat ligula, at hendrerit odio. Donec sed semper tortor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Cras tristique lacinia arcu, et commodo risus facilisis nec. Curabitur eget porttitor ex. Quisque in semper nibh. Aliquam ultricies leo libero, nec accumsan metus consectetur consectetur. Nullam scelerisque efficitur orci ut condimentum. Phasellus pellentesque et nisi at suscipit. Mauris sagittis turpis non erat interdum, eu eleifend orci consectetur.
</p></code>```

Body:
This is how I want it to look (The last line shouldn't have full width):

Code:

p {
  white-space: pre-wrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum congue, ex eget dapibus egestas, dui orci ornare sapien, et vehicula purus lacus at sem. Aliquam eu placerat ligula, at hendrerit odio. Donec sed semper tortor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Cras tristique lacinia arcu, et commodo risus facilisis nec. Curabitur eget porttitor ex. Quisque in semper nibh. Aliquam ultricies leo libero, nec accumsan metus consectetur consectetur. Nullam scelerisque efficitur orci ut condimentum. Phasellus pellentesque et nisi at suscipit. Mauris sagittis turpis non erat interdum, eu eleifend orci consectetur.


问:
webpack-dev "Cannot GET"
I'm using webpack 5, when I start webpack-dev-server (i.e. using npm start) and hot reloading, I am getting Cannot Get / error.

what am I missing ?

It could be a routing problem too. There are no errors in webpacks output on the console.

I have the following webpack config:

webpack.common.js

```<code>const path = require("path");
const Dotenv = require("dotenv-webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const webpack = require("webpack");

module.exports = {
  entry: {
    bundle: path.resolve(__dirname, "/src/index.js"),
  },
  output: {
    filename: "index.js",
    path: path.resolve(__dirname, "dist"),
  },
  performance: {
    hints: false,
    maxEntrypointSize: 512000,
    maxAssetSize: 512000,
  },
  module: {
    rules: [
      {
        test: /\.?js$/,
        exclude: /node_modules/,
        use: {
          loader: "babel-loader",
          options: {
            presets: ["@babel/preset-env", "@babel/preset-react"],
          },
        },
      },
      {
        test: /\.woff2?$/i,
        type: "asset/resource",
        dependency: { not: ["url"] },
      },
      {
        test: /\.css$/i,
        use: ["style-loader", "css-loader"],
      },
    ],
  },
  plugins: [
    new HtmlWebpackPlugin({
      favicon: "./public/favicon.ico",
      template: path.join(__dirname, "public", "index.html"),
      manifest: "./public/manifest.json",
    }),
    new Dotenv(),
    new webpack.HotModuleReplacementPlugin(),
  ],
};
</code>```

webpack.dev.js

```<code>const { merge } = require("webpack-merge");
const path = require("path");
const common = require("./webpack.common.js");

module.exports = merge(common, {
  mode: "development",
  devtool: "inline-source-map",
  devServer: {
    static: path.resolve(__dirname, "dist"),
  },
});
</code>```

webpack.prod.js

```<code>const { merge } = require("webpack-merge");
const common = require("./webpack.common.js");

module.exports = merge(common, {
  mode: "production",
  devtool: "source-map",
});
</code>```

scripts:

```<code>"start": "webpack serve --open --config webpack.dev.js",
"build": "webpack --config webpack.prod.js"
</code>```

Title: webpack-dev "Cannot GET"

Body:
I'm using webpack 5, when I start webpack-dev-server (i.e. using npm start) and hot reloading, I am getting Cannot Get / error.

what am I missing ?

It could be a routing problem too. There are no errors in webpacks output on the console.

I have the following webpack config:

webpack.common.js

const path = require("path");
const Dotenv = require("dotenv-webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const webpack = require("webpack");

module.exports = {
  entry: {
    bundle: path.resolve(__dirname, "/src/index.js"),
  },
  output: {
    filename: "index.js",
    path: path.resolve(__dirname, "dist"),
  },
  performance: {
    hints: false,
    maxEntrypointSize: 512000,
    maxAssetSize: 512000,
  },
  module: {
    rules: [
      {
        test: /\.?js$/,
        exclude: /node_modules/,
        use: {
          loader: "babel-loader",
          options: {
            presets: ["@babel/preset-env", "@babel/preset-react"],
          },
        },
      },
      {
        test: /\.woff2?$/i,
        type: "asset/resource",
        dependency: { not: ["url"] },
      },
      {
        test: /\.css$/i,
        use: ["style-loader", "css-loader"],
      },
    ],
  },
  plugins: [
    new HtmlWebpackPlugin({
      favicon: "./public/favicon.ico",
      template: path.join(__dirname, "public", "index.html"),
      manifest: "./public/manifest.json",
    }),
    new Dotenv(),
    new webpack.HotModuleReplacementPlugin(),
  ],
};

webpack.dev.js

const { merge } = require("webpack-merge");
const path = require("path");
const common = require("./webpack.common.js");

module.exports = merge(common, {
  mode: "development",
  devtool: "inline-source-map",
  devServer: {
    static: path.resolve(__dirname, "dist"),
  },
});

webpack.prod.js

const { merge } = require("webpack-merge");
const common = require("./webpack.common.js");

module.exports = merge(common, {
  mode: "production",
  devtool: "source-map",
});

scripts:

"start": "webpack serve --open --config webpack.dev.js",
"build": "webpack --config webpack.prod.js"


问:
Use data included in event parameters of conversion tracking
Is it possible to fetch the event parameter values that is passed when a pixel is fired?

Suppose I am adding a custom parameter orderID. I am able to get the stats of a pixel like how many times an event is triggered in a day. But, Is it possible to get those parameter values using API?

Reference


问:
ValueError: Value must be Period, string, integer, or datetime
I have an issue using datetime...

I have a dataframe with a column time

```<code>print(dt['time'].dtypes)
</code>```

It replies:

```<code>datetime64[ns]
</code>```

Now I want to have the number of days of the month of the date:

```<code>dt['NB_DAYS'] = p.Period(dt['time']).days_in_month
</code>```

But I have an issue for which I really can't find answers on the web:

```<code>ValueError: Value must be Period, string, integer, or datetime
</code>```

Can you help me with that? Thanks

Body:
I have an issue using datetime...

I have a dataframe with a column time

print(dt['time'].dtypes)

It replies:

datetime64[ns]

Now I want to have the number of days of the month of the date:

dt['NB_DAYS'] = p.Period(dt['time']).days_in_month

But I have an issue for which I really can't find answers on the web:

ValueError: Value must be Period, string, integer, or datetime

Can you help me with that? Thanks


问:
Error migrating existing users to newer version of Google Fit
We have moved to a newer version of Google Fit but are having trouble trying to link and sync users we have migrated from the previous version to the new. New users on the new version of the app are not impacted. We are using the same app ID and the same project as before on the previous version.

We expected that the migrated users would be successfully linked and synced on the new version of the app. However,we consistently see this error message on sync failure:

com.google.android.gms.common.api.ApiException: 10: SecurityException: com.google.activity.segment requires android.permission.ACTIVITY_RECOGNITION


问:
Is there a way to prevent access to a private subview via the UIView subviews property?
An Example: I have a custom view component with a custom textfield as a subview. I would like to prevent access to the text property of the textfield outside of it's parent view so that the following cannot be done.

```<code>class MyViewController : UIViewController {

  var customView: MyView!

  override func loadView() {
    customView = MyView()
    customView.backgroundColor = .lightGray
    self.view = customView
  }

  override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)

    customView.subviews.map {
      ($0 as? UITextField).map {
        $0.text.map {
          print($0)
        }
      }
    }

  }

}
</code>```

Other classes:

```<code>class MyView: UIView {

  private lazy var textField: CustomTextField = {
    let textField = CustomTextField(frame: CGRect(x: 95, y: 150, width: 200, height: 44))
    textField.backgroundColor = .white
    textField.borderStyle = .roundedRect
    textField.text = "hello world!"
    return textField
  }()

  override init(frame: CGRect) {
    super.init(frame: frame)
    self.addSubview(textField)
  }

  required init?(coder: NSCoder) {
    fatalError("error")
  }

}

class CustomTextField: UITextField {

  override init(frame: CGRect) {
    super.init(frame: frame)
  }

  required init?(coder: NSCoder) {
    fatalError("error")
  }

}
</code>```

Is there a right way to proceed about this?

Body:
An Example: I have a custom view component with a custom textfield as a subview. I would like to prevent access to the text property of the textfield outside of it's parent view so that the following cannot be done.

class MyViewController : UIViewController {

  var customView: MyView!

  override func loadView() {
    customView = MyView()
    customView.backgroundColor = .lightGray
    self.view = customView
  }

  override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)

    customView.subviews.map {
      ($0 as? UITextField).map {
        $0.text.map {
          print($0)
        }
      }
    }

  }

}

Other classes:

class MyView: UIView {

  private lazy var textField: CustomTextField = {
    let textField = CustomTextField(frame: CGRect(x: 95, y: 150, width: 200, height: 44))
    textField.backgroundColor = .white
    textField.borderStyle = .roundedRect
    textField.text = "hello world!"
    return textField
  }()

  override init(frame: CGRect) {
    super.init(frame: frame)
    self.addSubview(textField)
  }

  required init?(coder: NSCoder) {
    fatalError("error")
  }

}

class CustomTextField: UITextField {

  override init(frame: CGRect) {
    super.init(frame: frame)
  }

  required init?(coder: NSCoder) {
    fatalError("error")
  }

}

Is there a right way to proceed about this?


问:
Why can't find specified app version at the firebase console page？
I wanna create a new In-App message at console page, but I can't find my app version, what may cause this？

Please someone help ~
It's an Android App.


问:
How to loop around all id in "ids" array asynchronously and return data for all ids?
I am new to typescript and I am working on a project where I need to populate all the fields in GridModel interface by querying data. I have the below code after several attempt which works fine.
In the below code, I pick single id from ids array and then make the necessary call to get all those fields and populate GridModel interface. Below code only works for single id which I pick as first index from ids array.

```<code>import { useEffect, useMemo, useState } from 'react'
import {
  useGetClientOrdersByItemQuery,
  useGetClientOrdersQuery,
  useGetClientOrderLineByLineIdLazyQuery,
} from '../../../../hooks/static/use-get-client-orders-by-item'

interface GridModel {
  purchaseOrderId: string | undefined,
  lineNumber: string | undefined,
  warehouse: string | undefined,
  startShipDate: string | undefined,
}

export const useViewPurchaseOrderData = (ids: string[]) => {
  const [gridData, setGridData] = useState<GridModel[]>([])
  const [fetchLines, { loading: linesLoading }] = useGetClientOrderLineByLineIdLazyQuery()
  const { data, loading } = useGetClientOrdersByItemQuery({
    variables: { itemId: Number(ids[0]) },
    skip: !ids[0],
  })

  const poIds = (data?.getPurchaseOrdersByItem?.map((p) => p?.purchaseOrderId)
    .filter((poid): poid is number => Boolean(poid)) ?? [])
  const poidToLines = useMemo(() => data?.getPurchaseOrdersByItem
    ?.map((p) => ({ orderId: p?.purchaseOrderId, lines: p?.lineIds })), [data])

  const { data: purchaseData, loading: purchaseLoading } = useGetClientOrdersQuery({
    variables: { poIds, count: poIds.length, offset: 0 },
    skip: !poIds.length,
  })
  const purchaseOrders = purchaseData?.getPurchaseOrders?.purchaseOrders

  useEffect(() => {
    const lineRequests = poidToLines?.flatMap((p) => p?.lines?.map((lineId) => fetchLines({
      variables: {
        purchaseOrderId: p?.orderId ?? 0,
        purchaseOrderLineId: lineId ?? 0,
      },
    }).then((result) => ({
      result: result.data?.getPurchaseOrderLineByLineId,
      poId: p?.orderId,
    })))).filter(Boolean) as Promise<any>[]

    if (purchaseOrders && purchaseOrders.length && lineRequests && lineRequests.length) {
      Promise.all(lineRequests).then((lines) => {
        const mapped: GridModel[] = lines.map((line) => {
          const order = purchaseOrders.find((po) => po?.id === line.poId.toString())
          return {
            purchaseOrderId: order?.id ?? undefined,
            lineNumber: line?.result.lineId ?? undefined,
            warehouse: order?.site?.name ?? undefined,
            startShipDate: order?.expectedShipDate ?? undefined,
          }
        }) ?? []
        setGridData(mapped)
      })
    }
  }, [poidToLines, purchaseOrders])

  return {
    data: gridData,
    loading: loading || purchaseLoading || linesLoading,
  }
}
</code>```

Problem Statement

Is there any way where I can loop around all ids in ids array either asynchronously or sequentially inside useViewPurchaseOrderData function? And for each single id, I will do exact same thing which I am already doing in above code? So idea is -

Iterate all id from ids array either asynchronously or sequentially. For each id do exact above thing and then once we have data for all id return everything back.

Is this possible to do by any chance in typescript. I am from Java, C# background so having hard time figuring out on how to do this in Typescript.

Body:
I am new to typescript and I am working on a project where I need to populate all the fields in GridModel interface by querying data. I have the below code after several attempt which works fine.
In the below code, I pick single id from ids array and then make the necessary call to get all those fields and populate GridModel interface. Below code only works for single id which I pick as first index from ids array.

import { useEffect, useMemo, useState } from 'react'
import {
  useGetClientOrdersByItemQuery,
  useGetClientOrdersQuery,
  useGetClientOrderLineByLineIdLazyQuery,
} from '../../../../hooks/static/use-get-client-orders-by-item'

interface GridModel {
  purchaseOrderId: string | undefined,
  lineNumber: string | undefined,
  warehouse: string | undefined,
  startShipDate: string | undefined,
}

export const useViewPurchaseOrderData = (ids: string[]) => {
  const [gridData, setGridData] = useState<GridModel[]>([])
  const [fetchLines, { loading: linesLoading }] = useGetClientOrderLineByLineIdLazyQuery()
  const { data, loading } = useGetClientOrdersByItemQuery({
    variables: { itemId: Number(ids[0]) },
    skip: !ids[0],
  })

  const poIds = (data?.getPurchaseOrdersByItem?.map((p) => p?.purchaseOrderId)
    .filter((poid): poid is number => Boolean(poid)) ?? [])
  const poidToLines = useMemo(() => data?.getPurchaseOrdersByItem
    ?.map((p) => ({ orderId: p?.purchaseOrderId, lines: p?.lineIds })), [data])

  const { data: purchaseData, loading: purchaseLoading } = useGetClientOrdersQuery({
    variables: { poIds, count: poIds.length, offset: 0 },
    skip: !poIds.length,
  })
  const purchaseOrders = purchaseData?.getPurchaseOrders?.purchaseOrders

  useEffect(() => {
    const lineRequests = poidToLines?.flatMap((p) => p?.lines?.map((lineId) => fetchLines({
      variables: {
        purchaseOrderId: p?.orderId ?? 0,
        purchaseOrderLineId: lineId ?? 0,
      },
    }).then((result) => ({
      result: result.data?.getPurchaseOrderLineByLineId,
      poId: p?.orderId,
    })))).filter(Boolean) as Promise<any>[]

    if (purchaseOrders && purchaseOrders.length && lineRequests && lineRequests.length) {
      Promise.all(lineRequests).then((lines) => {
        const mapped: GridModel[] = lines.map((line) => {
          const order = purchaseOrders.find((po) => po?.id === line.poId.toString())
          return {
            purchaseOrderId: order?.id ?? undefined,
            lineNumber: line?.result.lineId ?? undefined,
            warehouse: order?.site?.name ?? undefined,
            startShipDate: order?.expectedShipDate ?? undefined,
          }
        }) ?? []
        setGridData(mapped)
      })
    }
  }, [poidToLines, purchaseOrders])

  return {
    data: gridData,
    loading: loading || purchaseLoading || linesLoading,
  }
}

Problem Statement

Is there any way where I can loop around all ids in ids array either asynchronously or sequentially inside useViewPurchaseOrderData function? And for each single id, I will do exact same thing which I am already doing in above code? So idea is -

Iterate all id from ids array either asynchronously or sequentially. For each id do exact above thing and then once we have data for all id return everything back.

Is this possible to do by any chance in typescript. I am from Java, C# background so having hard time figuring out on how to do this in Typescript.


问:
Intersection Observer is calling api twice even when there is only one or two elements
As we all know, intersection observer is used in javascript for various purposes, including infinite scrolling, lazy loading etc. So, I've used Intersection Observer in react for achieving
infinite scrolling logic, everything seems good, I am sending 10 records per page from my backend, but when there is only 1 element, intersection observer observes it and found it in view port, it called api again, (twice in that case). How to handle this case? Also, sometimes when i reached at last element of my view port, it then call api twice.

I tried to make logic, if we have records > 10 then it that case only i should update state for next page, (For next api call). But that doesn't seems to work correctly


问:
Passing jsx element in an array element
I am trying to create check all functionality in ant form. So I have passed Jsx elements in array to use it in checkbox group. But in browser it is giving me object object. Also I have tried to do this without checkbox group, but unable to do so. How can I get checkbox element from object and select all.

Below is my jsx code:

import React, { useEffect, useState } from "react";
import {
  Form, Radio, Divider, Input, Checkbox, Select, Button, Row, Col
} from "antd";
const CheckboxGroup = Checkbox.Group;

const ChkComponent = () => {
  const [extra, setExtra] = useState('');
  const [checkedList, setCheckedList] = useState([]);
  const [indeterminate, setIndeterminate] = useState(false);
  const [checkAll, setCheckAll] = useState(false);
  const [form] = Form.useForm();
  const plainOptions = [
    `${<Form.Item className="form-content">
      <Checkbox>chk A</Checkbox>
      </Form.Item>
      }`,
    `${<Form.Item
      name="chkb"
      label={<Checkbox>chk B</Checkbox>}
      className="form-content"
      rules={[
        {
          required: true,
          message: 'Please select an option',
        },
      ]}
      >
      <Select defaultValue="" className="form-input">
        <Select.Option value=""></Select.Option>
        <Select.Option value="a">A</Select.Option>
        <Select.Option value="b">B</Select.Option>
      </Select>
      </Form.Item>}`,
    `${<Form.Item className="form-content">
        <Checkbox>Intermediate Data</Checkbox>
      </Form.Item>}`
];

  const onChange = (list) => {
    console.log(plainOptions.length)
    setCheckedList(list);
    setIndeterminate(!!list.length && list.length < plainOptions.length);
    setCheckAll(list.length === plainOptions.length);
  };

  const onCheckAllChange = (e) => {
    setCheckedList(e.target.checked ? plainOptions : []);
    setIndeterminate(false);
    setCheckAll(e.target.checked);
  };

  const onFinish = (values) => {
    console.log('Received values of form: ', values);
    form.validateFields(['folderpath','sdtmoption','adammetadataoption','sdtmmetadataoption']);
    setExtra('Folder Path: ~/datasdtmplus/*.sas7bdat')
    console.log(extra)
  };

  return (
    <>

          <Form
            wrapperCol={{ span: 12 }}
            layout="horizontal"
            size={12}
            onFinish={onFinish}
          >

            <Row>
              <Col span={12}>
                <Form.Item className='form-content'>
                  <Checkbox indeterminate={indeterminate} onChange={onCheckAllChange} checked={checkAll}>
                    Check all
                  </Checkbox>
                </Form.Item>
              </Col>
            </Row>
            <Divider className="form-devider"/>
            <Row>

              <Col span={12}>
                <CheckboxGroup options={plainOptions} value={checkedList} onChange={onChange} />
              </Col>
            </Row>
            <Divider className="form-devider" />
            <Form.Item>
              <Button type="primary" htmlType="submit">Submit</Button>
            </Form.Item>
          </Form>

    </>
  );
};

export default ChkComponent;```

Title: Passing jsx element in an array element


问:
Launch the app to current tab with AppleScript
Basically, what I am currently able to do is opening a new tab with shortcuts using AppleScript. And current code launches Terminal in the main display.

```<code>on run {input, parameters}
    tell application "Terminal"
        if it is running then
            do script ""
        end if
        activate
    end tell
end run
</code>```

What I would like to do is launch the terminal in the current active screen. Let's say I am programming and using VS code. I would like to use terminal(mac's) rather than VS's side by side. Whenever I click the shortcut it launches it another page and I have to switch it and put the terminal back as side by side. I need to launch it in current VS code tab.

Body:
Basically, what I am currently able to do is opening a new tab with shortcuts using AppleScript. And current code launches Terminal in the main display.

on run {input, parameters}
    tell application "Terminal"
        if it is running then
            do script ""
        end if
        activate
    end tell
end run

What I would like to do is launch the terminal in the current active screen. Let's say I am programming and using VS code. I would like to use terminal(mac's) rather than VS's side by side. Whenever I click the shortcut it launches it another page and I have to switch it and put the terminal back as side by side. I need to launch it in current VS code tab.


问:
adb logcat disconnects after 2 hours of inactivity Android
On Android 12 Pixel 4a . I have an error that takes a few hours to reproduce. The issues arose after more than 5 GB files are downloaded. This takes a few hours and hence, I need to save adb logs until the issue is reproduces which may take a few hours.

```<code>adb -s 17281JEC213806 logcat > pixel_hub7.log
</code>```

I use the above command to write adb logs into a file, this works well but after an hour of inactivity on my Windows System and device the adb automatically disconnects. Hence, I cannot get logs when the issue ours.

Although when I check the device after a few hours, it's still connected via adb but the adb logcat command is terminated after a few hours. My device is never disconnected from adb, only the abd logcat command gets terminated after an hour or so.

**Problem **: Is there a way I can ensure the adb logcat does not terminate after a few hours ?

I have tried the following in Device (Pixel 4a Android 12) developers Options:

Stay awake when charging

disable adb authorization timeout (enabled)

Body:
On Android 12 Pixel 4a . I have an error that takes a few hours to reproduce. The issues arose after more than 5 GB files are downloaded. This takes a few hours and hence, I need to save adb logs until the issue is reproduces which may take a few hours.

adb -s 17281JEC213806 logcat > pixel_hub7.log

I use the above command to write adb logs into a file, this works well but after an hour of inactivity on my Windows System and device the adb automatically disconnects. Hence, I cannot get logs when the issue ours.

Although when I check the device after a few hours, it's still connected via adb but the adb logcat command is terminated after a few hours. My device is never disconnected from adb, only the abd logcat command gets terminated after an hour or so.

**Problem **: Is there a way I can ensure the adb logcat does not terminate after a few hours ?

I have tried the following in Device (Pixel 4a Android 12) developers Options:

Stay awake when charging

disable adb authorization timeout (enabled)


问:
Convert gstreamer command to C code . . request pad
I'm developing on Jetson Nano, and my goal is to output two overlapping videos.
Here is the command I wrote first.

```<code>gst-launch-1.0 v4l2src device=/dev/video0 io-mode=2 ! image/jpeg, width=1920, height=1080 ! nvjpegdec  ! video/x-raw ! queue ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA' ! queue ! comp.sink_0 \
v4l2src device=/dev/video1 io-mode=2 ! image/jpeg, width=1920, height=1080 ! nvjpegdec  ! video/x-raw ! queue ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA' ! queue ! comp.sink_1 \
alsasrc device="hw:1" ! audioconvert ! audioresample ! audiorate ! "audio/x-raw, rate=48000, channels=2" ! queue ! faac bitrate=128000 rate-control=2 ! queue ! muxer. \
nvcompositor name=comp  sink_0::xpos=0 sink_0::ypos=0 sink_0::width=768 sink_0::height=432 sink_0::zorder=2 sink_0::alpha=1.0 sink_1::xpos=0 sink_1::ypos=0 sink_1::width=1920 sink_1::height=1080 sink_1::zorder=1 sink_1::alpha=1.0 ! \
'video/x-raw(memory:NVMM),format=RGBA' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=(string)I420' ! nvv4l2h265enc ! h265parse ! queue ! mpegtsmux name=muxer ! filesink location=test.mp4 \
</code>```

This is my Command. and This is My C Code

```<code>gst_bin_add_many (GST_BIN (gstContext->pipeline),
        gstContext->videosrc, gstContext->video_filter1, gstContext->jpegdec, gstContext->x_raw, gstContext->queue_video1, gstContext->video_convert2, gstContext->video_filter4, gstContext->queue_video2 ,
         gstContext->videosrc2, gstContext->video_filter2_1, gstContext->jpegdec2, gstContext->x_raw2, gstContext->queue_video2_1, gstContext->video_convert3, gstContext->video_filter2_3, gstContext->queue_video2_2 ,
         gstContext->video_mixer , gstContext->video_filter3, gstContext->video_convert,  gstContext->video_filter2,  gstContext->video_encoder, gstContext->video_pasre, gstContext->queue_video3, gstContext->muxer,gstContext->sink2, NULL);

if(
         !gst_element_link_many(gstContext->video_mixer, gstContext->video_filter3, gstContext->video_convert,  gstContext->video_filter2,  gstContext->video_encoder, gstContext->video_pasre, gstContext-> queue_video3, gstContext->muxer, NULL)
        || !gst_element_link_many(gstContext->videosrc, gstContext->video_filter1, gstContext->jpegdec, gstContext->x_raw, gstContext->queue_video1, gstContext->video_convert2, gstContext->video_filter4, gstContext->queue_video2 ,NULL)

        || !gst_element_link_many(gstContext->videosrc2, gstContext->video_filter2_1, gstContext->jpegdec2, gstContext->x_raw2, gstContext->queue_video2_1, gstContext->video_convert3, gstContext->video_filter2_3, gstContext->queue_video2_2 , NULL)

    )

    {
        g_error("Failed to link elementsses!@!@!@!@");
        pthread_mutex_unlock(&context->lock);
        return -2;
    }

    queue_video2 = gst_element_get_static_pad (gstContext->queue_video2, "src");
    queue_video2_2 = gst_element_get_static_pad (gstContext->queue_video2_2, "src");
    mixer2_sinkpad = gst_element_get_request_pad (gstContext->video_mixer, "sink_%u");
    mixer1_sinkpad = gst_element_get_request_pad (gstContext->video_mixer, "sink_%u");
    if (gst_pad_link (queue_video2, mixer2_sinkpad) != GST_PAD_LINK_OK  ||
     gst_pad_link (queue_video2_2, mixer1_sinkpad) != GST_PAD_LINK_OK) {
        g_printerr ("\n\n\n source0 and mixer pads could not be linked22222222222.\n\n\n");
        gst_object_unref (gstContext->pipeline);
        return -1;

    }
    g_object_unref(queue_video2);
    g_object_unref(queue_video2_2);

</code>```

And Log

```<code>0:00:00.926466171   968   0x7f54324050 FIXME           videodecoder gstvideodecoder.c:933:gst_video_decoder_drain_out:<nvjpegdec0> Sub-class should implement drain()
0:00:00.979159196   968   0x7f54324050 WARN                 basesrc gstbasesrc.c:3055:gst_base_src_loop:<videosrc1> error: Internal data stream error.
0:00:00.979208884   968   0x7f54324050 WARN                 basesrc gstbasesrc.c:3055:gst_base_src_loop:<videosrc1> error: streaming stopped, reason not-linked (-1)
0:00:00.979354772   968   0x7f54324050 WARN                   queue gstqueue.c:988:gst_queue_handle_sink_event:<queue_video1> error: Internal data stream error.
0:00:00.979391699   968   0x7f54324050 WARN                   queue gstqueue.c:988:gst_queue_handle_sink_event:<queue_video1> error: streaming stopped, reason not-linked (-1)
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:videosrc1: Internal data stream error.
Additional debug info1:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:videosrc1:
</code>```

I connected the elements using requestpad. But why am I getting this error?

Please let me know if I've done anything wrong

The command works as soon as you run it.

thank you

Body:
I'm developing on Jetson Nano, and my goal is to output two overlapping videos.
Here is the command I wrote first.

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=2 ! image/jpeg, width=1920, height=1080 ! nvjpegdec  ! video/x-raw ! queue ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA' ! queue ! comp.sink_0 \
v4l2src device=/dev/video1 io-mode=2 ! image/jpeg, width=1920, height=1080 ! nvjpegdec  ! video/x-raw ! queue ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA' ! queue ! comp.sink_1 \
alsasrc device="hw:1" ! audioconvert ! audioresample ! audiorate ! "audio/x-raw, rate=48000, channels=2" ! queue ! faac bitrate=128000 rate-control=2 ! queue ! muxer. \
nvcompositor name=comp  sink_0::xpos=0 sink_0::ypos=0 sink_0::width=768 sink_0::height=432 sink_0::zorder=2 sink_0::alpha=1.0 sink_1::xpos=0 sink_1::ypos=0 sink_1::width=1920 sink_1::height=1080 sink_1::zorder=1 sink_1::alpha=1.0 ! \
'video/x-raw(memory:NVMM),format=RGBA' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=(string)I420' ! nvv4l2h265enc ! h265parse ! queue ! mpegtsmux name=muxer ! filesink location=test.mp4 \

This is my Command. and This is My C Code

gst_bin_add_many (GST_BIN (gstContext->pipeline),
        gstContext->videosrc, gstContext->video_filter1, gstContext->jpegdec, gstContext->x_raw, gstContext->queue_video1, gstContext->video_convert2, gstContext->video_filter4, gstContext->queue_video2 ,
         gstContext->videosrc2, gstContext->video_filter2_1, gstContext->jpegdec2, gstContext->x_raw2, gstContext->queue_video2_1, gstContext->video_convert3, gstContext->video_filter2_3, gstContext->queue_video2_2 ,
         gstContext->video_mixer , gstContext->video_filter3, gstContext->video_convert,  gstContext->video_filter2,  gstContext->video_encoder, gstContext->video_pasre, gstContext->queue_video3, gstContext->muxer,gstContext->sink2, NULL);

if(
         !gst_element_link_many(gstContext->video_mixer, gstContext->video_filter3, gstContext->video_convert,  gstContext->video_filter2,  gstContext->video_encoder, gstContext->video_pasre, gstContext-> queue_video3, gstContext->muxer, NULL)
        || !gst_element_link_many(gstContext->videosrc, gstContext->video_filter1, gstContext->jpegdec, gstContext->x_raw, gstContext->queue_video1, gstContext->video_convert2, gstContext->video_filter4, gstContext->queue_video2 ,NULL)

        || !gst_element_link_many(gstContext->videosrc2, gstContext->video_filter2_1, gstContext->jpegdec2, gstContext->x_raw2, gstContext->queue_video2_1, gstContext->video_convert3, gstContext->video_filter2_3, gstContext->queue_video2_2 , NULL)

    )

    {
        g_error("Failed to link elementsses!@!@!@!@");
        pthread_mutex_unlock(&context->lock);
        return -2;
    }

    queue_video2 = gst_element_get_static_pad (gstContext->queue_video2, "src");
    queue_video2_2 = gst_element_get_static_pad (gstContext->queue_video2_2, "src");
    mixer2_sinkpad = gst_element_get_request_pad (gstContext->video_mixer, "sink_%u");
    mixer1_sinkpad = gst_element_get_request_pad (gstContext->video_mixer, "sink_%u");
    if (gst_pad_link (queue_video2, mixer2_sinkpad) != GST_PAD_LINK_OK  ||
     gst_pad_link (queue_video2_2, mixer1_sinkpad) != GST_PAD_LINK_OK) {
        g_printerr ("\n\n\n source0 and mixer pads could not be linked22222222222.\n\n\n");
        gst_object_unref (gstContext->pipeline);
        return -1;

    }
    g_object_unref(queue_video2);
    g_object_unref(queue_video2_2);

And Log

0:00:00.926466171   968   0x7f54324050 FIXME           videodecoder gstvideodecoder.c:933:gst_video_decoder_drain_out:<nvjpegdec0> Sub-class should implement drain()
0:00:00.979159196   968   0x7f54324050 WARN                 basesrc gstbasesrc.c:3055:gst_base_src_loop:<videosrc1> error: Internal data stream error.
0:00:00.979208884   968   0x7f54324050 WARN                 basesrc gstbasesrc.c:3055:gst_base_src_loop:<videosrc1> error: streaming stopped, reason not-linked (-1)
0:00:00.979354772   968   0x7f54324050 WARN                   queue gstqueue.c:988:gst_queue_handle_sink_event:<queue_video1> error: Internal data stream error.
0:00:00.979391699   968   0x7f54324050 WARN                   queue gstqueue.c:988:gst_queue_handle_sink_event:<queue_video1> error: streaming stopped, reason not-linked (-1)
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:videosrc1: Internal data stream error.
Additional debug info1:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:videosrc1:

I connected the elements using requestpad. But why am I getting this error?

Please let me know if I've done anything wrong

The command works as soon as you run it.

thank you


问:
How to make objects look like they’re coming towards you when I place them in stationary postions? Or have ball land on moving platform?
I'm trying to create a ball hop game where the ball has to jump from one platform to another. However, I'm struggling with having the ball land on the platform and I think it might be because the platform itself is moving rather than the camera/background. Does anyone know a way I could move the camera, or a solution to the ball landing on the platform even if the platform is moving?

This is my code now.

let gravity = 1.5;
class Ball{
  constructor(){
    this.x = 0;
    this.y= 200;
    this.d = 30;
    // constant velocity of the ball
    this.v = 0.001;
    this.xg = 0;
    this.yg = 0;
  }

  draw() {
    // stroke(0, 255, 255);
    ellipse(this.x, this.y, this.d);
  }

  update() {
    this.draw();
    this.y += this.yg;
    // ensures that ball doesnt go past screen
    if (this.y + this.d + this.yg <= windowHeight) {
      this.yg += gravity;
    }
  }
}
class Platform{
  constructor({x,y}){
    this.x = x;
    this.y= y;
    this.w = 30;
    this.h = 30;
    this.s = 1;
  }

  draw(){
    push();
    rectMode(CENTER);
    rotateX(1.45);
    rect(this.x,this.y,this.w,this.h);
    pop();

  }

  move(){
    this.y = this.y + this.s
    this.s = this.s + 0.0001
  }
}

let ball;
let plat;
let scrollOffset = 0;
function setup(){
  createCanvas(710, 400, WEBGL);

  ball = new Ball();

  plat = [
    (new Platform({x:0,y:200})),
    (new Platform({x:50,y:100})),
    (new Platform({x:0,y:0})),
    (new Platform({x:-50,y:-100})),
    (new Platform({x:0,y:-200})),
     ];
}

function draw(){
  background(255);

  ball.update();
  plat.forEach((plat) => {
    plat.draw();
    plat.move();
  });

  plat.forEach((plat) => {
      if (
        ball.y + ball.d <= plat.y &&
        ball.y + ball.d + ball.yg >= plat.y &&
        ball.x + ball.d >= plat.x &&
        ball.x <= plat.x + plat.w
      ) {
        ball.yg = 0;
      }
    });

}

function keyPressed() {
  if (keyCode === UP_ARROW) {
    ball.yg -= 20;
  }
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/p5.min.js"></script></code>```


问:
Link against failed, the lib file is exported by dumpbin of MSVC
I use dumpbin to convert a dll file to lib file:

get def file using dumpbin.exe /export and edit it

generate lib file using lib.exe.
The header files are available, however, when I include the header files and link against the lib file, there are linking errors:

```<code>error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl db::Layout::Layout(class db::Manager *)" (__imp_??0Layout@db@@QEAA@PEAVManager@1@@Z)
</code>```

I checked the def file, some lines are like:

```<code>_ZN2db6LayoutC1EPNS_7ManagerE
_ZN2db6LayoutC1ERKS0_
_ZN2db6LayoutC1EbPNS_7ManagerE
_ZN2db6LayoutC2EPNS_7ManagerE
_ZN2db6LayoutC2ERKS0_
_ZN2db6LayoutC2EbPNS_7ManagerE
</code>```

How to fix it? Did I miss some link settings in VC project? Thanks.

Body:
I use dumpbin to convert a dll file to lib file:

get def file using dumpbin.exe /export and edit it

generate lib file using lib.exe.
The header files are available, however, when I include the header files and link against the lib file, there are linking errors:

error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl db::Layout::Layout(class db::Manager *)" (__imp_??0Layout@db@@QEAA@PEAVManager@1@@Z)

I checked the def file, some lines are like:

_ZN2db6LayoutC1EPNS_7ManagerE
_ZN2db6LayoutC1ERKS0_
_ZN2db6LayoutC1EbPNS_7ManagerE
_ZN2db6LayoutC2EPNS_7ManagerE
_ZN2db6LayoutC2ERKS0_
_ZN2db6LayoutC2EbPNS_7ManagerE

How to fix it? Did I miss some link settings in VC project? Thanks.


问:
In ASP.NET Core 6 MVC - passing list of object to controller with model object
I have a model class like this:

```<code>public class DataModel
{
    public int CreatedBy { get; set; }
    public DateTime CreatedDate { get; set; }
    public List<ViewModel> ViewModel { get; set; }
}

public class ViewModel
{
    public int Id { get; set; }
    public string Name { get; set; }
    public string Address { get; set; }
}
</code>```

In ASP.NET Core 6.0 MVC, from js file posting data as shown here:

```<code>let postedModel = {
     CreatedBy :null,
     CreatedDate :null,
     ViewModel : []
}

postedModel.CreatedBy = "some id";
postedModel.CreatedDate = "today date"

$(".form-fieldset").each(function () {
    let formObject = {};
    $('form').find('input').each(function (index, element) {
        //In cshtml Name attribute given without form index
        formObject[$(element).attr('name')] = $(element).val();
    })
    postedModel.ViewModel.push(formObject)
}

$.ajax({
    url: '/ApiController/SaveData',
    type: 'POST',
    crossDomain: true,
    contentType: 'application/json; charset=utf-8',
    dataType: 'json',
    data: JSON.stringify(postedModel),
    async: false
})
</code>```

My api controller looks like this:

```<code>public async Task<IActionResult> SaveData([FromBody] DataModel postedModel)
{
}
</code>```

but I am getting null in the api controller.

What am I doing wrong? Please help.

Body:
I have a model class like this:

public class DataModel
{
    public int CreatedBy { get; set; }
    public DateTime CreatedDate { get; set; }
    public List<ViewModel> ViewModel { get; set; }
}

public class ViewModel
{
    public int Id { get; set; }
    public string Name { get; set; }
    public string Address { get; set; }
}

In ASP.NET Core 6.0 MVC, from js file posting data as shown here:

let postedModel = {
     CreatedBy :null,
     CreatedDate :null,
     ViewModel : []
}

postedModel.CreatedBy = "some id";
postedModel.CreatedDate = "today date"

$(".form-fieldset").each(function () {
    let formObject = {};
    $('form').find('input').each(function (index, element) {
        //In cshtml Name attribute given without form index
        formObject[$(element).attr('name')] = $(element).val();
    })
    postedModel.ViewModel.push(formObject)
}

$.ajax({
    url: '/ApiController/SaveData',
    type: 'POST',
    crossDomain: true,
    contentType: 'application/json; charset=utf-8',
    dataType: 'json',
    data: JSON.stringify(postedModel),
    async: false
})

My api controller looks like this:

public async Task<IActionResult> SaveData([FromBody] DataModel postedModel)
{
}

but I am getting null in the api controller.

What am I doing wrong? Please help.


问:
Make HTML containers align under each other when they reach the top of the screen
I'm trying to achieve the following scrolling behavior in my project:

I want div2 to scroll beneath div1 and div1 to stay on the top, now that is doable by setting div1's position as sticky, but the trick is that I want div3 to stay exactly under div1, and div4 to scroll beneath div3, and for div5 to stay exactly under div4 upon scrolling, to end with the following state:

Is there a way to do this other than setting div3 and div5 positions to sticky? Since I don't want to set top:x because x varies.


问:
pipe-function in loop does not find input
I am doing a for loop on a list of files and combining this with the pipe-function. Any idea why my input is not found?

```<code>for (f in 1:length(list.vaf)) {
my_vcf=read.table(pipe("grep -v '^##' list.vaf[f] | sed s/^#//"),stringsAsFactors=F,header=T,sep="\t")
...
...}
</code>```

Error:

```<code>grep: list.vaf[f]: No such file or directory
Error in read.table(pipe("grep -v '^##' list.vaf[f] | sed s/^#//"), stringsAsFactors = F,  :
  no lines available in input

> list.vaf[1]
[1] "~/Downloads/Sample1_pcgr_acmg.grch37.vcf"
</code>```

This works:

```<code>for (f in 1:length(list.vaf)) {
my_vcf=read.table(pipe("grep -v '^##' ~/Downloads/Sample1_pcgr_acmg.grch37.vcf | sed s/^#//"),stringsAsFactors=F,header=T,sep="\t")
...
...}
</code>```

Body:
I am doing a for loop on a list of files and combining this with the pipe-function. Any idea why my input is not found?

for (f in 1:length(list.vaf)) {
my_vcf=read.table(pipe("grep -v '^##' list.vaf[f] | sed s/^#//"),stringsAsFactors=F,header=T,sep="\t")
...
...}

Error:

grep: list.vaf[f]: No such file or directory
Error in read.table(pipe("grep -v '^##' list.vaf[f] | sed s/^#//"), stringsAsFactors = F,  :
  no lines available in input

> list.vaf[1]
[1] "~/Downloads/Sample1_pcgr_acmg.grch37.vcf"

This works:

for (f in 1:length(list.vaf)) {
my_vcf=read.table(pipe("grep -v '^##' ~/Downloads/Sample1_pcgr_acmg.grch37.vcf | sed s/^#//"),stringsAsFactors=F,header=T,sep="\t")
...
...}


问:
Error: 413 Request Entity Too Large using Vue storefront
When i am send the image more than (100kb) in post request it gave me the error of 413 status code

I tried to increase the size of payload but didn't work and the request didn't come to backend so there is nothing to do in backend


问:
How to create encoded primary key for table from two different table primary keys
I have two table Table 1 and Table 2 now I have to create thrid table whose primary key is encoded and combination of table1 and table 2 pk's. I also want to fetch the record of table3 with table 1 and table 2 on the basis of table 3 pk.

can some one help me.

solution   in my mind was if I can create some thing similar to JWT toke from the table 1 and table 2 pk's and store it in table 3 pk. but the problems is how I will decode it and perform basic CRUD operation with join query between different tables


问:
Old solution with OWIN
I have an old solution where i get the OWIN context with

```<code>var context = httpRequestMessage.GetOwinContext();
</code>```

from this context I fetch sessionId like this:

```<code>httpRequestMessage.Headers.FirstOrDefault(x => x.Key == "SessionId").Value.FirstOrDefault();
</code>```

Now this works without any problems on my IIS 8.5 but when upgrading to IIS 10 the sessionId is just lost and the key == "SessionId" is not found.

Setup between 8.5 and 10 is identical still it won´t work.

I´ve tried:

Mixing with TLS settings,
mixing with different Session States

Any help is appreciated! :)

Title: Old solution with OWIN

Body:
I have an old solution where i get the OWIN context with

var context = httpRequestMessage.GetOwinContext();

from this context I fetch sessionId like this:

httpRequestMessage.Headers.FirstOrDefault(x => x.Key == "SessionId").Value.FirstOrDefault();

Now this works without any problems on my IIS 8.5 but when upgrading to IIS 10 the sessionId is just lost and the key == "SessionId" is not found.

Setup between 8.5 and 10 is identical still it won´t work.

I´ve tried:

Mixing with TLS settings,
mixing with different Session States

Any help is appreciated! :)


问:
How to manage through 3rdPartyLibraryUpload method for file system
Earlier: Local File System
New Requirement: Integrate Azure storage system (Make configurable b/w File and Azure)

My Idea:
Create an Interface acting as an abstraction for client (Using factory method)
Based on config either Azure or File will be used. Client code won't know.
Client just ask for StorageObject and call Create/Download/Delete methods.

```<code>Interface IMyStorageObjectInterface
{
Create();
Download();
....
}
</code>```

So,

```<code>IMyStorageObjectInterface storageObject = Storage.GetStorage(); //factory method
storageObject.Create(path); //Create would either upload on cloud or local
</code>```

Problem:
I see a 3rd party library being used in some existing methods in the application
3rdPartyConvert&UploadMethod(string/stream filepath)

I guess the above method will successfully upload file given right path(local file path).
But how to do this with my Abstract methods(MyStorageInterface) for the client?

Should I let the 3rdParty upload method do its work and then upload via
my method(for file system, replace/ignore and for cloud upload it)?
Maybe Create an overload of the method (Making such change in each of such methods)?

Any other perhaps, better ideas?

Body:
Earlier: Local File System
New Requirement: Integrate Azure storage system (Make configurable b/w File and Azure)

My Idea:
Create an Interface acting as an abstraction for client (Using factory method)
Based on config either Azure or File will be used. Client code won't know.
Client just ask for StorageObject and call Create/Download/Delete methods.

Interface IMyStorageObjectInterface
{
Create();
Download();
....
}

So,

IMyStorageObjectInterface storageObject = Storage.GetStorage(); //factory method
storageObject.Create(path); //Create would either upload on cloud or local

Problem:
I see a 3rd party library being used in some existing methods in the application
3rdPartyConvert&UploadMethod(string/stream filepath)

I guess the above method will successfully upload file given right path(local file path).
But how to do this with my Abstract methods(MyStorageInterface) for the client?

Should I let the 3rdParty upload method do its work and then upload via
my method(for file system, replace/ignore and for cloud upload it)?
Maybe Create an overload of the method (Making such change in each of such methods)?

Any other perhaps, better ideas?


问:
Unable to receive UDP message packets through receiveFrom API of Poco Library. It doesnt return from the receiveFrom API
Able to send UDP message to a particular IP port using Poco Lib socket communication, But unable to receive the UDP message as it is getting stuck at receiveFrom API of DatagramSocket as in below code.

I am sending message every second and also have to receive acknowledgement every second, for that i have timer , Client and Server Threads running parallelly. The problem here is I am unable to receive the UDP packets which are being captured on wireshark. It is getting stuck at receiveFrom.
Please find below Client Server and main files.

` Server.hpp

```<code>#pragma once
#include "Poco/Net/StreamSocket.h"
#include "Poco/Net/DatagramSocket.h"
#include "Poco/Net/SocketAddress.h"
#include "Poco/Net/MulticastSocket.h"
#include "Poco/RunnableAdapter.h"
#include "Poco/Thread.h"
#include <cstring>
#include <iostream>

using namespace std;
using namespace Poco;
using namespace Poco::Net;

struct Server
{
    int bufferSize;
    SocketAddress sockets;
    static bool debugModeEnabled;

    Server() :
        bufferSize(1024) { //sockets = SocketAddress(10000);
        }

    Server(const UInt16& port, const int& bufferSize)
    {

        sockets = SocketAddress(port);
        this->bufferSize = bufferSize;
    }

    void receiveMessages()
    {

        char buffer[bufferSize];
        try
        {
            Poco::Net::DatagramSocket datagram(sockets);//(socket);
            datagram.bind(sockets);
            cout << "Server started socket" << endl;
            while (!datagram.available())
            {
                SocketAddress sender;
                cout << "Server started socket 2" << endl;
                int size = datagram.receiveFrom(buffer, bufferSize, sender);
                //int size = datagram.receiveBytes(buffer, bufferSize);
                cout << "received bytes size" << size << endl;
                buffer[size] = '\0';
                //std::string str(buffer);
                //cout << (debugModeEnabled ? (sender.toString() + ": ") : "- ") << buffer << endl;
                cout << "received: "  << size << buffer << endl;
                //cout << buffer << "Server adasdasd" << endl;

                if (string(buffer) == "\\end")
                {
                    //cerr << "\nUser: " << sender.toString() << " ended connection" << endl;
                    datagram.close(); // Closes the server
                }

            }
        }
        catch (const Poco::Exception& exc)
        {
            std::cerr << exc.displayText() << std::endl;
        }

    }
};

bool Server::debugModeEnabled = false;
</code>```

`

`Client.hpp

```<code>#pragma once

#include "Poco/Net/DatagramSocket.h"
#include "Poco/Net/SocketAddress.h"
#include "Poco/RunnableAdapter.h"
#include "Poco/Thread.h"
#include <iostream>
#include <string>

using namespace std;
using namespace Poco;
using namespace Poco::Net;

struct Client
{
    SocketAddress socket;
    string str;
    // By default the client connects to itself
    Client() { socket = SocketAddress("127.0.0.1", 10000); }

    Client(const Poco::Net::IPAddress& IP, const UInt16& port, const string& val) :
        str(val)
    {
        socket = SocketAddress(IP, port);
    }

    void sendMessages()
    {
        DatagramSocket datagram;
        datagram.connect(socket);
        string message = str;

        //cout << "sending: " << hex << hexify(message) << endl;

        unsigned int bytes_sent = 0;
        while (!datagram.available())
        {
            //getline(cin, message);

            //bytes_sent = datagram.sendBytes(message.data(), static_cast<int>(message.size()));
            bytes_sent = datagram.sendTo(message.data(), static_cast<int>(message.size()),socket);
            cout << "number of bytes sent: " << std::dec << bytes_sent << endl;
            if (bytes_sent >= message.size())
            {
                datagram.close();
            }
        }
    }

    string IP() { return socket.host().toString(); }
    UInt16 port() { return socket.port(); }

    static void sendMessage(const Poco::Net::IPAddress& IP, const UInt16& port, const string& message)
    {
        SocketAddress socket(IP, port);
        DatagramSocket datagram;
        datagram.connect(socket);
        datagram.sendBytes(message.data(), int(message.size()));
    }
};
</code>```

`

` main.cpp

```<code>
    int bufferSize = 1024;
    int exit_status = 0;

    Client client(IP, ciPort, str);
    Server server(mdilPort, bufferSize);

    RunnableAdapter<Client> clientRunnable(client, &Client::sendMessages);
    RunnableAdapter<Server> serverRunnable(server, &Server::receiveMessages);

    Thread clientThread, serverThread;

    // Client::sendMessage(IP, ciPort, "hello!!");
    try
    {

        Timer t = Timer();

          t.setInterval([&]() {
            cout << "client Tick" << endl;
            //            pApp->SendIndications();
            clientThread.start(clientRunnable);
            clientThread.join();
        },
                      1000);

           t.setInterval([&]() {
            cout<< "server Tick" << endl;
            serverThread.start(serverRunnable);
            serverThread.join();
        },
                      1000);

        t.setTimeout([&]() {
            std::cout << "Hey.. After 30s. But I will stop the timer!" << std::endl;
            t.stop();
            exit(exit_status);
        },
                     30000);

        std::cout << "I am Timer" << std::endl;

        while (true); // Keep main thread active
    }
    catch (...)
    {
        std::cout << "catched exception" << std::endl;
        //return -1;
    }
</code>```

`

I tried the conventional Socket Programming API's to receive the UDP packets but there also it is getting stuck at receiveFrom API. also tried running both client and server on different process to make sure there is no issue with the multi threading synchronization, but both the approach didnt help. I am able to capture the response at Wireshark but unable to receive on the application side using Poco Lib socket API's. Also allowed visual studio code through firewall as well

Body:
Able to send UDP message to a particular IP port using Poco Lib socket communication, But unable to receive the UDP message as it is getting stuck at receiveFrom API of DatagramSocket as in below code.

I am sending message every second and also have to receive acknowledgement every second, for that i have timer , Client and Server Threads running parallelly. The problem here is I am unable to receive the UDP packets which are being captured on wireshark. It is getting stuck at receiveFrom.
Please find below Client Server and main files.

` Server.hpp

#pragma once
#include "Poco/Net/StreamSocket.h"
#include "Poco/Net/DatagramSocket.h"
#include "Poco/Net/SocketAddress.h"
#include "Poco/Net/MulticastSocket.h"
#include "Poco/RunnableAdapter.h"
#include "Poco/Thread.h"
#include <cstring>
#include <iostream>

using namespace std;
using namespace Poco;
using namespace Poco::Net;

struct Server
{
    int bufferSize;
    SocketAddress sockets;
    static bool debugModeEnabled;

    Server() :
        bufferSize(1024) { //sockets = SocketAddress(10000);
        }

    Server(const UInt16& port, const int& bufferSize)
    {

        sockets = SocketAddress(port);
        this->bufferSize = bufferSize;
    }

    void receiveMessages()
    {

        char buffer[bufferSize];
        try
        {
            Poco::Net::DatagramSocket datagram(sockets);//(socket);
            datagram.bind(sockets);
            cout << "Server started socket" << endl;
            while (!datagram.available())
            {
                SocketAddress sender;
                cout << "Server started socket 2" << endl;
                int size = datagram.receiveFrom(buffer, bufferSize, sender);
                //int size = datagram.receiveBytes(buffer, bufferSize);
                cout << "received bytes size" << size << endl;
                buffer[size] = '\0';
                //std::string str(buffer);
                //cout << (debugModeEnabled ? (sender.toString() + ": ") : "- ") << buffer << endl;
                cout << "received: "  << size << buffer << endl;
                //cout << buffer << "Server adasdasd" << endl;

                if (string(buffer) == "\\end")
                {
                    //cerr << "\nUser: " << sender.toString() << " ended connection" << endl;
                    datagram.close(); // Closes the server
                }

            }
        }
        catch (const Poco::Exception& exc)
        {
            std::cerr << exc.displayText() << std::endl;
        }

    }
};

bool Server::debugModeEnabled = false;

`

`Client.hpp

#pragma once

#include "Poco/Net/DatagramSocket.h"
#include "Poco/Net/SocketAddress.h"
#include "Poco/RunnableAdapter.h"
#include "Poco/Thread.h"
#include <iostream>
#include <string>

using namespace std;
using namespace Poco;
using namespace Poco::Net;

struct Client
{
    SocketAddress socket;
    string str;
    // By default the client connects to itself
    Client() { socket = SocketAddress("127.0.0.1", 10000); }

    Client(const Poco::Net::IPAddress& IP, const UInt16& port, const string& val) :
        str(val)
    {
        socket = SocketAddress(IP, port);
    }

    void sendMessages()
    {
        DatagramSocket datagram;
        datagram.connect(socket);
        string message = str;

        //cout << "sending: " << hex << hexify(message) << endl;

        unsigned int bytes_sent = 0;
        while (!datagram.available())
        {
            //getline(cin, message);

            //bytes_sent = datagram.sendBytes(message.data(), static_cast<int>(message.size()));
            bytes_sent = datagram.sendTo(message.data(), static_cast<int>(message.size()),socket);
            cout << "number of bytes sent: " << std::dec << bytes_sent << endl;
            if (bytes_sent >= message.size())
            {
                datagram.close();
            }
        }
    }

    string IP() { return socket.host().toString(); }
    UInt16 port() { return socket.port(); }

    static void sendMessage(const Poco::Net::IPAddress& IP, const UInt16& port, const string& message)
    {
        SocketAddress socket(IP, port);
        DatagramSocket datagram;
        datagram.connect(socket);
        datagram.sendBytes(message.data(), int(message.size()));
    }
};

`

` main.cpp

    int bufferSize = 1024;
    int exit_status = 0;

    Client client(IP, ciPort, str);
    Server server(mdilPort, bufferSize);

    RunnableAdapter<Client> clientRunnable(client, &Client::sendMessages);
    RunnableAdapter<Server> serverRunnable(server, &Server::receiveMessages);

    Thread clientThread, serverThread;

    // Client::sendMessage(IP, ciPort, "hello!!");
    try
    {

        Timer t = Timer();

          t.setInterval([&]() {
            cout << "client Tick" << endl;
            //            pApp->SendIndications();
            clientThread.start(clientRunnable);
            clientThread.join();
        },
                      1000);

           t.setInterval([&]() {
            cout<< "server Tick" << endl;
            serverThread.start(serverRunnable);
            serverThread.join();
        },
                      1000);

        t.setTimeout([&]() {
            std::cout << "Hey.. After 30s. But I will stop the timer!" << std::endl;
            t.stop();
            exit(exit_status);
        },
                     30000);

        std::cout << "I am Timer" << std::endl;

        while (true); // Keep main thread active
    }
    catch (...)
    {
        std::cout << "catched exception" << std::endl;
        //return -1;
    }

`

I tried the conventional Socket Programming API's to receive the UDP packets but there also it is getting stuck at receiveFrom API. also tried running both client and server on different process to make sure there is no issue with the multi threading synchronization, but both the approach didnt help. I am able to capture the response at Wireshark but unable to receive on the application side using Poco Lib socket API's. Also allowed visual studio code through firewall as well


问:
Parallel Textpreprocessing with Pyro
I am using distributed Gensim for Topic Modeling of documents. However, the preprocessing part is not distributed. Therefore I would like to implement a distributed preprocessing of the text data with Pyro (since distributed Gensim is also based on Pyro). Are there any examples how to use Pyro for this task?</p>

Title: Parallel Textpreprocessing with Pyro


问:
Wordpress's Category & Tag is not show after choosing
Wordpress v 6.0.1, 6.0.3

Firstly, I choose category & tag in default Post. Then, I save and publish.
After refreshed, selected category is missing. In Post list dashboard, Category & Tag is not show. How to fix it.

45sec short-clip: https://vimeo.com/779149812

In Public site screen,

```<code>  $category = get_the_category();
  $category = $category[0];
  $categoryName = $category->cat_name;
</code>```

In browser console's Elements,

Body:
Wordpress v 6.0.1, 6.0.3

Firstly, I choose category & tag in default Post. Then, I save and publish.
After refreshed, selected category is missing. In Post list dashboard, Category & Tag is not show. How to fix it.

45sec short-clip: https://vimeo.com/779149812

In Public site screen,

  $category = get_the_category();
  $category = $category[0];
  $categoryName = $category->cat_name;

In browser console's Elements,