问:
How to create custom column filter for primeng table in angular
Is it possible to create custom filter for one of my column in data table ? in the column are Wind directions for specific day each hour (for eg  245° SW), i setup multiselect column filter with options (North, East, West...etc) so when user select North in the filter it filters data which contains N , i have no idea how can i implement this any help please ? https://www.primefaces.org/primeng/table/filter this is the filter i used (its for the Agent row in the table)

this is my html

```<code>....code
<th pSortableColumn="direction">Wind Direction <p-sortIcon field="direction"></p-sortIcon>
            <p-columnFilter field="direction" matchMode="in" display="menu" [showMatchModes]="false" [showOperator]="false" [showAddButton]="false">
              <ng-template pTemplate="filter" let-value let-filter="filterCallback">
                  <p-multiSelect [ngModel]="value" [options]="windDirections" placeholder="Any" (onChange)="filter($event.value)" optionLabel="direction">
                      <ng-template let-option pTemplate="item">
                          <div class="p-multiselect-wind-option">
                            <span class="pi pi-compass mr-5px"></span>
                            <span style="margin-left: 5px;">{{option.direction}}</span>
                          </div>
                      </ng-template>
                  </p-multiSelect>
              </ng-template>
          </p-columnFilter></th>
...
...code
</code>```

this is ts where i setup my directions

```<code> this.windDirections = [
      { direction: 'North', code: 'N' },
      { direction: 'North East', code: 'NE' },
      { direction: 'North West', code: 'NW' },
      { direction: 'South', code: 'S' },
      { direction: 'South West', code: 'SW' },
      { direction: 'South East', code: 'SE' },
      { direction: 'East', code: 'E' },
      { direction: 'West', code: 'W' },
    ];
</code>```

this is how the the data i am trying to filter look like ["256° SW","244° SW","202° S","245° SW" ... etc]

```<code>....
...code
weatherDataWithLoader$.subscribe({
      next: (historicalWeatherData) => {
        const temperatures = historicalWeatherData.hourly.temperature_2m;
        const times = historicalWeatherData.hourly.time.map((time) =>
          this.datePipe.transform(time, 'shortTime')
        );
        const humidities = historicalWeatherData.hourly.relativehumidity_2m;
        const windSpeeds = historicalWeatherData.hourly.windspeed_10m;
        const airPressures = historicalWeatherData.hourly.surface_pressure;
        const windDirections =
          historicalWeatherData.hourly.winddirection_10m.map((item) =>  // here i added 'N','S','W' etc based on direction
            this.checkWindDirection(item)
          );
        const precipitations = historicalWeatherData.hourly.precipitation;
        const rain = historicalWeatherData.hourly.rain;
        const cloudcover = historicalWeatherData.hourly.cloudcover;
        const soilTemperatures =
          historicalWeatherData.hourly.soil_temperature_0_to_7cm;

        temperatures.forEach((value, i) => {
          this.weatherData.push(
            new WeatherDataItem(
              value,
              times[i],
              humidities[i],
              windSpeeds[i],
              airPressures[i],
              windDirections[i],
              precipitations[i],
              rain[i],
              cloudcover[i],
              soilTemperatures[i]
            )
          );
        });
      },
...
...code
</code>```

Body:
Is it possible to create custom filter for one of my column in data table ? in the column are Wind directions for specific day each hour (for eg  245° SW), i setup multiselect column filter with options (North, East, West...etc) so when user select North in the filter it filters data which contains N , i have no idea how can i implement this any help please ? https://www.primefaces.org/primeng/table/filter this is the filter i used (its for the Agent row in the table)

this is my html

....code
Wind Direction

              <ng-template pTemplate="filter" let-value let-filter="filterCallback">

                      <ng-template let-option pTemplate="item">

                            {{option.direction}}

                      </ng-template>

              </ng-template>

...
...code

this is ts where i setup my directions

 this.windDirections = [
      { direction: 'North', code: 'N' },
      { direction: 'North East', code: 'NE' },
      { direction: 'North West', code: 'NW' },
      { direction: 'South', code: 'S' },
      { direction: 'South West', code: 'SW' },
      { direction: 'South East', code: 'SE' },
      { direction: 'East', code: 'E' },
      { direction: 'West', code: 'W' },
    ];

this is how the the data i am trying to filter look like ["256° SW","244° SW","202° S","245° SW" ... etc]

....
...code
weatherDataWithLoader$.subscribe({
      next: (historicalWeatherData) => {
        const temperatures = historicalWeatherData.hourly.temperature_2m;
        const times = historicalWeatherData.hourly.time.map((time) =>
          this.datePipe.transform(time, 'shortTime')
        );
        const humidities = historicalWeatherData.hourly.relativehumidity_2m;
        const windSpeeds = historicalWeatherData.hourly.windspeed_10m;
        const airPressures = historicalWeatherData.hourly.surface_pressure;
        const windDirections =
          historicalWeatherData.hourly.winddirection_10m.map((item) =>  // here i added 'N','S','W' etc based on direction
            this.checkWindDirection(item)
          );
        const precipitations = historicalWeatherData.hourly.precipitation;
        const rain = historicalWeatherData.hourly.rain;
        const cloudcover = historicalWeatherData.hourly.cloudcover;
        const soilTemperatures =
          historicalWeatherData.hourly.soil_temperature_0_to_7cm;

        temperatures.forEach((value, i) => {
          this.weatherData.push(
            new WeatherDataItem(
              value,
              times[i],
              humidities[i],
              windSpeeds[i],
              airPressures[i],
              windDirections[i],
              precipitations[i],
              rain[i],
              cloudcover[i],
              soilTemperatures[i]
            )
          );
        });
      },
...
...code


来源: stackexchange

问:
How to generate gpg key using existing private/public key pair
I am trying to generate gpg key from already generated/existing private-public key pair.
Since certificate is already generated so need to utilize the existing key-pair.

I tried option 13 from below list of gpg option but it requires keygrip. Tried it with private/public key but throwing Not a valid keygrip (expecting 40 hex digits).

```<code>root@xyz:~# gpg --expert --full-generate-key
gpg (GnuPG) 2.3.6; Copyright (C) 2021 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
   (1) RSA and RSA
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
   (7) DSA (set your own capabilities)
   (8) RSA (set your own capabilities)
   (9) ECC (sign and encrypt) *default*
   (10) ECC (sign only)
   (11) ECC (set your own capabilities)
   (13) Existing key
   (14) Existing key from card
Your selection? 13
Enter the keygrip:
</code>```

Is it correct way of utilizing existing key-pair?

ContentLicense: CC BY-SA 4.0

Body:
I am trying to generate gpg key from already generated/existing private-public key pair.
Since certificate is already generated so need to utilize the existing key-pair.

I tried option 13 from below list of gpg option but it requires keygrip. Tried it with private/public key but throwing Not a valid keygrip (expecting 40 hex digits).

root@xyz:~# gpg --expert --full-generate-key
gpg (GnuPG) 2.3.6; Copyright (C) 2021 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
   (1) RSA and RSA
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
   (7) DSA (set your own capabilities)
   (8) RSA (set your own capabilities)
   (9) ECC (sign and encrypt) *default*
   (10) ECC (sign only)
   (11) ECC (set your own capabilities)
   (13) Existing key
   (14) Existing key from card
Your selection? 13
Enter the keygrip:

Is it correct way of utilizing existing key-pair?


问:
Problem with Settings entity. CloudKit subscription adds the same subscription twice and miss the other one from the list
I simply register subscription for my iCloud entities the following way:

```<code>    let options: CKQuerySubscriptionOptions = [.firesOnRecordCreation, .firesOnRecordUpdate, .firesOnRecordDeletion]
    let territoryGroupSubscription = CKQuerySubscription(recordType: "TerritoryGroup", predicate: NSPredicate(value: true), options: options)
    let serviceSubscription = CKQuerySubscription(recordType: "Service", predicate: NSPredicate(value: true), options: options)
    let goalSubscription = CKQuerySubscription(recordType: "Goal", predicate: NSPredicate(value: true), options: options)
    let territorySubscription = CKQuerySubscription(recordType: "Territory", predicate: NSPredicate(value: true), options: options)
    let addressSubscription = CKQuerySubscription(recordType: "Address", predicate: NSPredicate(value: true), options: options)
    let noteSubscription = CKQuerySubscription(recordType: "Note", predicate: NSPredicate(value: true), options: options)
    let daySubscription = CKQuerySubscription(recordType: "Day", predicate: NSPredicate(value: true), options: options)
    let categorySubscription = CKQuerySubscription(recordType: "Category", predicate: NSPredicate(value: true), options: options)
    let shareSubscription = CKQuerySubscription(recordType: "cloudkit.share", predicate: NSPredicate(value: true), options: options)
    let settingsSubscription = CKQuerySubscription(recordType: "Settings", predicate: NSPredicate(value: true), options: options)
    let notificationInfo = CKNotificationInfo()
    notificationInfo.shouldBadge = false
    notificationInfo.shouldSendContentAvailable = true

    territoryGroupSubscription.notificationInfo = notificationInfo
    serviceSubscription.notificationInfo = notificationInfo
    goalSubscription.notificationInfo = notificationInfo
    territorySubscription.notificationInfo = notificationInfo
    addressSubscription.notificationInfo = notificationInfo
    noteSubscription.notificationInfo = notificationInfo
    daySubscription.notificationInfo = notificationInfo
    categorySubscription.notificationInfo = notificationInfo
    shareSubscription.notificationInfo = notificationInfo
    settingsSubscription.notificationInfo = notificationInfo

    let privateSubscriptionsOperation = CKModifySubscriptionsOperation(subscriptionsToSave: [settingsSubscription, territoryGroupSubscription, serviceSubscription, goalSubscription, territorySubscription, addressSubscription, noteSubscription, daySubscription, categorySubscription, shareSubscription], subscriptionIDsToDelete: nil)
    privateSubscriptionsOperation.database = CloudAssistant.shared.privateDatabase

    let queue = OperationQueue()
    queue.maxConcurrentOperationCount = 1
    queue.addOperation(privateSubscriptionsOperation)
</code>```

And this is the output for my operation in cloudkit dashboard:

As you can see there is 10 subscriptions (as expected) but two of them are duplicated for Category Record Type (3th and 6th row). And of course Settings Record Type is missing. Why? Where should I look for the problem?

UPDATE:

When I remove all subscriptions from icloud dashboard, then only 9 is subscribed, without Settings. Why there is issue with Settings?

Is it reserved name for system entities or what?

Body:
I simply register subscription for my iCloud entities the following way:

    let options: CKQuerySubscriptionOptions = [.firesOnRecordCreation, .firesOnRecordUpdate, .firesOnRecordDeletion]
    let territoryGroupSubscription = CKQuerySubscription(recordType: "TerritoryGroup", predicate: NSPredicate(value: true), options: options)
    let serviceSubscription = CKQuerySubscription(recordType: "Service", predicate: NSPredicate(value: true), options: options)
    let goalSubscription = CKQuerySubscription(recordType: "Goal", predicate: NSPredicate(value: true), options: options)
    let territorySubscription = CKQuerySubscription(recordType: "Territory", predicate: NSPredicate(value: true), options: options)
    let addressSubscription = CKQuerySubscription(recordType: "Address", predicate: NSPredicate(value: true), options: options)
    let noteSubscription = CKQuerySubscription(recordType: "Note", predicate: NSPredicate(value: true), options: options)
    let daySubscription = CKQuerySubscription(recordType: "Day", predicate: NSPredicate(value: true), options: options)
    let categorySubscription = CKQuerySubscription(recordType: "Category", predicate: NSPredicate(value: true), options: options)
    let shareSubscription = CKQuerySubscription(recordType: "cloudkit.share", predicate: NSPredicate(value: true), options: options)
    let settingsSubscription = CKQuerySubscription(recordType: "Settings", predicate: NSPredicate(value: true), options: options)
    let notificationInfo = CKNotificationInfo()
    notificationInfo.shouldBadge = false
    notificationInfo.shouldSendContentAvailable = true

    territoryGroupSubscription.notificationInfo = notificationInfo
    serviceSubscription.notificationInfo = notificationInfo
    goalSubscription.notificationInfo = notificationInfo
    territorySubscription.notificationInfo = notificationInfo
    addressSubscription.notificationInfo = notificationInfo
    noteSubscription.notificationInfo = notificationInfo
    daySubscription.notificationInfo = notificationInfo
    categorySubscription.notificationInfo = notificationInfo
    shareSubscription.notificationInfo = notificationInfo
    settingsSubscription.notificationInfo = notificationInfo

    let privateSubscriptionsOperation = CKModifySubscriptionsOperation(subscriptionsToSave: [settingsSubscription, territoryGroupSubscription, serviceSubscription, goalSubscription, territorySubscription, addressSubscription, noteSubscription, daySubscription, categorySubscription, shareSubscription], subscriptionIDsToDelete: nil)
    privateSubscriptionsOperation.database = CloudAssistant.shared.privateDatabase

    let queue = OperationQueue()
    queue.maxConcurrentOperationCount = 1
    queue.addOperation(privateSubscriptionsOperation)

And this is the output for my operation in cloudkit dashboard:

As you can see there is 10 subscriptions (as expected) but two of them are duplicated for Category Record Type (3th and 6th row). And of course Settings Record Type is missing. Why? Where should I look for the problem?

UPDATE:

When I remove all subscriptions from icloud dashboard, then only 9 is subscribed, without Settings. Why there is issue with Settings?

Is it reserved name for system entities or what?


问:
How can i send secret key from the client
Hi im trying to do some authencication on my socket.io, but i dont know how to send the secret key from the client to the server. im using express-session.
When i console.log(socket.handshake.session) im getting this: cookie: { path: '/', _expires: null, originalMaxAge: null, httpOnly: true }
what shall i do on the client??

Server.js

```<code>const session = require('express-session')({ const session = require('express-session')({
  secret: 'ssshhhhh',
  resave: true,
  saveUninitialized: true
});
const sharedsession = require('express-socket.io-session');

app.use(session);
io.use(sharedsession(session));
io.use(sharedsession(session, {
  resave: true,
  secret: 'ssshhhhh',
  saveUninitialized: true
}));

io.on('connection', function (socket) {
    console.log(socket.handshake.session);

</code>```

client.js

```<code>
    const socket = io({
      auth: {
        token: "abcd"
      }
    });
</code>```

Body:
Hi im trying to do some authencication on my socket.io, but i dont know how to send the secret key from the client to the server. im using express-session.
When i console.log(socket.handshake.session) im getting this: cookie: { path: '/', _expires: null, originalMaxAge: null, httpOnly: true }
what shall i do on the client??

Server.js

const session = require('express-session')({ const session = require('express-session')({
  secret: 'ssshhhhh',
  resave: true,
  saveUninitialized: true
});
const sharedsession = require('express-socket.io-session');

app.use(session);
io.use(sharedsession(session));
io.use(sharedsession(session, {
  resave: true,
  secret: 'ssshhhhh',
  saveUninitialized: true
}));

io.on('connection', function (socket) {
    console.log(socket.handshake.session);

client.js

    const socket = io({
      auth: {
        token: "abcd"
      }
    });


问:
Invoke a fluter method from the iOS share extension without opening a app
I was creating a Flutter project that requires an iOS share extension that communicates with the flutter service without opening the main application. I tried to use flutter 'receive-share-intent' which partially does the job but open the main application to perform the service. But I want to don't want to open the app but invoke a flutter service.

There are some solution that I wanted to try but it only works with the main application like creating a FlutterMethodChannel

```<code>let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
let {channel_name} = FlutterMethodChannel(name: "samples.flutter.dev/{channel_function}", binaryMessenger: controller.binaryMessenger)
 {channel_name}.setMethodCallHandler({
      (call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in
      // This method is invoked on the UI thread.
      // Handle messages.
    })
</code>```

But this doesn't work with the extension as expected. To create the method channel we need a flutter view controller but I don't know how to reference it for the custom share view controller.
If anyone has any idea about it, please help me with this.

Body:
I was creating a Flutter project that requires an iOS share extension that communicates with the flutter service without opening the main application. I tried to use flutter 'receive-share-intent' which partially does the job but open the main application to perform the service. But I want to don't want to open the app but invoke a flutter service.

There are some solution that I wanted to try but it only works with the main application like creating a FlutterMethodChannel

let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
let {channel_name} = FlutterMethodChannel(name: "samples.flutter.dev/{channel_function}", binaryMessenger: controller.binaryMessenger)
 {channel_name}.setMethodCallHandler({
      (call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in
      // This method is invoked on the UI thread.
      // Handle messages.
    })

But this doesn't work with the extension as expected. To create the method channel we need a flutter view controller but I don't know how to reference it for the custom share view controller.
If anyone has any idea about it, please help me with this.


问:
Intermittent connection issues - socket timeout on Pods
We have a Spring boot application which is containerized and deployed in Azure AKS.
A service is created with Internal load balancer for the application.

When invoking the end points, some times we are getting socket time out exception. So unable to figure out why the exception is coming up.

Also I see sometimes a slowness in response from the endpoint also.

I found a blog where it says some, some kubernetes bug was there.

https://kubernetes.io/blog/2019/03/29/kube-proxy-subtleties-debugging-an-intermittent-connection-reset/

So I am not sure, if this is still there in latest Kubernetes version. Any suggestion would be helpful.


问:
Cannot change font colour in Powerpoint template with Officer
I have a custom PPT template that I am using successfully to display all sort of information - I m now trying to format the color of some of the text based on specific rules.
I haven't included the rules here.
I have followed some examples :
https://stackoverflow.com/a/63366352/5029248
and able to reproduce, for instance using the default placeholder 'title' however I can't seem to figure out a way to format the font in an existing custom placeholder.

```<code>doc_1 <- read_pptx("Template.pptx")
Layout<-'Login_funnel_color'
Layout_properties<-layout_properties ( x = doc_1,layout=Layout )
Layout_properties

</code>```

Below are the placeholder that I have customised in my template

```<code>       master_name               name type  id                ph_label                                                            ph      offx     offy         cx
544 Content Slides Login_funnel_color body 108    Text Placeholder 107 <p:ph type="body" sz="quarter" idx="27" hasCustomPrompt="1"/> 0.8361100 5.689304  0.3801170
545 Content Slides Login_funnel_color body   2             Rectangle 1                                                          <NA> 0.0000000 0.000000 13.3333333
548 Content Slides Login_funnel_color body  65            Rectangle 64                                                          <NA> 0.2083333 4.468800  0.9472222
549 Content Slides Login_funnel_color body  66            Rectangle 65                                                          <NA> 0.2083333 4.788193  0.9303740
551 Content Slides Login_funnel_color body  10      Text Placeholder 9 <p:ph type="body" sz="quarter" idx="10" hasCustomPrompt="1"/> 0.2083333 1.402778  1.9166667
552 Content Slides Login_funnel_color body  18     Text Placeholder 17 <p:ph type="body" sz="quarter" idx="12" hasCustomPrompt="1"/> 0.2083333 3.095487  1.9166667
553 Content Slides Login_funnel_color body  22     Text Placeholder 21 <p:ph type="body" sz="quarter" idx="13" hasCustomPrompt="1"/> 0.2083333 3.532987  1.9166667
554 Content Slides Login_funnel_color body  24     Text Placeholder 23 <p:ph type="body" sz="quarter" idx="14" hasCustomPrompt="1"/> 0.2083333 4.789931  0.9319444
555 Content Slides Login_funnel_color body  28     Text Placeholder 27 <p:ph type="body" sz="quarter" idx="15" hasCustomPrompt="1"/> 0.2083333 5.227431  0.9319444
556 Content Slides Login_funnel_color body  31     Text Placeholder 30 <p:ph type="body" sz="quarter" idx="16" hasCustomPrompt="1"/> 0.2083333 6.484376  1.9166667
557 Content Slides Login_funnel_color body  34     Text Placeholder 33 <p:ph type="body" sz="quarter" idx="17" hasCustomPrompt="1"/> 0.2083333 6.913194  1.9166667
558 Content Slides Login_funnel_color body  73            Rectangle 72                                                          <NA> 1.1555556 4.467065  0.9694444
559 Content Slides Login_funnel_color body  74            Rectangle 73                                                          <NA> 1.1444444 4.781300  0.9784722
560 Content Slides Login_funnel_color body  78     Text Placeholder 77 <p:ph type="body" sz="quarter" idx="18" hasCustomPrompt="1"/> 1.1423611 4.790678  0.9805556
561 Content Slides Login_funnel_color body  80     Text Placeholder 79 <p:ph type="body" sz="quarter" idx="19" hasCustomPrompt="1"/> 1.1444444 5.228178  0.9805556
562 Content Slides Login_funnel_color body  82         Arrow: Right 81                                                          <NA> 0.9184175 3.273607  0.4747496
563 Content Slides Login_funnel_color body  83         Arrow: Right 82                                                          <NA> 0.9184175 1.579979  0.4747496
564 Content Slides Login_funnel_color body  87     Text Placeholder 86 <p:ph type="body" sz="quarter" idx="20" hasCustomPrompt="1"/> 0.2274311 2.300348  0.6579856
565 Content Slides Login_funnel_color body  88              TextBox 87                                                          <NA> 0.9833333 2.244792  0.2388889
566 Content Slides Login_funnel_color body  89              TextBox 88                                                          <NA> 0.9833333 3.923314  0.2388889
567 Content Slides Login_funnel_color body  90              TextBox 89                                                          <NA> 0.6352581 5.596222  0.2388889
568 Content Slides Login_funnel_color body  92     Text Placeholder 91 <p:ph type="body" sz="quarter" idx="21" hasCustomPrompt="1"/> 1.3298611 2.312500  0.6666667
569 Content Slides Login_funnel_color body  94     Text Placeholder 93 <p:ph type="body" sz="quarter" idx="22" hasCustomPrompt="1"/> 0.2083333 3.989583  0.8611111
570 Content Slides Login_funnel_color body  98     Text Placeholder 97 <p:ph type="body" sz="quarter" idx="23" hasCustomPrompt="1"/> 1.3298611 3.989583  0.7829867
571 Content Slides Login_funnel_color body 106    Text Placeholder 105 <p:ph type="body" sz="quarter" idx="26" hasCustomPrompt="1"/> 0.2274311 5.684028  0.5918307
572 Content Slides Login_funnel_color body 111    Text Placeholder 110 <p:ph type="body" sz="quarter" idx="28" hasCustomPrompt="1"/> 1.2743898 5.671233  0.4089425
573 Content Slides Login_funnel_color body 113    Text Placeholder 112 <p:ph type="body" sz="quarter" idx="29" hasCustomPrompt="1"/> 1.8121982 5.687216  0.3891328
574 Content Slides Login_funnel_color body 114             TextBox 113                                                          <NA> 1.5446883 5.590103  0.2961581
575 Content Slides Login_funnel_color body 115        Arrow: Right 114                                                          <NA> 0.9312653 4.966865  0.4747496
576 Content Slides Login_funnel_color  pic 117 Picture Placeholder 116                      <p:ph type="pic" sz="quarter" idx="30"/> 3.0277778 1.513520 10.0781255
577 Content Slides Login_funnel_color  pic 119 Picture Placeholder 118                      <p:ph type="pic" sz="quarter" idx="31"/> 3.0277767 5.402778 10.0781245
578 Content Slides Login_funnel_color body 121             TextBox 120                                                          <NA> 3.2673021 2.974061  6.7083333
579 Content Slides Login_funnel_color  pic   8   Picture Placeholder 7                      <p:ph type="pic" sz="quarter" idx="32"/> 3.0277778 3.588542 10.0781255
580 Content Slides Login_funnel_color body   6   Content Placeholder 5             <p:ph sz="quarter" idx="33" hasCustomPrompt="1"/> 0.2083333 1.850694  1.9045144
</code>```

adding a slide based on my layout

```<code>doc_1 <- add_slide(doc_1,layout=Layout, master='Content Slides')
</code>```

Then creating the text element.
Here I m trying to place the text in any of the placeholder type I have on my template

```<code>slide_text <- ftext("tt",fp_text(color = "black", font.size = 18, bold = TRUE))
doc_1 <- ph_with(x = doc_1, value = fpar(slide_text ),location =  ph_location_type(ph_label = "Text Placeholder 112"))
doc_1 <- ph_with(x = doc_1, value = fpar(slide_text ),location =  ph_location_type(ph_label = "TextBox 120"))
doc_1 <- ph_with(x = doc_1, value = fpar(slide_text ),location =  ph_location_type(ph_label = "Picture Placeholder 7"))
doc_1 <- ph_with(x = doc_1, value = fpar(slide_text ),location =  ph_location_type(ph_label = "Content Placeholder 5"))

print(doc_1, target="temp.pptx")
</code>```

However, none of the text are placed within the placeholders selected, they all end up somewhere in the middle of the page at the same location. I m not sure what to do.

Body:
I have a custom PPT template that I am using successfully to display all sort of information - I m now trying to format the color of some of the text based on specific rules.
I haven't included the rules here.
I have followed some examples :
https://stackoverflow.com/a/63366352/5029248
and able to reproduce, for instance using the default placeholder 'title' however I can't seem to figure out a way to format the font in an existing custom placeholder.

doc_1 <- read_pptx("Template.pptx")
Layout<-'Login_funnel_color'
Layout_properties<-layout_properties ( x = doc_1,layout=Layout )
Layout_properties

Below are the placeholder that I have customised in my template

       master_name               name type  id                ph_label                                                            ph      offx     offy         cx
544 Content Slides Login_funnel_color body 108    Text Placeholder 107
 0.8361100 5.689304  0.3801170
545 Content Slides Login_funnel_color body   2             Rectangle 1                                                          <NA> 0.0000000 0.000000 13.3333333
548 Content Slides Login_funnel_color body  65            Rectangle 64                                                          <NA> 0.2083333 4.468800  0.9472222
549 Content Slides Login_funnel_color body  66            Rectangle 65                                                          <NA> 0.2083333 4.788193  0.9303740
551 Content Slides Login_funnel_color body  10      Text Placeholder 9
 0.2083333 1.402778  1.9166667
552 Content Slides Login_funnel_color body  18     Text Placeholder 17
 0.2083333 3.095487  1.9166667
553 Content Slides Login_funnel_color body  22     Text Placeholder 21
 0.2083333 3.532987  1.9166667
554 Content Slides Login_funnel_color body  24     Text Placeholder 23
 0.2083333 4.789931  0.9319444
555 Content Slides Login_funnel_color body  28     Text Placeholder 27
 0.2083333 5.227431  0.9319444
556 Content Slides Login_funnel_color body  31     Text Placeholder 30
 0.2083333 6.484376  1.9166667
557 Content Slides Login_funnel_color body  34     Text Placeholder 33
 0.2083333 6.913194  1.9166667
558 Content Slides Login_funnel_color body  73            Rectangle 72                                                          <NA> 1.1555556 4.467065  0.9694444
559 Content Slides Login_funnel_color body  74            Rectangle 73                                                          <NA> 1.1444444 4.781300  0.9784722
560 Content Slides Login_funnel_color body  78     Text Placeholder 77
 1.1423611 4.790678  0.9805556
561 Content Slides Login_funnel_color body  80     Text Placeholder 79
 1.1444444 5.228178  0.9805556
562 Content Slides Login_funnel_color body  82         Arrow: Right 81                                                          <NA> 0.9184175 3.273607  0.4747496
563 Content Slides Login_funnel_color body  83         Arrow: Right 82                                                          <NA> 0.9184175 1.579979  0.4747496
564 Content Slides Login_funnel_color body  87     Text Placeholder 86
 0.2274311 2.300348  0.6579856
565 Content Slides Login_funnel_color body  88              TextBox 87                                                          <NA> 0.9833333 2.244792  0.2388889
566 Content Slides Login_funnel_color body  89              TextBox 88                                                          <NA> 0.9833333 3.923314  0.2388889
567 Content Slides Login_funnel_color body  90              TextBox 89                                                          <NA> 0.6352581 5.596222  0.2388889
568 Content Slides Login_funnel_color body  92     Text Placeholder 91
 1.3298611 2.312500  0.6666667
569 Content Slides Login_funnel_color body  94     Text Placeholder 93
 0.2083333 3.989583  0.8611111
570 Content Slides Login_funnel_color body  98     Text Placeholder 97
 1.3298611 3.989583  0.7829867
571 Content Slides Login_funnel_color body 106    Text Placeholder 105
 0.2274311 5.684028  0.5918307
572 Content Slides Login_funnel_color body 111    Text Placeholder 110
 1.2743898 5.671233  0.4089425
573 Content Slides Login_funnel_color body 113    Text Placeholder 112
 1.8121982 5.687216  0.3891328
574 Content Slides Login_funnel_color body 114             TextBox 113                                                          <NA> 1.5446883 5.590103  0.2961581
575 Content Slides Login_funnel_color body 115        Arrow: Right 114                                                          <NA> 0.9312653 4.966865  0.4747496
576 Content Slides Login_funnel_color  pic 117 Picture Placeholder 116
 3.0277778 1.513520 10.0781255
577 Content Slides Login_funnel_color  pic 119 Picture Placeholder 118
 3.0277767 5.402778 10.0781245
578 Content Slides Login_funnel_color body 121             TextBox 120                                                          <NA> 3.2673021 2.974061  6.7083333
579 Content Slides Login_funnel_color  pic   8   Picture Placeholder 7
 3.0277778 3.588542 10.0781255
580 Content Slides Login_funnel_color body   6   Content Placeholder 5
 0.2083333 1.850694  1.9045144

adding a slide based on my layout

doc_1 <- add_slide(doc_1,layout=Layout, master='Content Slides')

Then creating the text element.
Here I m trying to place the text in any of the placeholder type I have on my template

slide_text <- ftext("tt",fp_text(color = "black", font.size = 18, bold = TRUE))
doc_1 <- ph_with(x = doc_1, value = fpar(slide_text ),location =  ph_location_type(ph_label = "Text Placeholder 112"))
doc_1 <- ph_with(x = doc_1, value = fpar(slide_text ),location =  ph_location_type(ph_label = "TextBox 120"))
doc_1 <- ph_with(x = doc_1, value = fpar(slide_text ),location =  ph_location_type(ph_label = "Picture Placeholder 7"))
doc_1 <- ph_with(x = doc_1, value = fpar(slide_text ),location =  ph_location_type(ph_label = "Content Placeholder 5"))

print(doc_1, target="temp.pptx")

However, none of the text are placed within the placeholders selected, they all end up somewhere in the middle of the page at the same location. I m not sure what to do.


问:
How do I remove the "Clear" button from input type="date" in Chrome?
How do I remove/hide this button:

I've tried many of the commonly proposed solutions including:

Setting the required attribute

Using display:none on -webkit-clear-button

None of these appear to work. Here's a simple example:

https://codepen.io/ilitirit/pen/gOKVGgp

It doesn't appear to work in Chrome or Edge.


问:
SMAX API - Failed to create Incident
I want to create an Incident in Service Management Automation(Microfocus - SMAX) using API.

I use activity HTTP Request. My properties are as follow:
Accepted Format: JSON
Request Method : POST
Request URL: “https://smax.mycompany.com/rest/9966332211/ems/bulk”
Cookies = LWSSO_COOKIE_KEY=Token
Body:

```<code>{
‘entities’: [
{
‘entity_type’: ‘Incident’,
‘properties’: {
‘ContactPerson’: ‘’,
‘ImpactScope’: ‘Enterprise’,
‘IncidentToCompany’: ‘14728’,
‘Urgency’: ‘TotalLossOfService’,
‘DisplayLabel’: ‘Non reception du mail de volumetrie d’appel’,
‘CurrentAssignment’: ‘ServiceDesk’,
‘ServiceDeskGroup’: ‘14546’,
‘ExpertGroup’: ‘14533’,
‘RegisteredForActualService’: ‘15393’,
‘Description’: ‘This is a test Incident. Please ignore it.’
}
}
],
‘operation’: ‘CREATE’
}
</code>```

I Get the following error as reposnone:

```<code>“errorDetails”: {
“httpStatus”: 500,
“message”: “Failed to evaluate DSL expression ${current_update.RegisteredForActualService.IsChanged && entity.RegisteredForActualService.SupportLevel1Group != null && entity.ServiceDeskGroup == null}”,
“developer_message”: “”,
“message_key”: “failed_to_evaluate_dsl_expression”,
“message_rb”: “locale/workflow_errors”,
“message_arguments”: [
“${current_update.RegisteredForActualService.IsChanged && entity.RegisteredForActualService.SupportLevel1Group != null && entity.ServiceDeskGroup == null}”
],
“exceptionType”: “WorkflowException”
}
</code>```

Do you know what might cause the error?

Kind regards

Title: SMAX API - Failed to create Incident

Body:
I want to create an Incident in Service Management Automation(Microfocus - SMAX) using API.

I use activity HTTP Request. My properties are as follow:
Accepted Format: JSON
Request Method : POST
Request URL: “https://smax.mycompany.com/rest/9966332211/ems/bulk”
Cookies = LWSSO_COOKIE_KEY=Token
Body:

{
‘entities’: [
{
‘entity_type’: ‘Incident’,
‘properties’: {
‘ContactPerson’: ‘’,
‘ImpactScope’: ‘Enterprise’,
‘IncidentToCompany’: ‘14728’,
‘Urgency’: ‘TotalLossOfService’,
‘DisplayLabel’: ‘Non reception du mail de volumetrie d’appel’,
‘CurrentAssignment’: ‘ServiceDesk’,
‘ServiceDeskGroup’: ‘14546’,
‘ExpertGroup’: ‘14533’,
‘RegisteredForActualService’: ‘15393’,
‘Description’: ‘This is a test Incident. Please ignore it.’
}
}
],
‘operation’: ‘CREATE’
}

I Get the following error as reposnone:

“errorDetails”: {
“httpStatus”: 500,
“message”: “Failed to evaluate DSL expression ${current_update.RegisteredForActualService.IsChanged && entity.RegisteredForActualService.SupportLevel1Group != null && entity.ServiceDeskGroup == null}”,
“developer_message”: “”,
“message_key”: “failed_to_evaluate_dsl_expression”,
“message_rb”: “locale/workflow_errors”,
“message_arguments”: [
“${current_update.RegisteredForActualService.IsChanged && entity.RegisteredForActualService.SupportLevel1Group != null && entity.ServiceDeskGroup == null}”
],
“exceptionType”: “WorkflowException”
}

Do you know what might cause the error?

Kind regards


问:
A question about the document object model (DOM)
When I open chrome developer console and type:

```<code>document.firstElementChild.lastElementChild.lastElementChild.lastElementChild.innerHTML = "Steven"
</code>```

the text "Third" changes to "Steven".

There are two child elements of HTML, the head and the body. So, why doesn't the code 'firstElementChild' target the the head element, since that's the first element?

```<code><!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>My Website</title>
    <link rel="stylesheet" href="styles.css">

  </head>
  <body>

    <h1>Hello</h1>

    <input type="checkbox">

    <button style=":active color:red;">Click Me</button>

    <ul>
      <li class="list">
        <a href="https://www.google.com">Google</a>
      </li>
      <li class="list">Second</li>
      <li class="list">Third</li>
    </ul>

  </body>

</html>

[Screenshot of the site][1]-->

  [1]: https://i.stack.imgur.com/Lwfmt.jpg
</code>```

Body:
When I open chrome developer console and type:

document.firstElementChild.lastElementChild.lastElementChild.lastElementChild.innerHTML = "Steven"

the text "Third" changes to "Steven".

There are two child elements of HTML, the head and the body. So, why doesn't the code 'firstElementChild' target the the head element, since that's the first element?

<!DOCTYPE html>

    <meta charset="utf-8">
    <title>My Website</title>
    <link rel="stylesheet" href="styles.css">

Hello

    <input type="checkbox">

    <button style=":active color:red;">Click Me</button>

        Google

Second

Third

[Screenshot of the site][1]-->

  [1]: https://i.stack.imgur.com/Lwfmt.jpg


问:
Is there a way to show a TypeScript error when an unknown property is passed in an object to function?
Is there a way to force an error in TypeScript if an object passed into a function contains a property that doesn't exist on the set interface?

```<code>interface ITest {
  id: number
  name: string
}

const testFunc = (data: ITest) => {
  console.log(data)
}

const test = {id: 1, name: 'hello', test: ''}

testFunc(test) // is there a way to get this to throw an error to say that test does not belong to ITest?
</code>```

https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgAgJIBUIGczIN4BQyywAJgFzIgCuAtgEbRFVy0SU5SgDmBAvgQIIA9iBzJIOAGLUQCZAF5kAClJwwcShmxgAlIoB8+ZiLHCANhAB054d1Xq4u-oNPjJuJXjKUAjABoWNkoAcgALCHNbEMCPUJCBAg8ZOWUPfQB6DJIsCQioFDhkAHc4AE8JYWRuCFwwMOBcsCr6qGFi5DgQZGg2qErkLHK89QkdZFJhbCphXEZbEG4B7RwAfkEgA

Body:
Is there a way to force an error in TypeScript if an object passed into a function contains a property that doesn't exist on the set interface?

interface ITest {
  id: number
  name: string
}

const testFunc = (data: ITest) => {
  console.log(data)
}

const test = {id: 1, name: 'hello', test: ''}

testFunc(test) // is there a way to get this to throw an error to say that test does not belong to ITest?

https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgAgJIBUIGczIN4BQyywAJgFzIgCuAtgEbRFVy0SU5SgDmBAvgQIIA9iBzJIOAGLUQCZAF5kAClJwwcShmxgAlIoB8+ZiLHCANhAB054d1Xq4u-oNPjJuJXjKUAjABoWNkoAcgALCHNbEMCPUJCBAg8ZOWUPfQB6DJIsCQioFDhkAHc4AE8JYWRuCFwwMOBcsCr6qGFi5DgQZGg2qErkLHK89QkdZFJhbCphXEZbEG4B7RwAfkEgA


问:
Can you use refresh tokens in Blazor Server app with cookie authentication and no Api's and no local storage?
Just looking into Blazor and my company decided to explore Server Side App (no WASM).

I got the basic project setup and because we want the app to work with out current user db, I modified our User Server (Microservice) to authenticate a user and return a JWT token. In the Login page once we have the token, we authenticate and the cookie is stored.

```<code>var auth = await HttpContext.AuthenticateAsync();
auth.Properties.RedirectUri = "/";

var accessToken = new AuthenticationToken()
{
    Name = OpenIdConnectParameterNames.AccessToken,
    Value = Token
};

AuthenticationToken[] tokens = { accessToken };

auth.Properties.StoreTokens(tokens);
auth.Properties.IsPersistent = true;

await HttpContext.SignInAsync("Cookies", auth.Principal, auth.Properties);
</code>```

So I want to say at this point everything is working fine.

Now back to the question. I wish to increase security by using Refresh Tokens, and this is where I hit the problem. Every tutorial or guide I google/bing that talks about Refresh tokens goes by the basses that I am using WASM or an API that I call. There are a few articles that say to use Local Storage but then that can bring up a whole new conversation of Local Storage vs Cookies vs Session, and I was hoping to stick with most of the built in stuff.

I understand that Server-Side issues with the HTTP context, hence why the login page is done on a .cshtml page and the fact that the cookies are set as HTTPOnly so JavaScript cannot access them.

So, is there away to do it?

Just to clarify, this is a Server-Side app only, no client apps or API's or anything else and I wish to stick with most of the built in stuff using cookies.

Body:
Just looking into Blazor and my company decided to explore Server Side App (no WASM).

I got the basic project setup and because we want the app to work with out current user db, I modified our User Server (Microservice) to authenticate a user and return a JWT token. In the Login page once we have the token, we authenticate and the cookie is stored.

var auth = await HttpContext.AuthenticateAsync();
auth.Properties.RedirectUri = "/";

var accessToken = new AuthenticationToken()
{
    Name = OpenIdConnectParameterNames.AccessToken,
    Value = Token
};

AuthenticationToken[] tokens = { accessToken };

auth.Properties.StoreTokens(tokens);
auth.Properties.IsPersistent = true;

await HttpContext.SignInAsync("Cookies", auth.Principal, auth.Properties);

So I want to say at this point everything is working fine.

Now back to the question. I wish to increase security by using Refresh Tokens, and this is where I hit the problem. Every tutorial or guide I google/bing that talks about Refresh tokens goes by the basses that I am using WASM or an API that I call. There are a few articles that say to use Local Storage but then that can bring up a whole new conversation of Local Storage vs Cookies vs Session, and I was hoping to stick with most of the built in stuff.

I understand that Server-Side issues with the HTTP context, hence why the login page is done on a .cshtml page and the fact that the cookies are set as HTTPOnly so JavaScript cannot access them.

So, is there away to do it?

Just to clarify, this is a Server-Side app only, no client apps or API's or anything else and I wish to stick with most of the built in stuff using cookies.


问:
java.io.FileNotFoundException: class path resource[Report/quotation.jasper] cannot be resolved to absolute file path because it does not reside in the
The below code is working fine on local app:

```<code>String filePath = ResourceUtils.getFile("classpath:Reports/" + jaspername).getAbsolutePath();
</code>```

But when I deployed it on UAT Server it through the below error:

```<code>java.io.FileNotFoundException: class path resource[Report/quotation.jasper] cannot be resolved
to absolute file path because it does not reside in the file system:
jar:file:/C:/FolderName/application.jar!/BOOT_INF/Classes!/Reports/Quotation.jasper
</code>```

Body:
The below code is working fine on local app:

String filePath = ResourceUtils.getFile("classpath:Reports/" + jaspername).getAbsolutePath();

But when I deployed it on UAT Server it through the below error:

java.io.FileNotFoundException: class path resource[Report/quotation.jasper] cannot be resolved
to absolute file path because it does not reside in the file system:
jar:file:/C:/FolderName/application.jar!/BOOT_INF/Classes!/Reports/Quotation.jasper


问:
xhr requests getting canceled and same requests get called automatically and getting succeeded
In my application, after the page load (refresh) - xhr requests are getting canceled and automatically same requests get called again and that are getting succeeded.

I am trying to fetch data from the database in these calls, below is the code snippet.

```<code>public async Task<IReadOnlyCollection<ABCModel>> Get(CancellationToken cancellationToken)
    {
        using var unitOfWork = _unitOfWorkFactory.Create();

        var abcRepo = unitOfWork.GetRepository<ABC>();

        return await abcRepo.AsQueryable()
            .Select(c => new ABCModel
            {
                Id = c.Id,
                Code = c.Code
            })
            .OrderBy(c => c.Code)
            .ToArrayAsync(cancellationToken);
    }
</code>```

Why I am getting this error. Help me solve this error.

Body:
In my application, after the page load (refresh) - xhr requests are getting canceled and automatically same requests get called again and that are getting succeeded.

I am trying to fetch data from the database in these calls, below is the code snippet.

public async Task<IReadOnlyCollection<ABCModel>> Get(CancellationToken cancellationToken)
    {
        using var unitOfWork = _unitOfWorkFactory.Create();

        var abcRepo = unitOfWork.GetRepository<ABC>();

        return await abcRepo.AsQueryable()
            .Select(c => new ABCModel
            {
                Id = c.Id,
                Code = c.Code
            })
            .OrderBy(c => c.Code)
            .ToArrayAsync(cancellationToken);
    }

Why I am getting this error. Help me solve this error.


问:
Range function argument returning typeerror: not all arguments converted during string formatting
I'm new to programming and I've just started learning python. Sorry for the long post and any help will be appreciated.

Write a program that prints the integers from 1 to 100. But for multiples of three print "Fizz" instead of the number, and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

Code:

```<code>my_list = [x for x in range(1,101)]

</code>```
```<code>for number in my_list:
    if number%3 ==0 and number%5 ==0:
        my_list[number] = "FizzBuzz"
    elif number%3 == 0:
        my_list[number] = "Fizz"
    elif number%5 == 0:
        my_list[number] ="Buzz"
</code>```
```<code></code>```

**My program is return this error shown below: **

```<code>---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_5324\196912280.py in <module>
      7
      8 for number in my_list:
----> 9     if number%3 ==0 and number%5 ==0:
     10         my_list[number] = "FizzBuzz"
     11     elif number%3 == 0:

TypeError: not all arguments converted during string formatting

</code>```

but when I change the value of start in range function to 0

my_list = [x for x in range(0,101)]

```<code>
for number in my_list:
    if number%3 ==0 and number%5 ==0:
        my_list[number] = "FizzBuzz"
    elif number%3 == 0:
        my_list[number] = "Fizz"
    elif number%5 == 0:
        my_list[number] ="Buzz"

print(my_list)
</code>```

It worked well. I can't figure out the reason behind it. Maybe it has something to do with the interpreter.
Any help will be appreciated.

Output:

```<code>['FizzBuzz', 1, 2, 'Fizz', 4, 'Buzz', 'Fizz', 7, 8, 'Fizz', 'Buzz', 11, 'Fizz', 13, 14, 'FizzBuzz', 16, 17, 'Fizz', 19, 'Buzz', 'Fizz', 22, 23, 'Fizz', 'Buzz', 26, 'Fizz', 28, 29, 'FizzBuzz', 31, 32, 'Fizz', 34, 'Buzz', 'Fizz', 37, 38, 'Fizz', 'Buzz', 41, 'Fizz', 43, 44, 'FizzBuzz', 46, 47, 'Fizz', 49, 'Buzz', 'Fizz', 52, 53, 'Fizz', 'Buzz', 56, 'Fizz', 58, 59, 'FizzBuzz', 61, 62, 'Fizz', 64, 'Buzz', 'Fizz', 67, 68, 'Fizz', 'Buzz', 71, 'Fizz', 73, 74, 'FizzBuzz', 76, 77, 'Fizz', 79, 'Buzz', 'Fizz', 82, 83, 'Fizz', 'Buzz', 86, 'Fizz', 88, 89, 'FizzBuzz', 91, 92, 'Fizz', 94, 'Buzz', 'Fizz', 97, 98, 'Fizz', 'Buzz']
</code>```

Body:
I'm new to programming and I've just started learning python. Sorry for the long post and any help will be appreciated.

Write a program that prints the integers from 1 to 100. But for multiples of three print "Fizz" instead of the number, and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

Code:

my_list = [x for x in range(1,101)]

for number in my_list:
    if number%3 ==0 and number%5 ==0:
        my_list[number] = "FizzBuzz"
    elif number%3 == 0:
        my_list[number] = "Fizz"
    elif number%5 == 0:
        my_list[number] ="Buzz"

**My program is return this error shown below: **

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_5324\196912280.py in <module>
      7
      8 for number in my_list:
----> 9     if number%3 ==0 and number%5 ==0:
     10         my_list[number] = "FizzBuzz"
     11     elif number%3 == 0:

TypeError: not all arguments converted during string formatting

but when I change the value of start in range function to 0

my_list = [x for x in range(0,101)]

for number in my_list:
    if number%3 ==0 and number%5 ==0:
        my_list[number] = "FizzBuzz"
    elif number%3 == 0:
        my_list[number] = "Fizz"
    elif number%5 == 0:
        my_list[number] ="Buzz"

print(my_list)

It worked well. I can't figure out the reason behind it. Maybe it has something to do with the interpreter.
Any help will be appreciated.

Output:

['FizzBuzz', 1, 2, 'Fizz', 4, 'Buzz', 'Fizz', 7, 8, 'Fizz', 'Buzz', 11, 'Fizz', 13, 14, 'FizzBuzz', 16, 17, 'Fizz', 19, 'Buzz', 'Fizz', 22, 23, 'Fizz', 'Buzz', 26, 'Fizz', 28, 29, 'FizzBuzz', 31, 32, 'Fizz', 34, 'Buzz', 'Fizz', 37, 38, 'Fizz', 'Buzz', 41, 'Fizz', 43, 44, 'FizzBuzz', 46, 47, 'Fizz', 49, 'Buzz', 'Fizz', 52, 53, 'Fizz', 'Buzz', 56, 'Fizz', 58, 59, 'FizzBuzz', 61, 62, 'Fizz', 64, 'Buzz', 'Fizz', 67, 68, 'Fizz', 'Buzz', 71, 'Fizz', 73, 74, 'FizzBuzz', 76, 77, 'Fizz', 79, 'Buzz', 'Fizz', 82, 83, 'Fizz', 'Buzz', 86, 'Fizz', 88, 89, 'FizzBuzz', 91, 92, 'Fizz', 94, 'Buzz', 'Fizz', 97, 98, 'Fizz', 'Buzz']


问:
Vue Project Production build is giving FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
A vue project which was created with node 14. Its running locally fine with
npm run serve
But when I tried to do production build by command
vue-cli service build
it was giving the below error

So I tried building with 4gb and getting same above error and then tried with 6 gb ram with this command

NODE_OPTIONS=--max_old_space_size=6144 vue-cli service build

But there also same result.

I want to deploy it to AWS Amplify, so please give resolution so that I can do production build without allocating extra memory


问:
railway cross level detection using image processing technique
railway track detection

how can I check this railway cross level are in  same level or not using image processing technique ?

Need to check is there any distance measuring algorithm to calculate the railway cross level detection.


问:
Helm - Remove double quotes
I'm trying to remove double quotes from the below parameter in Kubernetes template file. Since the double quotes are there, the helm templating fails and not able to install Kubernetes template.

      - ip: status.podIP
        hostnames: "
        - test.com
        - test2.com"
```
<p>I have tried using Helm functions trimAll, toYaml but the quotes are not removed.</p>
<pre class="lang-yaml prettyprint-override"><code>      - ip: status.podIP
        hostnames: "
        - test.com
        - test2.com"
</code>```

In the above YAML, I need to remove the double quotes, to make it as list.

Title: Helm - Remove double quotes

Body:
I'm trying to remove double quotes from the below parameter in Kubernetes template file. Since the double quotes are there, the helm templating fails and not able to install Kubernetes template.

      - ip: status.podIP
        hostnames: "
        - test.com
        - test2.com"

I have tried using Helm functions trimAll, toYaml but the quotes are not removed.

      - ip: status.podIP
        hostnames: "
        - test.com
        - test2.com"

In the above YAML, I need to remove the double quotes, to make it as list.


问:
Django-wiki hit error when trying to access
enter image description here

at the beginning, I executed Django run server

after that I go to http://127.0.0.1:8000/ to try to access this wiki

page are hitting error >> global flags not at the start of the expression at position 7

when i remove that line, it's works, but problems is if that line is removed, the content will gone

I just started Django 1 week, please help to to overcome this error

expect able to overcome this issue and launch the page successfully


问:
How to add comments in dnSpy?
Is there a way to add comments in the decompiled window of dnSpy ?

For example, a comment before a function as it is possible to do it with '/' in Ida.

I tried to use several shortcuts but none worked.

Title: How to add comments in dnSpy?


问:
unable to Load Station Data in rstudio
i am trying to bias correct a grid dataset using the climate4R package. I load all the grid dataset but unable to load my station data. I performed dataInventory and stationInfo successfully with the following code:

```<code>dir.obs <- "C:/bias_correction_workstation"
</code>```
```<code>di.obs <- dataInventory(dir.obs)
stationInfo(dir.obs)
</code>```

i tried to load the station data using the text files stored in my working directory. my text files are saved as recommended. the code used for loading station data was:

```<code>obsprecip <- loadStationData(dataset = dir,obs, var= "precip", stationID= c("kn01", "jg02", "ba03", "kt04"), season= 5:10, years= 1991:2015)
</code>```

i am expecting to load the stations but i got this error;

```<code>[2022-12-15 12:32:47] Loading data ...
[2022-12-15 12:32:47] Retrieving metadata ...
Error in if (class(out$Data) == "numeric") datadimnames <- "time" :
  the condition has length > 1
</code>```

please what could possibly be the cause? thanks in advance

Title: unable to Load Station Data in rstudio

Body:
i am trying to bias correct a grid dataset using the climate4R package. I load all the grid dataset but unable to load my station data. I performed dataInventory and stationInfo successfully with the following code:

dir.obs <- "C:/bias_correction_workstation"

di.obs <- dataInventory(dir.obs)
stationInfo(dir.obs)

i tried to load the station data using the text files stored in my working directory. my text files are saved as recommended. the code used for loading station data was:

obsprecip <- loadStationData(dataset = dir,obs, var= "precip", stationID= c("kn01", "jg02", "ba03", "kt04"), season= 5:10, years= 1991:2015)

i am expecting to load the stations but i got this error;

[2022-12-15 12:32:47] Loading data ...
[2022-12-15 12:32:47] Retrieving metadata ...
Error in if (class(out$Data) == "numeric") datadimnames <- "time" :
  the condition has length > 1

please what could possibly be the cause? thanks in advance


问:
Get total transaction count for tokens (crypto) in R?
is there a way in R or in general to get the total amount of transactions there have ever been for a token? (ERC-20)

I mean this number: https://i.stack.imgur.com/gQbd3.png (Etherscan, example: uniswap)

Yeah, I could just copy the number shown there. But is there a way to do this with an API or something? Would be more "scientifically correct" for my thesis.

Thanks a lot in advance!

What I tried: explored the Etherscan API and some other APIs, didn't find a solution.


问:
Change values of a numpy array from Nifti file
I would like to calculate the dice coefficient of a label in two images. To do this, I first would like to change all values in the image with a specific color to one and the other values to zero, to make sure I am comparing a specific label in the image. Is there any possibility to loop over all the voxels and change the ones with a specific color to one and the others to zero?

I have loaded the files as following:

```<code>imaGT = nib.load(example_filename)
imaSeg = nib.load(example_filename_2)
</code>```

And then made a numpy array of them:

```<code>GroundT = np.array(imaGT)
Segm = np.asarray(imaSeg)
</code>```

How do I loop over the values now and change them?

Body:
I would like to calculate the dice coefficient of a label in two images. To do this, I first would like to change all values in the image with a specific color to one and the other values to zero, to make sure I am comparing a specific label in the image. Is there any possibility to loop over all the voxels and change the ones with a specific color to one and the others to zero?

I have loaded the files as following:

imaGT = nib.load(example_filename)
imaSeg = nib.load(example_filename_2)

And then made a numpy array of them:

GroundT = np.array(imaGT)
Segm = np.asarray(imaSeg)

How do I loop over the values now and change them?


问:
Appending MS Word Bookmarks with data from a pd.DataFrame
I have a MS Word document that I have populated with bookmarks. I also have an indexed dataframe with information such as date, test score etc. for students (index).

I want to paste the information for each index to specified bookmarks in the word template. So at the test_score bookmark I can paste the test score, for example.

Knowing this, I will be able to iterate through the indexed dataframe and produce reports for each student.

I have not found anyone trying to do this, nor have I found any documentation on docx for this problem.
The most I can find on this subject is identifying where bookmarks are in a Word doc. This doesn't produce a reference point to feed back to the script.

Thank you in advance.


问:
Python MICE Imputer only returning numerical columns
I am using https://www.kaggle.com/datasets/pavansubhasht/ibm-hr-analytics-attrition-dataset
I have converted the Object fields to Category.

```<code>import pandas as pd
import miceforest as mf
df = pd.read_csv('HR_Employee_Attrition.csv')

df_Mice = df
df_Mice[['Attrition', 'BusinessTravel', 'Department', 'EducationField', 'Gender', 'JobRole', 'MaritalStatus', 'Over18', 'OverTime']] = df_Mice[['Attrition', 'BusinessTravel', 'Department', 'EducationField', 'Gender', 'JobRole', 'MaritalStatus', 'Over18', 'OverTime']].astype("category")

kds = mf.ImputationKernel(
  df_Mice,
  datasets=5,
  save_all_iterations=True,
  random_state=11
)
kds.mice(5)
kds.complete_data(4)
Imputation = pd.concat([kds.complete_data(i) for i in range(5)]).groupby(level=0).mean()
Imputation.head(10)
</code>```

I read Mice function not getting data columns to impute, but couldn't get it to use factors for those columns. (I think it shouldn't matter in Python, but most of the MICE problem answers are related to the R version.)

So now I have the problem that it's only returning the numerical columns in the output, not the text ones, and it hasn't dealt with the missing value in the Gender column at all.

How do I get it to return all 35 columns in the output?

Body:
I am using https://www.kaggle.com/datasets/pavansubhasht/ibm-hr-analytics-attrition-dataset
I have converted the Object fields to Category.

import pandas as pd
import miceforest as mf
df = pd.read_csv('HR_Employee_Attrition.csv')

df_Mice = df
df_Mice[['Attrition', 'BusinessTravel', 'Department', 'EducationField', 'Gender', 'JobRole', 'MaritalStatus', 'Over18', 'OverTime']] = df_Mice[['Attrition', 'BusinessTravel', 'Department', 'EducationField', 'Gender', 'JobRole', 'MaritalStatus', 'Over18', 'OverTime']].astype("category")

kds = mf.ImputationKernel(
  df_Mice,
  datasets=5,
  save_all_iterations=True,
  random_state=11
)
kds.mice(5)
kds.complete_data(4)
Imputation = pd.concat([kds.complete_data(i) for i in range(5)]).groupby(level=0).mean()
Imputation.head(10)

I read Mice function not getting data columns to impute, but couldn't get it to use factors for those columns. (I think it shouldn't matter in Python, but most of the MICE problem answers are related to the R version.)

So now I have the problem that it's only returning the numerical columns in the output, not the text ones, and it hasn't dealt with the missing value in the Gender column at all.

How do I get it to return all 35 columns in the output?


问:
How to get column of a particular cell value in dataframe in Python?
Let's say I have dataframe in python as defined below. The columns are X, Y,Z.

```<code>import pandas as pd
_dict={}
_dict['X'] =[90,75,95,77]
_dict['Y'] =[87,85,92,65]
_dict['Z'] =[93,90,91,78]
df=pd.DataFrame(_dict)
</code>```

X
Y
Z

90
87
93

75
90
85

95
92
91

77
65
78

I have to create 2 new columns, max and max_column.

max: Will contain row-wise maximum value among X,Y,Z.

max_column: Will contain the name of the column which from which maximum value was obtained.

X
Y
Z
max
max_column

90
87
93
93
Z

75
90
85
90
Y

95
92
91
95
X

77
65
78
78
Z

Can someone help me with this?

I tried this to get maxcolumn, need help with creating max_column.

```<code>def maximum(row):
    if (row['X']>row['Y']) and (row['X']>row['Z']):
        return row['X']
    elif (row['Y']>row['X']) and (row['Y']>row['Z']):
        return row['Y']
    else:
        return row['Z']
df['max']=df.apply(lambda x: maximum(x), axis=1)
</code>```

Body:
Let's say I have dataframe in python as defined below. The columns are X, Y,Z.

import pandas as pd
_dict={}
_dict['X'] =[90,75,95,77]
_dict['Y'] =[87,85,92,65]
_dict['Z'] =[93,90,91,78]
df=pd.DataFrame(_dict)

X
Y
Z

90
87
93

75
90
85

95
92
91

77
65
78

I have to create 2 new columns, max and max_column.

max: Will contain row-wise maximum value among X,Y,Z.

max_column: Will contain the name of the column which from which maximum value was obtained.

X
Y
Z
max
max_column

90
87
93
93
Z

75
90
85
90
Y

95
92
91
95
X

77
65
78
78
Z

Can someone help me with this?

I tried this to get maxcolumn, need help with creating max_column.

def maximum(row):
    if (row['X']>row['Y']) and (row['X']>row['Z']):
        return row['X']
    elif (row['Y']>row['X']) and (row['Y']>row['Z']):
        return row['Y']
    else:
        return row['Z']
df['max']=df.apply(lambda x: maximum(x), axis=1)


问:
How to activate biometric login if switch is activated
i created this Activity to login with fingerprint. But how i can enable/disable this activity with a switch in the MainActivity. I know that i cant change the manifest programmatically. So how can i do this?

ImageView btnUnlock;
TextView txt;

```<code>private Executor executor;
private BiometricPrompt biometricPrompt;
private BiometricPrompt.PromptInfo promptInfo;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_lock);

    btnUnlock = findViewById(R.id.btnUnlock);
    txt = findViewById(R.id.txt1);

    executor = ContextCompat.getMainExecutor(this);
    biometricPrompt = new BiometricPrompt(LockActivity.this, executor, new BiometricPrompt.AuthenticationCallback() {
        @Override
        public void onAuthenticationError(int errorCode, @NonNull CharSequence errString) {
            super.onAuthenticationError(errorCode, errString);
            txt.setText("Error : " + errString);
        }

        @Override
        public void onAuthenticationSucceeded(@NonNull BiometricPrompt.AuthenticationResult result) {
            super.onAuthenticationSucceeded(result);
            Intent myIntent = new Intent(LockActivity.this, MainActivity.class);
            LockActivity.this.startActivity(myIntent);
        }

        @Override
        public void onAuthenticationFailed() {
            super.onAuthenticationFailed();
            txt.setText("Authentication Failed");
        }
    });

    promptInfo = new BiometricPrompt.PromptInfo.Builder()
            .setTitle("Biometric Authentication")
            .setSubtitle("Login using fingerprint or face")
            .setNegativeButtonText("Cancel")
            .build();

    btnUnlock.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            biometricPrompt.authenticate(promptInfo);
        }
    });

}
</code>```

}

Body:
i created this Activity to login with fingerprint. But how i can enable/disable this activity with a switch in the MainActivity. I know that i cant change the manifest programmatically. So how can i do this?

ImageView btnUnlock;
TextView txt;

private Executor executor;
private BiometricPrompt biometricPrompt;
private BiometricPrompt.PromptInfo promptInfo;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_lock);

    btnUnlock = findViewById(R.id.btnUnlock);
    txt = findViewById(R.id.txt1);

    executor = ContextCompat.getMainExecutor(this);
    biometricPrompt = new BiometricPrompt(LockActivity.this, executor, new BiometricPrompt.AuthenticationCallback() {
        @Override
        public void onAuthenticationError(int errorCode, @NonNull CharSequence errString) {
            super.onAuthenticationError(errorCode, errString);
            txt.setText("Error : " + errString);
        }

        @Override
        public void onAuthenticationSucceeded(@NonNull BiometricPrompt.AuthenticationResult result) {
            super.onAuthenticationSucceeded(result);
            Intent myIntent = new Intent(LockActivity.this, MainActivity.class);
            LockActivity.this.startActivity(myIntent);
        }

        @Override
        public void onAuthenticationFailed() {
            super.onAuthenticationFailed();
            txt.setText("Authentication Failed");
        }
    });

    promptInfo = new BiometricPrompt.PromptInfo.Builder()
            .setTitle("Biometric Authentication")
            .setSubtitle("Login using fingerprint or face")
            .setNegativeButtonText("Cancel")
            .build();

    btnUnlock.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            biometricPrompt.authenticate(promptInfo);
        }
    });

}

}


问:
How to use control variables and instrumentals variables in a 2SLS model?
I am currently trying to solve a 2SLS problem.

I am trying to wrap my head around the use of control and instrumental variables in a 2SLS model. Could somebody please explain the use of these variables?

Further I have been tasked with the following questions: "Assume that you have both access to z (instrumental variable) and x2 (control variable) - how do these results compare?"

Is is possible to make a 2SLS model with only one of the variables? if yes, how do I do it?

Thanks!

I have already made my 2SLS model - but I am not sure if its correct.

The problem is the "How do these results compare" - How am I ment to test the different impact when using either or both the variables?


问:
WCF service is not working. What is the issue here?
I have below method in WCFHOST and its a console.

```<code>static void Main(string[] args)
        {
            Uri baseAddress = new Uri("http://localhost:8080");

            using (ServiceHost host = new ServiceHost(typeof(Service1),baseAddress))
            {
                // Enable metadata publishing.
                ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
                smb.HttpGetEnabled = true;
                smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
                host.Description.Behaviors.Add(smb);

                // Open the ServiceHost to start listening for messages. Since
                // no endpoints are explicitly configured, the runtime will create
                // one endpoint per base address for each service contract implemented
                // by the service.
                host.Open();

                Console.WriteLine("The service is ready at {0}", baseAddress);
                Console.WriteLine("Press <Enter> to stop the service.");
                Console.ReadLine();

                // Close the ServiceHost.
                host.Close();
            }
        }
</code>```

Below is my app.config

```<code><?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true">
    </serviceHostingEnvironment>
    <behaviors>
      <serviceBehaviors>
        <behavior name="mexBehaviour">
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service name="WcfService.Service1">
        <endpoint address="Service1" binding="webHttpBinding" contract="WcfService.IService1"></endpoint>
        <host>
          <baseAddresses>
            <!--<add baseAddress="http://localhost:8733/Design_Time_Addresses/WcfService/Service1/"/>-->
           <!--<add baseAddress="http://localhost:8080/"/>-->
            <!--<add baseAddress="net.tcp://localhost:8090/"/>-->
          </baseAddresses>
        </host>
      </service>

    </services>

  </system.serviceModel>
</configuration>
</code>```

After run the app when I put below URL on the browser. Nothing happening

```<code>http://localhost:8080/Service1.svc/GetWithInPremesisMembers?dateFrom=2021-04-08&dateTo=2021-04-08
</code>```

Whats the issue here?
This is working fine in IIS (When this hosted on server). I just want to debug the code from VS 2013.

Body:
I have below method in WCFHOST and its a console.

static void Main(string[] args)
        {
            Uri baseAddress = new Uri("http://localhost:8080");

            using (ServiceHost host = new ServiceHost(typeof(Service1),baseAddress))
            {
                // Enable metadata publishing.
                ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
                smb.HttpGetEnabled = true;
                smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
                host.Description.Behaviors.Add(smb);

                // Open the ServiceHost to start listening for messages. Since
                // no endpoints are explicitly configured, the runtime will create
                // one endpoint per base address for each service contract implemented
                // by the service.
                host.Open();

                Console.WriteLine("The service is ready at {0}", baseAddress);
                Console.WriteLine("Press <Enter> to stop the service.");
                Console.ReadLine();

                // Close the ServiceHost.
                host.Close();
            }
        }

Below is my app.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true">
    </serviceHostingEnvironment>
    <behaviors>
      <serviceBehaviors>
        <behavior name="mexBehaviour">
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service name="WcfService.Service1">
        <endpoint address="Service1" binding="webHttpBinding" contract="WcfService.IService1"></endpoint>
        <host>
          <baseAddresses>

          </baseAddresses>
        </host>
      </service>

    </services>

  </system.serviceModel>
</configuration>

After run the app when I put below URL on the browser. Nothing happening

http://localhost:8080/Service1.svc/GetWithInPremesisMembers?dateFrom=2021-04-08&dateTo=2021-04-08

Whats the issue here?
This is working fine in IIS (When this hosted on server). I just want to debug the code from VS 2013.


问:
What could be the problem with templating in Helmfile
I have a following Helmlife:

```<code>environments:
  {{ range $index,$item := readDirEntries "./environment" }}
    {{- if $item.IsDir -}}
    {{- $item.Name -}}
    {{- end -}}
  {{- end -}}

releases:
- name: system-{{ .Environment.Name }}
  createNamespace: true
  chart: ./charts/dsp-system
  namespace: system-{{ .Environment.Name }}
  values:
    - ./environment/{{ .Environment.Name }}/values.yaml
</code>```

However it outputs that some error occurs in the environments field, and error is connected with templating that I had done

Body:
I have a following Helmlife:

environments:
  {{ range $index,$item := readDirEntries "./environment" }}
    {{- if $item.IsDir -}}
    {{- $item.Name -}}
    {{- end -}}
  {{- end -}}

releases:
- name: system-{{ .Environment.Name }}
  createNamespace: true
  chart: ./charts/dsp-system
  namespace: system-{{ .Environment.Name }}
  values:
    - ./environment/{{ .Environment.Name }}/values.yaml

However it outputs that some error occurs in the environments field, and error is connected with templating that I had done


问:
How to pass parameter from dropdown to controller in spring
I try to pass a parameter from the view to the controller, but received the "Whiteble error page".

I follow the very simple solution that I have successfully implemented in another project, but I can't understand why it not working now.

HTML:

    <form action="/admin/block/execute" method="post">
        <select name="user" id=userId required>
            <option th:each="user: ${users}">
                <title th:text="${user}"/>
            </option>
        </select>

            <input class="w3-button w3-blue" type="submit" value="Start"/>

    </form>

```
<p>controller:</p>
<pre class="lang-java prettyprint-override"><code>@Controller
@RequestMapping("/admin/block")
@AllArgsConstructor
@Slf4j
public class AdminController {

    @RequestMapping(value = "/execute", method = RequestMethod.POST)
    public String executeParser(
            @RequestParam String user
    ){
        //this controller doesn't executed
        return "redirect:/admin/block";
    }
}
</code>```

After I successfully selected the value from the dropdown and pressed the button Start I received Whiteble page error - This application has no explicit mapping for /error, so you are seeing this as a fallback.

What I have missed?

Body:
I try to pass a parameter from the view to the controller, but received the "Whiteble error page".

I follow the very simple solution that I have successfully implemented in another project, but I can't understand why it not working now.

HTML:

    <form action="/admin/block/execute" method="post">
        <select name="user" id=userId required>
            <option th:each="user: ${users}">
                <title th:text="${user}"/>
            </option>
        </select>

            <input class="w3-button w3-blue" type="submit" value="Start"/>

    </form>

controller:

@Controller
@RequestMapping("/admin/block")
@AllArgsConstructor
@Slf4j
public class AdminController {

    @RequestMapping(value = "/execute", method = RequestMethod.POST)
    public String executeParser(
            @RequestParam String user
    ){
        //this controller doesn't executed
        return "redirect:/admin/block";
    }
}

After I successfully selected the value from the dropdown and pressed the button Start I received Whiteble page error - This application has no explicit mapping for /error, so you are seeing this as a fallback.

What I have missed?


问:
Offline mode is not working when the application is deployed in the cloud environment
We have deployed our Spartacus PWA application in the cloud envrionment and the deployed js storefront is working perfectly fine. But, the offline mode is not working. We have some pure angular routing pages (not communication with commerce) and we want to make these pages working in offline mode.

written new custom service worker to show custom offline fallback page

```<code>const OFFLINE_VERSION = 1;
const CACHE_NAME = 'offline';
// Customize this with a different URL if needed.
const OFFLINE_URL = '/assets/offline.html';

self.addEventListener('install', (event) => {
  event.waitUntil((async () => {
    const cache = await caches.open(CACHE_NAME);
    // Setting {cache: 'reload'} in the new request will ensure that the response
    // isn't fulfilled from the HTTP cache; i.e., it will be from the network.
    await cache.add(new Request(OFFLINE_URL, {cache: 'reload'}));
  })());
});

self.addEventListener('activate', (event) => {
  event.waitUntil((async () => {
    // Enable navigation preload if it's supported.
    // See https://developers.google.com/web/updates/2017/02/navigation-preload
    if ('navigationPreload' in self.registration) {
      await self.registration.navigationPreload.enable();
    }
  })());

  // Tell the active service worker to take control of the page immediately.
  self.clients.claim();
});

self.addEventListener('fetch', (event) => {
  // We only want to call event.respondWith() if this is a navigation request
  // for an HTML page.
  if (event.request.mode === 'navigate' && event.request.url.indexOf("smart") === -1
  && event.request.url.indexOf("item-details") === -1 && event.request.url.indexOf("ssitemscan") === -1
  && event.request.url.indexOf("shipto-items") === -1) {
    event.respondWith((async () => {
      try {
        // First, try to use the navigation preload response if it's supported.
        const preloadResponse = await event.preloadResponse;
        if (preloadResponse) {
          return preloadResponse;
        }

        const networkResponse = await fetch(event.request);
        return networkResponse;
      } catch (error) {
        // catch is only triggered if an exception is thrown, which is likely
        // due to a network error.
        // If fetch() returns a valid HTTP response with a response code in
        // the 4xx or 5xx range, the catch() will NOT be called.
        console.log('Fetch failed; returning offline page instead.', error);

        const cache = await caches.open(CACHE_NAME);
        const cachedResponse = await cache.match(OFFLINE_URL);
        return cachedResponse;
      }
    })());
  }

  // If our if() condition is false, then this fetch handler won't intercept the
  // request. If there are any other fetch handlers registered, they will get a
  // chance to call event.respondWith(). If no fetch handlers call
  // event.respondWith(), the request will be handled by the browser as if there
  // were no service worker involvement.
});
// use all the magic of the Angular Service Worker
importScripts('./ngsw-worker.js');
</code>```

registered in app module ts file

```<code> ServiceWorkerModule.register('custom-service-worker.js', {
      enabled: environment.production,
      // Register the ServiceWorker as soon as the app is stable
      // or after 30 seconds (whichever comes first).
      registrationStrategy: 'registerImmediately'
    }),
</code>```

ngsw-config.json

```<code>{
  "index": "/index.html",
  "assetGroups": [
    {
      "name": "app",
      "installMode": "prefetch",
      "resources": {
        "files": [
          "/favicon.ico",
          "/index.html",
          "/manifest.webmanifest",
          "/*.css",
          "/*.js",
          "/assets/offline.html"
        ],
        "urls": [
          "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css",
          "https://cdnjs.cloudflare.com/ajax/libs/prism/1.22.0/themes/prism.css",
          "https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
        ]
      }
    },
    {
      "name": "assets",
      "installMode": "lazy",
      "updateMode": "prefetch",
      "resources": {
        "files": [
          "/assets/**",
          "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
        ]
      }
    }
  ],
  "navigationUrls": [
    "/*/*/*/",
    "/*/*/*/scanner",
    "/*/*/*/smartstockscan",
    "/*/*/*/item-details",
    "/*/*/*/ssitemscan",
    "/*/*/*/shipto-items",
    "/*/*/*/edit-smartstock-item",
    "/*/*/*/smart-stock-cart",
    "/*/*/*/smart-stock-checkout",
    "/*/*/*/smart-stock-cart-list"
  ]
}
</code>```

The service worker is registered in browser correctly and also js and css are cached.

The custom offline page is working but other angular routes are not working, giving 504 error. Any help would be appreciated very much.

Body:
We have deployed our Spartacus PWA application in the cloud envrionment and the deployed js storefront is working perfectly fine. But, the offline mode is not working. We have some pure angular routing pages (not communication with commerce) and we want to make these pages working in offline mode.

written new custom service worker to show custom offline fallback page

const OFFLINE_VERSION = 1;
const CACHE_NAME = 'offline';
// Customize this with a different URL if needed.
const OFFLINE_URL = '/assets/offline.html';

self.addEventListener('install', (event) => {
  event.waitUntil((async () => {
    const cache = await caches.open(CACHE_NAME);
    // Setting {cache: 'reload'} in the new request will ensure that the response
    // isn't fulfilled from the HTTP cache; i.e., it will be from the network.
    await cache.add(new Request(OFFLINE_URL, {cache: 'reload'}));
  })());
});

self.addEventListener('activate', (event) => {
  event.waitUntil((async () => {
    // Enable navigation preload if it's supported.
    // See https://developers.google.com/web/updates/2017/02/navigation-preload
    if ('navigationPreload' in self.registration) {
      await self.registration.navigationPreload.enable();
    }
  })());

  // Tell the active service worker to take control of the page immediately.
  self.clients.claim();
});

self.addEventListener('fetch', (event) => {
  // We only want to call event.respondWith() if this is a navigation request
  // for an HTML page.
  if (event.request.mode === 'navigate' && event.request.url.indexOf("smart") === -1
  && event.request.url.indexOf("item-details") === -1 && event.request.url.indexOf("ssitemscan") === -1
  && event.request.url.indexOf("shipto-items") === -1) {
    event.respondWith((async () => {
      try {
        // First, try to use the navigation preload response if it's supported.
        const preloadResponse = await event.preloadResponse;
        if (preloadResponse) {
          return preloadResponse;
        }

        const networkResponse = await fetch(event.request);
        return networkResponse;
      } catch (error) {
        // catch is only triggered if an exception is thrown, which is likely
        // due to a network error.
        // If fetch() returns a valid HTTP response with a response code in
        // the 4xx or 5xx range, the catch() will NOT be called.
        console.log('Fetch failed; returning offline page instead.', error);

        const cache = await caches.open(CACHE_NAME);
        const cachedResponse = await cache.match(OFFLINE_URL);
        return cachedResponse;
      }
    })());
  }

  // If our if() condition is false, then this fetch handler won't intercept the
  // request. If there are any other fetch handlers registered, they will get a
  // chance to call event.respondWith(). If no fetch handlers call
  // event.respondWith(), the request will be handled by the browser as if there
  // were no service worker involvement.
});
// use all the magic of the Angular Service Worker
importScripts('./ngsw-worker.js');

registered in app module ts file

 ServiceWorkerModule.register('custom-service-worker.js', {
      enabled: environment.production,
      // Register the ServiceWorker as soon as the app is stable
      // or after 30 seconds (whichever comes first).
      registrationStrategy: 'registerImmediately'
    }),

ngsw-config.json

{
  "index": "/index.html",
  "assetGroups": [
    {
      "name": "app",
      "installMode": "prefetch",
      "resources": {
        "files": [
          "/favicon.ico",
          "/index.html",
          "/manifest.webmanifest",
          "/*.css",
          "/*.js",
          "/assets/offline.html"
        ],
        "urls": [
          "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css",
          "https://cdnjs.cloudflare.com/ajax/libs/prism/1.22.0/themes/prism.css",
          "https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
        ]
      }
    },
    {
      "name": "assets",
      "installMode": "lazy",
      "updateMode": "prefetch",
      "resources": {
        "files": [
          "/assets/**",
          "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
        ]
      }
    }
  ],
  "navigationUrls": [
    "/*/*/*/",
    "/*/*/*/scanner",
    "/*/*/*/smartstockscan",
    "/*/*/*/item-details",
    "/*/*/*/ssitemscan",
    "/*/*/*/shipto-items",
    "/*/*/*/edit-smartstock-item",
    "/*/*/*/smart-stock-cart",
    "/*/*/*/smart-stock-checkout",
    "/*/*/*/smart-stock-cart-list"
  ]
}

The service worker is registered in browser correctly and also js and css are cached.

The custom offline page is working but other angular routes are not working, giving 504 error. Any help would be appreciated very much.


问:
Caliburn Micro passing data with the EventAggragator and opening time of Views
I read a file on disc in one ViewModel and at the end i send the data to another Viewmodel via the EventAggregator.
When i switch to the View of the other Viewmodel (with ActivateItemAsync) it takes 10 seconds before the View opens !  The data consist of an ObservableCollection of some 80000 strings.In this 10 seconds the CPU usage is at 25%. What is happening in these 10 seconds ?

If i send only the filename to the other ViewModel and reread the file in the OnActivate method, the View opens in 2 seconds !

And what's the difference between Conductor<Screen> and Conductor<Screen>.Collection.OneActive ?

I got a ShellVieModel : Conductor and all other ViewModels : Screen

```<code> public async void ReadNCfile()
    {
        LinesNC.Clear();
        await Task.Run(() =>
        {
            Regex regexline = new Regex(@"^N[0-9]+");

            int i = 1;
            foreach (var rawline in File.ReadLines(SelectedNCItem))
            {
                LineNCFile line = new LineNCFile();
                line.Index = i;
                line.NCLine = rawline;

                Match match = regexline.Match(rawline);
                if (match.Success)
                {
                    int number;
                    bool success = (Int32.TryParse((match.Value).Substring(1), out number));
                    if (success) line.LineNumber = number;

                }

                Application.Current.Dispatcher.Invoke(() =>
                {
                    LinesNC.Add(line);
                });
                i++;
            }
        });

        _eventAggregator.PublishOnUIThreadAsync(new NCFileChosenEvent(LinesNC));
    }
</code>```

Body:
I read a file on disc in one ViewModel and at the end i send the data to another Viewmodel via the EventAggregator.
When i switch to the View of the other Viewmodel (with ActivateItemAsync) it takes 10 seconds before the View opens !  The data consist of an ObservableCollection of some 80000 strings.In this 10 seconds the CPU usage is at 25%. What is happening in these 10 seconds ?

If i send only the filename to the other ViewModel and reread the file in the OnActivate method, the View opens in 2 seconds !

And what's the difference between Conductor<Screen> and Conductor<Screen>.Collection.OneActive ?

I got a ShellVieModel : Conductor and all other ViewModels : Screen

 public async void ReadNCfile()
    {
        LinesNC.Clear();
        await Task.Run(() =>
        {
            Regex regexline = new Regex(@"^N[0-9]+");

            int i = 1;
            foreach (var rawline in File.ReadLines(SelectedNCItem))
            {
                LineNCFile line = new LineNCFile();
                line.Index = i;
                line.NCLine = rawline;

                Match match = regexline.Match(rawline);
                if (match.Success)
                {
                    int number;
                    bool success = (Int32.TryParse((match.Value).Substring(1), out number));
                    if (success) line.LineNumber = number;

                }

                Application.Current.Dispatcher.Invoke(() =>
                {
                    LinesNC.Add(line);
                });
                i++;
            }
        });

        _eventAggregator.PublishOnUIThreadAsync(new NCFileChosenEvent(LinesNC));
    }


问:
streaming dataframe compression
I have a streaming dataframe, which is created using Json files in S3.

ds = (spark.readStream
      .schema(JSONschema)
      .format("json")
      .option("maxFilesPerTrigger", 1)
      .load("/mnt/raj-zuk-comparis-poc/messages*.json"))

print(ds.isStreaming) #check that a dataframe is streaming
```

This df will contain 1 or more than 1 row for same property with different details .

I need to combine all rows into 1 row for each property and save it.

Input data

I tried writing the streaming df into  query and then use sql to group by . But then i can't write that df as a streaming output

Title: streaming dataframe compression

Body:
I have a streaming dataframe, which is created using Json files in S3.

ds = (spark.readStream
      .schema(JSONschema)
      .format("json")
      .option("maxFilesPerTrigger", 1)
      .load("/mnt/raj-zuk-comparis-poc/messages*.json"))

print(ds.isStreaming) #check that a dataframe is streaming

This df will contain 1 or more than 1 row for same property with different details .

I need to combine all rows into 1 row for each property and save it.

Input data

I tried writing the streaming df into  query and then use sql to group by . But then i can't write that df as a streaming output


问:
OperationalError sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) table user has no column named Uname
i'm making a signup page in flask using a sqlalchemy database where the user inputs his information and than gets directed to the main page, but i'm getting the error listed in the title of my question.

The code below are from 2 different files, the first codeblock is a part of my models.py file and the rest is the entire code from my auth.py file.

here is the code:

```<code>class user(db.Model, UserMixin):
    id = db.Column(db.Integer, primary_key = True)
    Uname = db.Column(db.String(150), unique = True)
    Fname = db.Column(db.String(150))
    Sname = db.Column(db.String(150))
    bday = db.Column(db.Date)
    Email = db.Column(db.String(150), unique = True)
    Password = db.Column(db.String(150))
    notes = db.relationship('Note')
</code>```
```<code>from flask import Blueprint, render_template, request, flash, redirect, url_for
from .models import user
from werkzeug.security import generate_password_hash, check_password_hash
from . import db

auth = Blueprint('auth', __name__)

# create route to login page and handle POST , GET requests
@auth.route("/login", methods=["POST", "GET"])
def login():
    if request.method == "POST":
        Uname = request.form.get("Uname")
        Password = request.form.get("Password")

    return render_template("login.html")

# create route to Signup page and handle POST , GET requests
@auth.route('/Signup', methods=["POST", "GET"])
def logout():
    if request.method == "POST":
        Uname = request.form.get("Uname")
        Fname = request.form.get("Fname")
        Sname = request.form.get("Sname")
        bday = request.form.get("bday")
        Email = request.form.get("Email")
        Password = request.form.get("Password")
        ConPassword = request.form.get("ConPassword")

        # signup conditions...
        if len(Fname) < 2:
            flash("Your name is to short", category='error')
        elif Password != ConPassword:
            flash("Your Confirmation Password does not match", category='error')
        elif len(Password) <5:
            flash("Your Password is to short", category='error')
        else:
            new_user = user(Uname=Uname, Fname=Fname, Sname=Sname, bday=bday, Email=Email, Password=generate_password_hash(Password, method='sha256'))
            db.session.add(new_user)
            db.session.commit()
            flash("account created!", category='Succes')
            return redirect(url_for('views.home'))

    return render_template("signup.html")

@auth.route('/Logout')
def signup():
    pass
</code>```

Body:
i'm making a signup page in flask using a sqlalchemy database where the user inputs his information and than gets directed to the main page, but i'm getting the error listed in the title of my question.

The code below are from 2 different files, the first codeblock is a part of my models.py file and the rest is the entire code from my auth.py file.

here is the code:

class user(db.Model, UserMixin):
    id = db.Column(db.Integer, primary_key = True)
    Uname = db.Column(db.String(150), unique = True)
    Fname = db.Column(db.String(150))
    Sname = db.Column(db.String(150))
    bday = db.Column(db.Date)
    Email = db.Column(db.String(150), unique = True)
    Password = db.Column(db.String(150))
    notes = db.relationship('Note')

from flask import Blueprint, render_template, request, flash, redirect, url_for
from .models import user
from werkzeug.security import generate_password_hash, check_password_hash
from . import db

auth = Blueprint('auth', __name__)

# create route to login page and handle POST , GET requests
@auth.route("/login", methods=["POST", "GET"])
def login():
    if request.method == "POST":
        Uname = request.form.get("Uname")
        Password = request.form.get("Password")

    return render_template("login.html")

# create route to Signup page and handle POST , GET requests
@auth.route('/Signup', methods=["POST", "GET"])
def logout():
    if request.method == "POST":
        Uname = request.form.get("Uname")
        Fname = request.form.get("Fname")
        Sname = request.form.get("Sname")
        bday = request.form.get("bday")
        Email = request.form.get("Email")
        Password = request.form.get("Password")
        ConPassword = request.form.get("ConPassword")

        # signup conditions...
        if len(Fname) < 2:
            flash("Your name is to short", category='error')
        elif Password != ConPassword:
            flash("Your Confirmation Password does not match", category='error')
        elif len(Password) <5:
            flash("Your Password is to short", category='error')
        else:
            new_user = user(Uname=Uname, Fname=Fname, Sname=Sname, bday=bday, Email=Email, Password=generate_password_hash(Password, method='sha256'))
            db.session.add(new_user)
            db.session.commit()
            flash("account created!", category='Succes')
            return redirect(url_for('views.home'))

    return render_template("signup.html")

@auth.route('/Logout')
def signup():
    pass


问:
How do I configure a Drive UI integration if my app uses only "Create With" menu (no Open With)?
In the documentation "Configure a Drive UI integration", item 9 suggests an optional configuration for "Open with":

If you want users to use the Drive UI's "Open with" context menu item, enter a URL to your app in the Open URL field. This URL is used by the "Open With" context menu item.

However, in the configuration panel, it's compulsory:

My app won't support opening PDF file. How do I publish a Drive UI app to the Marketplace that only has "Create" option?


问:
No such file or directory when creating UDF in TDengine
I created a scalar User-Defined-Function according the document of TDengine.

```<code>CREATE FUNCTION bit_and AS "/usr/lib/libbitand.so" OUTPUTTYPE INT;
</code>```

It reported an error:

No such file or directory

I checked the path, and it is correct. I don't know what the problem is.

enter image description here

Body:
I created a scalar User-Defined-Function according the document of TDengine.

CREATE FUNCTION bit_and AS "/usr/lib/libbitand.so" OUTPUTTYPE INT;

It reported an error:

No such file or directory

I checked the path, and it is correct. I don't know what the problem is.

enter image description here


问:
ADFS Authentication in flutter application
I have a requirement to authenticate my flutter application from ADFS. I tried the ADAL package (https://pub.dev/documentation/flutteradal/latest/) but it doesn't seem to be fulfilling my needs. I don't have a lot of experience with server side programming or Microsoft services. Any help in making me understand how the ADFS authentication works would be life saving for me right now. I would really appreciate a step by step guide to ADFS authentication in flutter application.</p>


问:
How do I sort the files by name?
Can NiFi sort the retrieved files by filename?

I'm trying to use the EnforceOrder processor but cannot figure this out.
There are no questions in this forum on something as basic as 'sort by filename' 'sort by file name'.

I'm using a GetFile to pull in *.json files.
I'm just looking into how to do some basic things such as sort by name, if filename contains a date then sort by that file name converted to a date, sort by actual date of file, group by regexp and then sort etc.

Update
I've tried to use the "UpdateAttribute" to carry through the file name and specify that as the initial order but that is invalid as it is not a number.

I've tried to also use the file.lastModifiedTime in the Initial Order but that fails too.

How do you sort the files by their name?

Title: How do I sort the files by name?