问:
Prevent form from resubmitting after button click
I have a Django project where I have a few forms. What is happening is when I click button submit 30 times, my data is inserted 30 times in the database. I did my research and I saw lots of jquery or javascript solutions in general but I am not familiar much with them so I am trying to find a more pythonic/django solution.
The frontend solution that works for me was:

```<code><script type="text/javascript">
    var form = document.getElementById('post_form');
    var submitButton = document.getElementById('submit');
    form.addEventListener('submit', function () {
        submitButton.setAttribute('disabled', 'disabled');
        submitButton.value = 'Please wait...';
    }, false);
</script>
</code>```

Here is my code now and I was hoping to find some way to make it work without the above:

views:

```<code>@method_decorator(login_required(login_url='index', redirect_field_name=None), name='dispatch')
class CreatePostView(views.FormView):
    model = Post
    form_class = CreatePostForm
    template_name = 'posts/create_post.html'

    def form_valid(self, form):
        post = form.save(commit=False)
        post.user = self.request.user
        post.save()
        return redirect('index')

</code>```

template:

```<code><form action="{% url 'create post' %}" method="POST" enctype="multipart/form-data">
    {{ form.as_p }}
    {% csrf_token %}
    <p>
        <button type="submit" class="btn btn-secondary">Submit</button>
    </p>
</form>
</code>```

model:

```<code>class Post(models.Model):
    MAX_TITLE_LENGTH = 20
    MIN_TITLE_LENGTH = 3
    MAX_DESTINATION_LENGTH = 30
    MIN_DESTINATION_LENGTH = 3
    MAX_DESCRIPTION_LENGTH = 550
    MIN_DESCRIPTION_LENGTH = 5

    title = models.CharField(
        max_length=MAX_TITLE_LENGTH,
        validators=(MinLengthValidator(MIN_TITLE_LENGTH), name_and_title_validator),
        error_messages={
            'max_length': f'Post title must be a maximum of {MAX_TITLE_LENGTH} characters.',
            'min_length': f'Post title must be at least {MIN_TITLE_LENGTH} characters long.',
        },
        null=False,
        blank=False,
    )

    photo = CloudinaryField(
        folder='mediafiles/post_photos',
        public_id=get_photo_name_by_post_name,
        null=False,
        blank=False,
    )

    destination = models.CharField(
        max_length=MAX_DESTINATION_LENGTH,
        validators=(MinLengthValidator(MIN_DESTINATION_LENGTH), ),
        error_messages={
            'max_length': f'Destination must be a maximum of {MAX_DESTINATION_LENGTH} characters.',
            'min_length': f'Destination must be at least {MIN_DESTINATION_LENGTH} characters long.',
        },
        null=False,
        blank=False,
    )

    description = models.CharField(
        max_length=MAX_DESCRIPTION_LENGTH,
        validators=(MinLengthValidator(MIN_DESCRIPTION_LENGTH), ),
        error_messages={
            'max_length': f'Description must be a maximum of {MAX_DESCRIPTION_LENGTH} characters.',
            'min_length': f'Description must be at least {MIN_DESCRIPTION_LENGTH} characters long.',
        },
        null=False,
        blank=False,
    )

    category = models.ForeignKey(
        PostCategory,
        on_delete=models.CASCADE,
        default='',
        null=False,
        blank=False,
    )

    user = models.ForeignKey(
        UserModel,
        on_delete=models.CASCADE,
        null=False,
        blank=True,
    )

    def __str__(self):
        return self.title

</code>```

form:

```<code>class CreatePostForm(AddPlaceholdersFormMixin, RemoveLabelsFormMixin, AddStyleClassFormMixin, forms.ModelForm):
    class Meta:
        model = Post
        exclude = ('user', )
        labels = {
            'category': 'CHOOSE A CONTINENT',
        }

        widgets = {
            'description': forms.Textarea(),
        }
</code>```

I tried redirecting after form.save() and it is successful but it doesn't solve my issue about resubmit. I had another problem with resubmission on refresh and I solved it with sessions but here I am not sure how to do it. I have to say again that I understand there is a frontend javascript solution but I want to know if it can be done on the server side rather than the client's.

Body:
I have a Django project where I have a few forms. What is happening is when I click button submit 30 times, my data is inserted 30 times in the database. I did my research and I saw lots of jquery or javascript solutions in general but I am not familiar much with them so I am trying to find a more pythonic/django solution.
The frontend solution that works for me was:

Here is my code now and I was hoping to find some way to make it work without the above:

views:

@method_decorator(login_required(login_url='index', redirect_field_name=None), name='dispatch')
class CreatePostView(views.FormView):
    model = Post
    form_class = CreatePostForm
    template_name = 'posts/create_post.html'

    def form_valid(self, form):
        post = form.save(commit=False)
        post.user = self.request.user
        post.save()
        return redirect('index')

template:

<form action="{% url 'create post' %}" method="POST" enctype="multipart/form-data">
    {{ form.as_p }}
    {% csrf_token %}

        <button type="submit" class="btn btn-secondary">Submit</button>

</form>

model:

class Post(models.Model):
    MAX_TITLE_LENGTH = 20
    MIN_TITLE_LENGTH = 3
    MAX_DESTINATION_LENGTH = 30
    MIN_DESTINATION_LENGTH = 3
    MAX_DESCRIPTION_LENGTH = 550
    MIN_DESCRIPTION_LENGTH = 5

    title = models.CharField(
        max_length=MAX_TITLE_LENGTH,
        validators=(MinLengthValidator(MIN_TITLE_LENGTH), name_and_title_validator),
        error_messages={
            'max_length': f'Post title must be a maximum of {MAX_TITLE_LENGTH} characters.',
            'min_length': f'Post title must be at least {MIN_TITLE_LENGTH} characters long.',
        },
        null=False,
        blank=False,
    )

    photo = CloudinaryField(
        folder='mediafiles/post_photos',
        public_id=get_photo_name_by_post_name,
        null=False,
        blank=False,
    )

    destination = models.CharField(
        max_length=MAX_DESTINATION_LENGTH,
        validators=(MinLengthValidator(MIN_DESTINATION_LENGTH), ),
        error_messages={
            'max_length': f'Destination must be a maximum of {MAX_DESTINATION_LENGTH} characters.',
            'min_length': f'Destination must be at least {MIN_DESTINATION_LENGTH} characters long.',
        },
        null=False,
        blank=False,
    )

    description = models.CharField(
        max_length=MAX_DESCRIPTION_LENGTH,
        validators=(MinLengthValidator(MIN_DESCRIPTION_LENGTH), ),
        error_messages={
            'max_length': f'Description must be a maximum of {MAX_DESCRIPTION_LENGTH} characters.',
            'min_length': f'Description must be at least {MIN_DESCRIPTION_LENGTH} characters long.',
        },
        null=False,
        blank=False,
    )

    category = models.ForeignKey(
        PostCategory,
        on_delete=models.CASCADE,
        default='',
        null=False,
        blank=False,
    )

    user = models.ForeignKey(
        UserModel,
        on_delete=models.CASCADE,
        null=False,
        blank=True,
    )

    def __str__(self):
        return self.title

form:

class CreatePostForm(AddPlaceholdersFormMixin, RemoveLabelsFormMixin, AddStyleClassFormMixin, forms.ModelForm):
    class Meta:
        model = Post
        exclude = ('user', )
        labels = {
            'category': 'CHOOSE A CONTINENT',
        }

        widgets = {
            'description': forms.Textarea(),
        }

I tried redirecting after form.save() and it is successful but it doesn't solve my issue about resubmit. I had another problem with resubmission on refresh and I solved it with sessions but here I am not sure how to do it. I have to say again that I understand there is a frontend javascript solution but I want to know if it can be done on the server side rather than the client's.


来源: stackexchange

问:
extendedChoice in jenkins is not populating from properties file
I am using the plugin Extended Choice and jenkins version 2.303.1. I am planning on using the .properties file to populate the parameter but it wont do it.
Don't know if I am missing something. Might be good to add that I am using gerrit to fetch everything from.

part of jenkinsfile

```<code>script {
properties([
    parameters([
        extendedChoice(name:"test-property",
        description:"test1 desc",
        type: "PT_CHECKBOX",
        propertyFile: "${env.WORKSPACE}/prop.properties",
        propertyKey: "test")
    ])
])
</code>```

}

Property file

```<code>test=test1,test2,test3,test4
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I am using the plugin Extended Choice and jenkins version 2.303.1. I am planning on using the .properties file to populate the parameter but it wont do it.
Don't know if I am missing something. Might be good to add that I am using gerrit to fetch everything from.

part of jenkinsfile

script {
properties([
    parameters([
        extendedChoice(name:"test-property",
        description:"test1 desc",
        type: "PT_CHECKBOX",
        propertyFile: "${env.WORKSPACE}/prop.properties",
        propertyKey: "test")
    ])
])

}

Property file

test=test1,test2,test3,test4


问:
Is it possible to configure Azure Machine Learning deployed inference container to use a Kubernetes persistent volume?
I have a real time inference container (Real-time inference endpoint deployed with a custom Docker Environment) and I would need it to have access to a persistent volume claim.

The inference container is deployed to an AKS cluster using the AML SDK v1:

```<code>from azureml.core.model import Model
Model.deploy()
</code>```

I have tried to configure the Kubernetes cluster to have a PV and a PVC according to the instructions here.

The labels and annotations for the PVC are in place but the volume is not visible in the container. I have also checked that the pods are in the same namespace with the PVC.

I just noticed that the instruction seems to be under the SDK v2 section and now I'm wondering if it only works with that. Does anyone know if I just have to change to the v2 or should it work like this with v1 also? Or is there something else I'm missing?

Body:
I have a real time inference container (Real-time inference endpoint deployed with a custom Docker Environment) and I would need it to have access to a persistent volume claim.

The inference container is deployed to an AKS cluster using the AML SDK v1:

from azureml.core.model import Model
Model.deploy()

I have tried to configure the Kubernetes cluster to have a PV and a PVC according to the instructions here.

The labels and annotations for the PVC are in place but the volume is not visible in the container. I have also checked that the pods are in the same namespace with the PVC.

I just noticed that the instruction seems to be under the SDK v2 section and now I'm wondering if it only works with that. Does anyone know if I just have to change to the v2 or should it work like this with v1 also? Or is there something else I'm missing?


问:
Filter data in table using DAX Query to only get values from previous month
I'm using DAX to filter out some data in power bi. I'm trying to figure out a query to only retrieve data from the previous month. I've added a date table which consist of month and year column.

Query generated by power bi that is unfiltered:

```<code>DEFINE VAR __DS0Core =
  SUMMARIZE(
    'Usage details amortized',
    'Usage details amortized'[Tags - Copy.DepartmentNumber],
    'Usage details amortized'[Tags - Copy.OwnerEmail],
    'Usage details amortized'[Cost],
    'Usage details amortized'[Date]
  )

EVALUATE
  __DS0Core

ORDER BY
  'Usage details amortized'[Tags - Copy.DepartmentNumber],
  'Usage details amortized'[Tags - Copy.OwnerEmail],
  'Usage details amortized'[Cost],
  'Usage details amortized'[Date]
</code>```

Body:
I'm using DAX to filter out some data in power bi. I'm trying to figure out a query to only retrieve data from the previous month. I've added a date table which consist of month and year column.

Query generated by power bi that is unfiltered:

DEFINE VAR __DS0Core =
  SUMMARIZE(
    'Usage details amortized',
    'Usage details amortized'[Tags - Copy.DepartmentNumber],
    'Usage details amortized'[Tags - Copy.OwnerEmail],
    'Usage details amortized'[Cost],
    'Usage details amortized'[Date]
  )

EVALUATE
  __DS0Core

ORDER BY
  'Usage details amortized'[Tags - Copy.DepartmentNumber],
  'Usage details amortized'[Tags - Copy.OwnerEmail],
  'Usage details amortized'[Cost],
  'Usage details amortized'[Date]


问:
CSS emulate prefer color scheme command does not work for chrome extension added in dev tool panel
Chrome Version 108.0.5359.99 (Official Build) (64-bit)

Windows Windows 11 Pro Build 22000.1219

Chrome Dev Tools Run > Emulate CSS prefres-color-scheme

built a chrome extension which have a feature to change the theme of it's own panel by running Run > Emulate CSS prefres-color-scheme command from the chrome dev tools , it was working fine earlier but now stopped working with latest chrome but works only when we open inspect of devtools and then run the same command

is it changed in recent chrome version update?

below is the relevant code

panel.html

```<code><head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="color-scheme" content="dark light">
  <meta name="supported-color-schemes" content="dark light">
  <title>Tagging Panel</title>
  <link type="text/css" rel="stylesheet" href="../styles/light.css"
    media="(prefers-color-scheme: no-preference),(prefers-color-scheme: light)">
  <link type="text/css" rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)">
  <link type="text/css" rel="stylesheet" href="../styles/style.css">
</head>

</code>```

and here is video for the issue: https://imgur.com/gallery/HAsMAeW

Kindly check

Body:
Chrome Version 108.0.5359.99 (Official Build) (64-bit)

Windows Windows 11 Pro Build 22000.1219

Chrome Dev Tools Run > Emulate CSS prefres-color-scheme

built a chrome extension which have a feature to change the theme of it's own panel by running Run > Emulate CSS prefres-color-scheme command from the chrome dev tools , it was working fine earlier but now stopped working with latest chrome but works only when we open inspect of devtools and then run the same command

is it changed in recent chrome version update?

below is the relevant code

panel.html

  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="color-scheme" content="dark light">
  <meta name="supported-color-schemes" content="dark light">
  <title>Tagging Panel</title>
  <link type="text/css" rel="stylesheet" href="../styles/light.css"
    media="(prefers-color-scheme: no-preference),(prefers-color-scheme: light)">
  <link type="text/css" rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)">
  <link type="text/css" rel="stylesheet" href="../styles/style.css">

and here is video for the issue: https://imgur.com/gallery/HAsMAeW

Kindly check


问:
Modifying vtu files that are linked to pvtu files
I have a bunch of *pvtu files where each of them has ~200 *vtu files linked. I need to do some post-processing where I will be adding and deleting point data for variables. As of now, I do it by reading the files through pyvista and do the post-processing and save them as single *vtu files. Is there a way I can do the saving in *pvtu format so that I can take advantage of the parallel processing?</p>


问:
JAVASCRIPT Reload a page or a div using JS
I have an intranet site (no Internet) built on HTML/CSS/JS where a bunch of info is displayed for employers. The data changes weekly. The intranet was built and elaborated on this: https://www.w3schools.com/howto/howto_js_vertical_tabs.asp
The problem is that when users to the page they don't see updated info, as the browser loads from cache. After ctrl-f5 all good of course. However, I would like to solve this in a more systematic way.

I've read quite a few posts here and outside, but they don't work for me. For instance, I have this code in JS:

```<code>let reloaded = false;
const ctrlF5 = function(){
  const dateNow = parseInt(Date.now());
  const lastDateTime = localStorage.getItem('lastDatetime');
  if (dateNow > parseInt(lastDateTime) || lastDateTime === null) {
    if (!reloaded) {
    // Set the flag to true to prevent the page from being reloaded again
      reloaded = true;
      location.reload();
    }
  }
  localStorage.setItem('lastDatetime', parseInt(Date.now()));
}
window.onload = () => {
  ctrlF5();
}
</code>```

The problem is that when the user clicks on the button, the page starts flickering rapidly until the stop button on the browser is pressed. Also the page never updates. The reason behind the onclick event listener on the button is because I'd like to refresh the related div only, but I haven't gotten that far yet, work in progress. If the function is run when the page loads the result is the same.
If instead of location.reload(); I use window.location.href = window.location.href the result is the same.
How to reload the page (not just refresh) using JS? Possibly no Jquery.

UPDATE: I notice that when the page flickers the value in the localStorage keeps changing/increasing, so it means that the page is being loaded continuously until user stops it. Why this happens I have no idea.

Body:
I have an intranet site (no Internet) built on HTML/CSS/JS where a bunch of info is displayed for employers. The data changes weekly. The intranet was built and elaborated on this: https://www.w3schools.com/howto/howto_js_vertical_tabs.asp
The problem is that when users to the page they don't see updated info, as the browser loads from cache. After ctrl-f5 all good of course. However, I would like to solve this in a more systematic way.

I've read quite a few posts here and outside, but they don't work for me. For instance, I have this code in JS:

let reloaded = false;
const ctrlF5 = function(){
  const dateNow = parseInt(Date.now());
  const lastDateTime = localStorage.getItem('lastDatetime');
  if (dateNow > parseInt(lastDateTime) || lastDateTime === null) {
    if (!reloaded) {
    // Set the flag to true to prevent the page from being reloaded again
      reloaded = true;
      location.reload();
    }
  }
  localStorage.setItem('lastDatetime', parseInt(Date.now()));
}
window.onload = () => {
  ctrlF5();
}

The problem is that when the user clicks on the button, the page starts flickering rapidly until the stop button on the browser is pressed. Also the page never updates. The reason behind the onclick event listener on the button is because I'd like to refresh the related div only, but I haven't gotten that far yet, work in progress. If the function is run when the page loads the result is the same.
If instead of location.reload(); I use window.location.href = window.location.href the result is the same.
How to reload the page (not just refresh) using JS? Possibly no Jquery.

UPDATE: I notice that when the page flickers the value in the localStorage keeps changing/increasing, so it means that the page is being loaded continuously until user stops it. Why this happens I have no idea.


问:
Matlab crashing with Internal error fault on using simulink library
I am using the MATLAB 2015a version from last 1 year but suddenly i am encountering this issue . That whenever I open my simulink I get this error of access violation.

I have tried to Reinstall it but still my problem persists. Even updating my graphic driver to latest one but that doesn't work for me.


问:
Sending UDP message using ESP32
This is my first time with wireless networking so I'm sure I'm doing something dumb, but I have been banging my head against the wall during 2 weeks and can't seem to get this up and running.

I'm trying to send a message from my ESP32 to my server any time it wakes up. It should be easy, but i'm completely frustrated. For testing in my house, I'm using UDP Monitor app on my phone, this app aparently let you receive and send UDP messages, but after trying all my best i cant recive any message on my phone. I'm also using wireshark to look if the packet is getting send properly but the packet didn't appear on wireshark. I've try to use as udpAdress 255.255.255.255 and the udpAdress with the IP of the device I want to send to. I've try to send different types of packet. I've try to use different ports. I've try to use different libraries and i've try all the tutorials i've seen on internet and nothing happens. So It would be amazing if anyone can help with this.

This is the last code i try :

```<code>#include <WiFi.h>
#include <WiFiUdp.h>
#define BUTTON_PIN_BITMASK 0x200002000

const char* ssid = "*****";
const char* password = "*****";

/*const char* ssid = "*****";
const char* password = "*****";*/

WiFiUDP udp;
const char * udpAddress = "255.255.255.255";
const int udpPort = 3333;

int MY_PIN = 13;
int MY_PIN2 = 33;
int MY_PIN3 = 15;

RTC_DATA_ATTR int bootCount = 0;

void setup(){
    Serial.begin(115200);
    ++bootCount;
    Serial.println("Boot number: " + String(bootCount));

    pinMode(MY_PIN, INPUT_PULLUP);
    pinMode(MY_PIN2, INPUT_PULLUP);
    pinMode(MY_PIN3, OUTPUT);
    digitalWrite(MY_PIN3, HIGH);

    Serial.println("Booting");
    WiFi.mode(WIFI_STA);
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) {
      delay(500);
      Serial.print(".");
    }
    Serial.println("Connected to wifi");

    Serial.println("Ready");
    Serial.print("IP address: ");
    Serial.println(WiFi.localIP());

    udp.begin(udpPort);
    Serial.println(udp.remotePort());
    Serial.println(udp.remoteIP());
    uint8_t message[50] = "hello world";
    udp.beginPacket(udpAddress, udpPort);
    udp.write(message,11);
    udp.endPacket();
    Serial.println("UDP send to: ");
    Serial.println(udp.remoteIP());
    Serial.println(udp.remotePort());
    Serial.println("          ");
    Serial.println(WiFi.localIP());
    delay(500);

    int reading = digitalRead(MY_PIN);
    int reading2 = digitalRead(MY_PIN2);

    if(reading == 1 ||reading2 == 1) {
        esp_sleep_enable_ext1_wakeup(BUTTON_PIN_BITMASK,ESP_EXT1_WAKEUP_ALL_LOW);;
    }
    else {
        esp_sleep_enable_ext1_wakeup(BUTTON_PIN_BITMASK,ESP_EXT1_WAKEUP_ANY_HIGH);;
    }

    Serial.println("Going to sleep now");

    esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH,   ESP_PD_OPTION_OFF);
    esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_SLOW_MEM, ESP_PD_OPTION_OFF);
    esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_FAST_MEM, ESP_PD_OPTION_OFF);
    esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL,         ESP_PD_OPTION_OFF);
    esp_sleep_pd_config(ESP_PD_DOMAIN_MAX,          ESP_PD_OPTION_OFF);
    esp_deep_sleep_start();

    Serial.println("check_sleep");
}

void loop(){
  Serial.println("check_sleep2");
}
</code>```

The UDP part was extracted from a tutorial and a little bit modified. I've also try to use udp.printf or udp.broadcastto sentences and i can't even send the packet. Why isn't working? What am I missing? Any orientation is welcomed. Thank you for your time and assistance.

Title: Sending UDP message using ESP32

Body:
This is my first time with wireless networking so I'm sure I'm doing something dumb, but I have been banging my head against the wall during 2 weeks and can't seem to get this up and running.

I'm trying to send a message from my ESP32 to my server any time it wakes up. It should be easy, but i'm completely frustrated. For testing in my house, I'm using UDP Monitor app on my phone, this app aparently let you receive and send UDP messages, but after trying all my best i cant recive any message on my phone. I'm also using wireshark to look if the packet is getting send properly but the packet didn't appear on wireshark. I've try to use as udpAdress 255.255.255.255 and the udpAdress with the IP of the device I want to send to. I've try to send different types of packet. I've try to use different ports. I've try to use different libraries and i've try all the tutorials i've seen on internet and nothing happens. So It would be amazing if anyone can help with this.

This is the last code i try :

#include <WiFi.h>
#include <WiFiUdp.h>
#define BUTTON_PIN_BITMASK 0x200002000

const char* ssid = "*****";
const char* password = "*****";

/*const char* ssid = "*****";
const char* password = "*****";*/

WiFiUDP udp;
const char * udpAddress = "255.255.255.255";
const int udpPort = 3333;

int MY_PIN = 13;
int MY_PIN2 = 33;
int MY_PIN3 = 15;

RTC_DATA_ATTR int bootCount = 0;

void setup(){
    Serial.begin(115200);
    ++bootCount;
    Serial.println("Boot number: " + String(bootCount));

    pinMode(MY_PIN, INPUT_PULLUP);
    pinMode(MY_PIN2, INPUT_PULLUP);
    pinMode(MY_PIN3, OUTPUT);
    digitalWrite(MY_PIN3, HIGH);

    Serial.println("Booting");
    WiFi.mode(WIFI_STA);
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) {
      delay(500);
      Serial.print(".");
    }
    Serial.println("Connected to wifi");

    Serial.println("Ready");
    Serial.print("IP address: ");
    Serial.println(WiFi.localIP());

    udp.begin(udpPort);
    Serial.println(udp.remotePort());
    Serial.println(udp.remoteIP());
    uint8_t message[50] = "hello world";
    udp.beginPacket(udpAddress, udpPort);
    udp.write(message,11);
    udp.endPacket();
    Serial.println("UDP send to: ");
    Serial.println(udp.remoteIP());
    Serial.println(udp.remotePort());
    Serial.println("          ");
    Serial.println(WiFi.localIP());
    delay(500);

    int reading = digitalRead(MY_PIN);
    int reading2 = digitalRead(MY_PIN2);

    if(reading == 1 ||reading2 == 1) {
        esp_sleep_enable_ext1_wakeup(BUTTON_PIN_BITMASK,ESP_EXT1_WAKEUP_ALL_LOW);;
    }
    else {
        esp_sleep_enable_ext1_wakeup(BUTTON_PIN_BITMASK,ESP_EXT1_WAKEUP_ANY_HIGH);;
    }

    Serial.println("Going to sleep now");

    esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH,   ESP_PD_OPTION_OFF);
    esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_SLOW_MEM, ESP_PD_OPTION_OFF);
    esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_FAST_MEM, ESP_PD_OPTION_OFF);
    esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL,         ESP_PD_OPTION_OFF);
    esp_sleep_pd_config(ESP_PD_DOMAIN_MAX,          ESP_PD_OPTION_OFF);
    esp_deep_sleep_start();

    Serial.println("check_sleep");
}

void loop(){
  Serial.println("check_sleep2");
}

The UDP part was extracted from a tutorial and a little bit modified. I've also try to use udp.printf or udp.broadcastto sentences and i can't even send the packet. Why isn't working? What am I missing? Any orientation is welcomed. Thank you for your time and assistance.


问:
How to fix unity humanoid animation
I ran into a problem while preparing a personal project.By the way, I am using a translator, so please understand. Is there a way to fix humanoid animations imported Unity assets? Or I wonder if it is possible to unlock read-only mode. I would be grateful if someone could help me with this issue.

To fix this, I tried changing the humanoid type to generic, but it failed.

Title: How to fix unity humanoid animation


问:
Woocommerce Germanized move terms and conditions checkboxes to before submit
I am trying to move the checkboxes in WC checkout germanized from before the payment info to before the submit button.

I have successfully added another set of checkboxes before the submit button using

```<code>add_action( 'woocommerce_review_order_before_submit', 'woocommerce_gzd_template_render_pay_for_order_checkboxes', 10 );
</code>```

Now I´ve got two sets of checkboxes, one above the payment info, and the one added by the above code.

I can´t figure out how to remove the first and initial set of checkboxes.
Maybe there is someone with a similar problem, who has figured out a solution.

I've tried

```<code>remove_action( 'woocommerce_checkout_show_terms', 'woocommerce_gzd_template_render_pay_for_order_checkboxes', 10 );

</code>```

and

```<code>remove_action( 'woocommerce_review_order_before_payment', 'woocommerce_gzd_before_legal_checkbox_direct-debit-checkbox', 10 );

</code>```

and

```<code>remove_action( 'woocommerce_checkout_after_terms_and_conditions', 'woocommerce_checkout_before_terms_and_conditions', 10 );

</code>```

Body:
I am trying to move the checkboxes in WC checkout germanized from before the payment info to before the submit button.

I have successfully added another set of checkboxes before the submit button using

add_action( 'woocommerce_review_order_before_submit', 'woocommerce_gzd_template_render_pay_for_order_checkboxes', 10 );

Now I´ve got two sets of checkboxes, one above the payment info, and the one added by the above code.

I can´t figure out how to remove the first and initial set of checkboxes.
Maybe there is someone with a similar problem, who has figured out a solution.

I've tried

remove_action( 'woocommerce_checkout_show_terms', 'woocommerce_gzd_template_render_pay_for_order_checkboxes', 10 );

and

remove_action( 'woocommerce_review_order_before_payment', 'woocommerce_gzd_before_legal_checkbox_direct-debit-checkbox', 10 );

and

remove_action( 'woocommerce_checkout_after_terms_and_conditions', 'woocommerce_checkout_before_terms_and_conditions', 10 );


问:
How do you reference the current item from a DataTemplate?
I'm trying to use a function in an x:Bind markup extension from a DataTemplate, but cannot seem to name the argument to pass along.

The following is a rough outline of what's working already. It is based on a default-generated Blank App, Packaged (WinUI 3 in Desktop) template (using FmtDemo as the project name) with a few changes:

MainWindow.idl

namespace FmtDemo
{
    [default_interface]
    runtimeclass MainWindow : Microsoft.UI.Xaml.Window
    {
        IVector<Item> Items { get; };
    }

    runtimeclass Item
    {
        String Text { get; };
    }
}
```
<p>The <code>MainWindow</code> type has a single property <code>Items</code> that returns an <code>IVector</code> of <code>Item</code>s. The <code>Item</code> type provides a single property <code>Text</code> for testing. These are the corresponding source files (modulo <code>#include</code> directives).</p>
<p><em>MainWindow.xaml.h</em></p>
<pre class="lang-cpp prettyprint-override"><code>namespace winrt::FmtDemo::implementation
{
    struct MainWindow : MainWindowT<MainWindow>
    {
        MainWindow() { InitializeComponent(); }

        winrt::Windows::Foundation::Collections::IVector<winrt::FmtDemo::Item> Items() {
            return single_threaded_observable_vector(std::vector { make<Item>() });
        }
    };
}
</code>```

Item.h

namespace winrt::FmtDemo::implementation
{
    struct Item : ItemT<Item>
    {
        hstring Text() { return hstring { L"Some text" }; }
    };
}
```
<p><em>App.xaml.h</em></p>
<pre class="lang-cpp prettyprint-override"><code>namespace winrt::FmtDemo::implementation
{
    struct App : AppT<App>
    {
        App() { InitializeComponent(); }

        void OnLaunched(Microsoft::UI::Xaml::LaunchActivatedEventArgs const&)
        {
            window = make<MainWindow>();
            window.Activate();
        }

    private:
        winrt::Microsoft::UI::Xaml::Window window{ nullptr };
    };
}
</code>```

The corresponding XAML markup that describes the contents of MainWindow is similarly simple:

<Window x:Class="FmtDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:FmtDemo">

    <ListView x:Name="ItemsList" ItemsSource="{x:Bind Items}">
        <ListView.ItemTemplate>
            <DataTemplate x:DataType="local:Item">
                <TextBlock Text="{x:Bind Text}" />
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>

</Window>
```
<p>The <code>MainWindow</code> holds a <code>ListView</code> control whose <code>ItemsSource</code> is bound to the <code>MainWindow.Items</code> property. The <code>DataTemplate</code> contains a <code>TextBlock</code> control with its <code>Text</code> property bound to <code>Item.Text</code>. All that works as expected.</p>
<p>What I'm trying to do now is moving the formatting code into a dedicated <code>Formatter</code> type, starting with the <em>MainWindow.idl</em> by adding the following:</p>
<pre class="lang-none prettyprint-override"><code>namespace FmtDemo
{
    // ...

    static runtimeclass Formatter
    {
        static String FmtItem(Item item);
    }
}
</code>```

and implementing it in Formatter.h

namespace winrt::FmtDemo::implementation
{
    struct Formatter
    {
        static hstring FmtItem(winrt::FmtDemo::Item const& item)
        {
            return L"Formatted: " + item.Text();
        }
    };
}

namespace winrt::FmtDemo::factory_implementation
{
    struct Formatter : FormatterT<Formatter, implementation::Formatter> {};
}
```
<p>The <code>Formatter</code> type is accessible from the XAML markup, but the issue I'm having is naming the <code>Item</code> reference from the <code>DataTemplate</code>:</p>
<pre class="lang-xml prettyprint-override"><code><Window
    x:Class="FmtDemo.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:FmtDemo">

    <ListView x:Name="ItemsList" ItemsSource="{x:Bind Items}">
        <ListView.ItemTemplate>
            <DataTemplate x:DataType="local:Item">
                <TextBlock Text="{x:Bind local:Formatter.FmtItem( ??? )}" />
                <!--- What should                                 ^^^ this be? -->
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>

</Window>
</code>```

The ??? in the XAML above should reference the current Item (DataContext, I guess?) but I don't know how to name it.

What should the ??? be here (unless that's something that's not supported)?

Body:
I'm trying to use a function in an x:Bind markup extension from a DataTemplate, but cannot seem to name the argument to pass along.

The following is a rough outline of what's working already. It is based on a default-generated Blank App, Packaged (WinUI 3 in Desktop) template (using FmtDemo as the project name) with a few changes:

MainWindow.idl

namespace FmtDemo
{
    [default_interface]
    runtimeclass MainWindow : Microsoft.UI.Xaml.Window
    {
        IVector<Item> Items { get; };
    }

    runtimeclass Item
    {
        String Text { get; };
    }
}

The MainWindow type has a single property Items that returns an IVector of Items. The Item type provides a single property Text for testing. These are the corresponding source files (modulo #include directives).

MainWindow.xaml.h

namespace winrt::FmtDemo::implementation
{
    struct MainWindow : MainWindowT<MainWindow>
    {
        MainWindow() { InitializeComponent(); }

        winrt::Windows::Foundation::Collections::IVector<winrt::FmtDemo::Item> Items() {
            return single_threaded_observable_vector(std::vector { make<Item>() });
        }
    };
}

Item.h

namespace winrt::FmtDemo::implementation
{
    struct Item : ItemT<Item>
    {
        hstring Text() { return hstring { L"Some text" }; }
    };
}

App.xaml.h

namespace winrt::FmtDemo::implementation
{
    struct App : AppT<App>
    {
        App() { InitializeComponent(); }

        void OnLaunched(Microsoft::UI::Xaml::LaunchActivatedEventArgs const&)
        {
            window = make<MainWindow>();
            window.Activate();
        }

    private:
        winrt::Microsoft::UI::Xaml::Window window{ nullptr };
    };
}

The corresponding XAML markup that describes the contents of MainWindow is similarly simple:

<Window x:Class="FmtDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:FmtDemo">

    <ListView x:Name="ItemsList" ItemsSource="{x:Bind Items}">
        <ListView.ItemTemplate>
            <DataTemplate x:DataType="local:Item">
                <TextBlock Text="{x:Bind Text}" />
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>

</Window>

The MainWindow holds a ListView control whose ItemsSource is bound to the MainWindow.Items property. The DataTemplate contains a TextBlock control with its Text property bound to Item.Text. All that works as expected.

What I'm trying to do now is moving the formatting code into a dedicated Formatter type, starting with the MainWindow.idl by adding the following:

namespace FmtDemo
{
    // ...

    static runtimeclass Formatter
    {
        static String FmtItem(Item item);
    }
}

and implementing it in Formatter.h

namespace winrt::FmtDemo::implementation
{
    struct Formatter
    {
        static hstring FmtItem(winrt::FmtDemo::Item const& item)
        {
            return L"Formatted: " + item.Text();
        }
    };
}

namespace winrt::FmtDemo::factory_implementation
{
    struct Formatter : FormatterT<Formatter, implementation::Formatter> {};
}

The Formatter type is accessible from the XAML markup, but the issue I'm having is naming the Item reference from the DataTemplate:

<Window
    x:Class="FmtDemo.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:FmtDemo">

    <ListView x:Name="ItemsList" ItemsSource="{x:Bind Items}">
        <ListView.ItemTemplate>
            <DataTemplate x:DataType="local:Item">
                <TextBlock Text="{x:Bind local:Formatter.FmtItem( ??? )}" />

            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>

</Window>

The ??? in the XAML above should reference the current Item (DataContext, I guess?) but I don't know how to name it.

What should the ??? be here (unless that's something that's not supported)?


问:
Linux agent is sending an hardstatus in the beginning of 'echo' output
In a program for Linux, I use this script (with root execution) to get last logged user and its locale:

```<code>LAST_USER=`last -1 | cut -f 1 -d " " | head -n 1`
LAST_LOCALE=`su - "$LAST_USER" -c 'echo "$LANG"'`
</code>```

But one of the Linux agent using this script adds an hardstatus (eg. "\033];hostname\033\") in the beginning of $LAST_LOCALE and I can't figure out why.

I tried to reproduce this issue on a local Linux without success ; I tried to ask the user to do the command without the '-' option of su, without changes. Replacing 'echo' by 'printf' seems to remove the hardstatus though, so the issue seems to be linked with 'echo' itself.

I couldn't find any similar behavior with a lots of internet researching…

Note: the user is using tmux.

Body:
In a program for Linux, I use this script (with root execution) to get last logged user and its locale:

LAST_USER=`last -1 | cut -f 1 -d " " | head -n 1`
LAST_LOCALE=`su - "$LAST_USER" -c 'echo "$LANG"'`

But one of the Linux agent using this script adds an hardstatus (eg. "\033];hostname\033\") in the beginning of $LAST_LOCALE and I can't figure out why.

I tried to reproduce this issue on a local Linux without success ; I tried to ask the user to do the command without the '-' option of su, without changes. Replacing 'echo' by 'printf' seems to remove the hardstatus though, so the issue seems to be linked with 'echo' itself.

I couldn't find any similar behavior with a lots of internet researching…

Note: the user is using tmux.


问:
How to Hide/Disable Primefaces Media Download and Print Button

As given in http://www.primefaces.org:8080/showcase/ui/multimedia/media.xhtml?jfwid=25c8e. We can show pdf file using primefaces media. How can we hide/disable download button.


问:
Facing problems while building wheels to install Cmake package for one of my PyCharm project
I am using PyCharm in which I tried to install the Cmake package. But then, I faced an error that asked me to upgrade the pip. I successfully upgraded the pip installer and then, when I again tried to install the Cmake package again, this time I faced the following error.

```<code>Collecting cmake
  Using cached cmake-3.25.0.tar.gz (33 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: cmake
  Building wheel for cmake (pyproject.toml): started
  Building wheel for cmake (pyproject.toml): finished with status 'error'
Failed to build cmake

  error: subprocess-exited-with-error

  Building wheel for cmake (pyproject.toml) did not run successfully.
  exit code: 1

  [32 lines of output]
  Traceback (most recent call last):
    File "C:\Users\epsit\AppData\Local\Temp\pip-build-env-84yn_p_q\overlay\lib\python3.9\site-packages\skbuild\setuptools_wrap.py", line 612, in setup
      cmkr = cmaker.CMaker(cmake_executable)
    File "C:\Users\epsit\AppData\Local\Temp\pip-build-env-84yn_p_q\overlay\lib\python3.9\site-packages\skbuild\cmaker.py", line 148, in __init__
      self.cmake_version = get_cmake_version(self.cmake_executable)
    File "C:\Users\epsit\AppData\Local\Temp\pip-build-env-84yn_p_q\overlay\lib\python3.9\site-packages\skbuild\cmaker.py", line 103, in get_cmake_version
      raise SKBuildError(

      =============================DEBUG ASSISTANCE=============================
      If you are seeing a compilation error please try the following steps to
      successfully install cmake:
      1) Upgrade to the latest pip and try again. This will fix errors for most
         users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
      2) If on Linux, with glibc < 2.12, you can set PIP_ONLY_BINARY=cmake in
         order to retrieve the last manylinux1 compatible wheel.
      3) If on Linux, with glibc < 2.12, you can cap "cmake<3.23" in your
         requirements in order to retrieve the last manylinux1 compatible wheel.
      4) Open an issue with the debug information that follows at
         https://github.com/scikit-build/cmake-python-distributions/issues

      Python: 3.9.10
      platform: Windows-10-10.0.22000-SP0
      machine: AMD64
      bits: 64
      pip: n/a
      setuptools: 65.6.3
      scikit-build: 0.16.3
      PEP517_BUILD_BACKEND=setuptools.build_meta
      =============================DEBUG ASSISTANCE=============================

  Problem with the CMake installation, aborting build. CMake executable is cmake
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cmake
ERROR: Could not build wheels for cmake, which is required to install pyproject.toml-based projects

</code>```

I'm using the Python version: 3.9.10.

Can anyone help me out in installing the Cmake package successfully in my PyCharm project?

I simply want to install the Cmake package but wheels aren't getting built.

Body:
I am using PyCharm in which I tried to install the Cmake package. But then, I faced an error that asked me to upgrade the pip. I successfully upgraded the pip installer and then, when I again tried to install the Cmake package again, this time I faced the following error.

Collecting cmake
  Using cached cmake-3.25.0.tar.gz (33 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: cmake
  Building wheel for cmake (pyproject.toml): started
  Building wheel for cmake (pyproject.toml): finished with status 'error'
Failed to build cmake

  error: subprocess-exited-with-error

  Building wheel for cmake (pyproject.toml) did not run successfully.
  exit code: 1

  [32 lines of output]
  Traceback (most recent call last):
    File "C:\Users\epsit\AppData\Local\Temp\pip-build-env-84yn_p_q\overlay\lib\python3.9\site-packages\skbuild\setuptools_wrap.py", line 612, in setup
      cmkr = cmaker.CMaker(cmake_executable)
    File "C:\Users\epsit\AppData\Local\Temp\pip-build-env-84yn_p_q\overlay\lib\python3.9\site-packages\skbuild\cmaker.py", line 148, in __init__
      self.cmake_version = get_cmake_version(self.cmake_executable)
    File "C:\Users\epsit\AppData\Local\Temp\pip-build-env-84yn_p_q\overlay\lib\python3.9\site-packages\skbuild\cmaker.py", line 103, in get_cmake_version
      raise SKBuildError(

      =============================DEBUG ASSISTANCE=============================
      If you are seeing a compilation error please try the following steps to
      successfully install cmake:
      1) Upgrade to the latest pip and try again. This will fix errors for most
         users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
      2) If on Linux, with glibc < 2.12, you can set PIP_ONLY_BINARY=cmake in
         order to retrieve the last manylinux1 compatible wheel.
      3) If on Linux, with glibc < 2.12, you can cap "cmake<3.23" in your
         requirements in order to retrieve the last manylinux1 compatible wheel.
      4) Open an issue with the debug information that follows at
         https://github.com/scikit-build/cmake-python-distributions/issues

      Python: 3.9.10
      platform: Windows-10-10.0.22000-SP0
      machine: AMD64
      bits: 64
      pip: n/a
      setuptools: 65.6.3
      scikit-build: 0.16.3
      PEP517_BUILD_BACKEND=setuptools.build_meta
      =============================DEBUG ASSISTANCE=============================

  Problem with the CMake installation, aborting build. CMake executable is cmake
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cmake
ERROR: Could not build wheels for cmake, which is required to install pyproject.toml-based projects

I'm using the Python version: 3.9.10.

Can anyone help me out in installing the Cmake package successfully in my PyCharm project?

I simply want to install the Cmake package but wheels aren't getting built.


问:
how to implement linq expression for this foreach?

private void EvaluateExpressions(IEnumerable<string> innerTexts,
    ExpressionGroupsCombination expressionGroupsCombination,
    ScopedExpressionGroup scopedExpressionGroup,
    ExpressionGroupMatchingResult result)
{
    if (expressionGroupsCombination != null)
    {
        foreach (var expression in scopedExpressionGroup.Expressions
            .Select(expression => $"{expressionGroupsCombination.StartExpression}{expression.ReplaceAccents(accentConfiguration)}{expressionGroupsCombination.EndExpression}"))
        {
            string? text = innerTexts.FirstOrDefault(text => Regex.IsMatch(text, expression, RegexOptions.IgnoreCase));
            if (text != null)
            {
                result.MatchedExpression = expression;
                result.MatchedText = text;
                result.IsMatched = true;

                return;
            }
        }
    }
}
```
<p>I am thinking for a way to avoid a return and the foreach with a linq but I am not reaching it. I have implemented another way but I can not reach the "expression" to assing result.MatchedExrpression</p>
<p>I have implemented the next code where I have nested different linq´s but the propperty "result.MatchedExpression" is not the original regex because should return this value : "***</p>
<blockquote>
<p>^[[].,;:)(-\—«»“”‘’¿?¡!<>\/+^<em>@|#~ ]</em>[AÁ]ct[aá] d[eé]
R[eé][uúü]n[ií][oó]n d[eé] [OÓ]br[aá]
N°([0-9])+[[].,;:)(-\—«»“”‘’¿?¡!<>\/+^<em>@|#~ ]</em>$</p>
</blockquote>
<p>***" but return this one : "</p>
<blockquote>
<p>^[[].,;:)(-\—«»“”‘’¿?¡!<>\/+^<em>@|#~ ]</em>[AÁ]ct[aá] d[eé]
R[eé][uúü]n[ií][oó]n d[eé] [OÓ]br[aá]
N°16[[].,;:)(-\—«»“”‘’¿?¡!<>\/+^<em>@|#~ ]</em>$</p>
</blockquote>
<p>" the problem is Nº16.</p>
```if (expressionGroupsCombination != null)
            {
                string? matchedText = innerTexts
                    .FirstOrDefault(text => scopedExpressionGroup.Expressions
                    .Select(expression => Regex.IsMatch(
                        text,
                        $"{expressionGroupsCombination.StartExpression}{expression.ReplaceAccents(accentConfiguration)}{expressionGroupsCombination.EndExpression}",
                        RegexOptions.IgnoreCase)
                    )
                    .Any(isMatch => isMatch));
                if (matchedText != null)
                {
                    result.MatchedExpression = $"{expressionGroupsCombination.StartExpression}{matchedText.ReplaceAccents(accentConfiguration)}{expressionGroupsCombination.EndExpression}";
                    result.MatchedText = matchedText;
                    result.IsMatched = true;

                }
            }
```

Body:
private void EvaluateExpressions(IEnumerable<string> innerTexts,
    ExpressionGroupsCombination expressionGroupsCombination,
    ScopedExpressionGroup scopedExpressionGroup,
    ExpressionGroupMatchingResult result)
{
    if (expressionGroupsCombination != null)
    {
        foreach (var expression in scopedExpressionGroup.Expressions
            .Select(expression => $"{expressionGroupsCombination.StartExpression}{expression.ReplaceAccents(accentConfiguration)}{expressionGroupsCombination.EndExpression}"))
        {
            string? text = innerTexts.FirstOrDefault(text => Regex.IsMatch(text, expression, RegexOptions.IgnoreCase));
            if (text != null)
            {
                result.MatchedExpression = expression;
                result.MatchedText = text;
                result.IsMatched = true;

                return;
            }
        }
    }
}

I am thinking for a way to avoid a return and the foreach with a linq but I am not reaching it. I have implemented another way but I can not reach the "expression" to assing result.MatchedExrpression

I have implemented the next code where I have nested different linq´s but the propperty "result.MatchedExpression" is not the original regex because should return this value : "***

^[[].,;:)(-\—«»“”‘’¿?¡!<>\/+^@|#~ ][AÁ]ct[aá] d[eé]
R[eé][uúü]n[ií][oó]n d[eé] [OÓ]br[aá]
N°([0-9])+[[].,;:)(-\—«»“”‘’¿?¡!<>\/+^@|#~ ]$

***" but return this one : "

^[[].,;:)(-\—«»“”‘’¿?¡!<>\/+^@|#~ ][AÁ]ct[aá] d[eé]
R[eé][uúü]n[ií][oó]n d[eé] [OÓ]br[aá]
N°16[[].,;:)(-\—«»“”‘’¿?¡!<>\/+^@|#~ ]$

" the problem is Nº16.

if (expressionGroupsCombination != null)
            {
                string? matchedText = innerTexts
                    .FirstOrDefault(text => scopedExpressionGroup.Expressions
                    .Select(expression => Regex.IsMatch(
                        text,
                        $"{expressionGroupsCombination.StartExpression}{expression.ReplaceAccents(accentConfiguration)}{expressionGroupsCombination.EndExpression}",
                        RegexOptions.IgnoreCase)
                    )
                    .Any(isMatch => isMatch));
                if (matchedText != null)
                {
                    result.MatchedExpression = $"{expressionGroupsCombination.StartExpression}{matchedText.ReplaceAccents(accentConfiguration)}{expressionGroupsCombination.EndExpression}";
                    result.MatchedText = matchedText;
                    result.IsMatched = true;

                }
            }


问:
text-to-speech google api sample rate 8khz
I use https://texttospeech.googleapis.com/v1/text:synthesize since few months to synthetise for telephony purpose with sample rate 8khz.
It worked fine.

{"ssml":"test v2</speak>"},"voice":{"languageCode":"fr-FR","name":"fr-FR-Standard-C","ssmlGender":"FEMALE"},"audioConfig":{"audioEncoding":"LINEAR16","sampleRateHertz":8000}}

Since this morning (12/13/2022) audiocontent delivered by API is 24000 Hz (with 8000 HZ in the WAV HEADER returned)

Someone as same problem  ?

Sincerely
Nicolas


问:
Problem installing from github repo depending on owner of repo
I can install a repo on an AWS Elastic Beanstalk instance when my personal github account is the owner, but not when my company's github account is the owner.

I needed to make some slight changes to a package.  So, I forked the repo to my personal account, made the changes, and began testing on an AWS Elastic Beanstalk instance.  This worked fine, with the following line in my requirements.txt.

-e git+https://github.com/<personal-github-name>/<package-name>.git#egg=<feature-name>

However, before things can be finalized, I need to change the owner of this new repo from me to my company.  So, I changed the ownership of the repo to my company, and updated my requirements.txt to:

-e git+https://github.com/<company-github-name>/<package-name>.git#egg=<feature-name>

Now whenever I deploy, the instance is never able to become healthy, and thus I can't even check the logs to see what's going wrong.  I even tried forking the repo from my company back to my personal account, and again it works fine.  On both my personal account and company account, the repo is Public.  I talked to my manager and he says he doesn't see any github settings on the company side that should be preventing the install.

Is there some github setting my manager may be missing?  Or do I have any other options for installing a 'custom' package without relying on my personal github account?

Thank you!


问:
Apple Pay testing during submission
I have integrated Apple Pay in my app, but users can use it only when you are at a specific store. Should I prepare some workaround so Apple can test it also in-house or I can simply send them a screen recording?

Thank you

Title: Apple Pay testing during submission


问:
Update Series: should it cancel existing overrides?
I have a repeating series named Test every day for five days. I change the second occurrence with a new name Test Override. It looks (roughly) like this on a Calendar grid:

```<code>Day1 | Day2 | Day3          | Day4 | Day5
-----------------------------------------
Test | Test | Test Override | Test | Test
</code>```

When I change the Test for New Test, o365 and Google Calendar have different behavior:

o365:

```<code>Day1     | Day2     | Day3          | Day4     | Day5
-----------------------------------------
New Test | New Test | Test Override | New Test | New Test
</code>```

Google Calendar:

```<code>Day1     | Day2     | Day3     | Day4     | Day5
----------------------------------------------------
New Test | New Test | New Test | New Test | New Test
</code>```

What is the right behavior?

Body:
I have a repeating series named Test every day for five days. I change the second occurrence with a new name Test Override. It looks (roughly) like this on a Calendar grid:

Day1 | Day2 | Day3          | Day4 | Day5
-----------------------------------------
Test | Test | Test Override | Test | Test

When I change the Test for New Test, o365 and Google Calendar have different behavior:

o365:

Day1     | Day2     | Day3          | Day4     | Day5
-----------------------------------------
New Test | New Test | Test Override | New Test | New Test

Google Calendar:

Day1     | Day2     | Day3     | Day4     | Day5
----------------------------------------------------
New Test | New Test | New Test | New Test | New Test

What is the right behavior?


问:
"wwwroot" folder for project in visual studio
Why do we need "wwwroot" folder for project in visual studio? Using angular 14 and .net5

Tried to find about it but everywhere it says " the wwwroot folder in the ASP.NET Core project is treated as a web root folder."


问:
xarray to_netcdf group flipping latitude
I have the following xarray dataset:

```<code>Dimensions:    (latitude: 17664, longitude: 22656, time: 1)
Coordinates:
  * longitude  (longitude) float32 -46.0 -46.0 -45.99 -45.99 ... 12.99 13.0 13.0
  * latitude   (latitude) float32 66.0 66.0 65.99 65.99 ... 20.01 20.0 20.0
  * time       (time) float64 8.373e+08
Data variables:
    mean       (latitude, longitude) float32 nan nan nan nan ... nan nan nan nan
    count      (latitude, longitude) int64 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0
    stdev      (latitude, longitude) float32 nan nan nan nan ... nan nan nan nan
    sum        (latitude, longitude) float32 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
    sumsq      (latitude, longitude) float32 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
</code>```

If I write this out to netcdf like so output.to_netcdf('test_file.nc',group=var,encoding=tot_encode,mode='w') and ncview the file - the latitude appears to be upside-down. However if I write out like so output.to_netcdf('test_file.nc',encoding=tot_encode,mode='w') (i.e not in a group) the latitude is the correct way around? Not sure what is going on?
Thanks

Body:
I have the following xarray dataset:

Dimensions:    (latitude: 17664, longitude: 22656, time: 1)
Coordinates:
  * longitude  (longitude) float32 -46.0 -46.0 -45.99 -45.99 ... 12.99 13.0 13.0
  * latitude   (latitude) float32 66.0 66.0 65.99 65.99 ... 20.01 20.0 20.0
  * time       (time) float64 8.373e+08
Data variables:
    mean       (latitude, longitude) float32 nan nan nan nan ... nan nan nan nan
    count      (latitude, longitude) int64 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0
    stdev      (latitude, longitude) float32 nan nan nan nan ... nan nan nan nan
    sum        (latitude, longitude) float32 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
    sumsq      (latitude, longitude) float32 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0

If I write this out to netcdf like so output.to_netcdf('test_file.nc',group=var,encoding=tot_encode,mode='w') and ncview the file - the latitude appears to be upside-down. However if I write out like so output.to_netcdf('test_file.nc',encoding=tot_encode,mode='w') (i.e not in a group) the latitude is the correct way around? Not sure what is going on?
Thanks


问:
Update Product Brand programmatically to Products having brands not assigned
I am stuck since 2-3 hours looking for a solution to the problem i am in.

I have around 15000 products for which "Product Brand" is not assigned. I created 2000 new products and have assigned "Product brand" to them.

I have only 1 "Product Brand" in entire woo-commerce store.

Is there anyway possible to update all products having "Product Brand" not assigned with custom code so as to save time doing it manually using default Bulk Edit in Woocommerce.

Appreciate your help.


问:
How to reload Security Configuration Bean in Spring Boot after picking up changes from Config Server?
I have created a AuthorizationConfiguration class in my Spring Boot likes this

@Configuration
@ConfigurationProperties(prefix = "rbac")
@Data
@Getter
@RefreshScope
public class RbacConfigurations {

  private boolean enabled = false;
  private List<RbacEndpoints> endpoints;

  @Data
  @ConfigurationProperties("endpoints")
  public static class RbacEndpoints {

    public String path;
    public List<String> methods;
    public List<String> permissions = new ArrayList<>();
  }

}
```
<p>And I am using this in my WebFlux's Security Configuration</p>
<pre class="lang-java prettyprint-override"><code>@Configuration
@EnableWebFluxSecurity
@EnableReactiveMethodSecurity
@EnableConfigurationProperties
public class OAuth2SecurityConfig {

    private final RbacConfigurations rbacConfigurations;

    @Bean
  protected SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) throws Exception {

     var rbacEndpoints = this.rbacConfigurations.getEndpoints();

    for (var rbacEndpoint : rbacEndpoints) {
      String path = rbacEndpoint.getPath();
      List<String> permissions = rbacEndpoint.getPermissions();
      List<String> methods = rbacEndpoint.getMethods();

      if (!Objects.isNull(methods) && methods.size() > 0) {
        for (var method : methods) {
          HttpMethod httpMethod = HttpMethod.valueOf(method);
          http.authorizeExchange().pathMatchers(httpMethod, path).hasAnyAuthority(permissions.toArray(new String[0]));
        }
      } else {
        http.authorizeExchange().pathMatchers(path).hasAnyAuthority(permissions.toArray(new String[0]));
      }
    }
</code>```

It is working fine as expected. Picking up the endpoints from application.yml file and adding Authorization on them. I am serving the yml file via Spring Cloud Config Server. But I want this to be updated with every changes on the config file (hosted on GitLab). The application is also picking up changes from the config server but this Bean is not getting reloaded.

What should I do in order to make @RefreshScope work in this case?

Body:
I have created a AuthorizationConfiguration class in my Spring Boot likes this

@Configuration
@ConfigurationProperties(prefix = "rbac")
@Data
@Getter
@RefreshScope
public class RbacConfigurations {

  private boolean enabled = false;
  private List<RbacEndpoints> endpoints;

  @Data
  @ConfigurationProperties("endpoints")
  public static class RbacEndpoints {

    public String path;
    public List<String> methods;
    public List<String> permissions = new ArrayList<>();
  }

}

And I am using this in my WebFlux's Security Configuration

@Configuration
@EnableWebFluxSecurity
@EnableReactiveMethodSecurity
@EnableConfigurationProperties
public class OAuth2SecurityConfig {

    private final RbacConfigurations rbacConfigurations;

    @Bean
  protected SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) throws Exception {

     var rbacEndpoints = this.rbacConfigurations.getEndpoints();

    for (var rbacEndpoint : rbacEndpoints) {
      String path = rbacEndpoint.getPath();
      List<String> permissions = rbacEndpoint.getPermissions();
      List<String> methods = rbacEndpoint.getMethods();

      if (!Objects.isNull(methods) && methods.size() > 0) {
        for (var method : methods) {
          HttpMethod httpMethod = HttpMethod.valueOf(method);
          http.authorizeExchange().pathMatchers(httpMethod, path).hasAnyAuthority(permissions.toArray(new String[0]));
        }
      } else {
        http.authorizeExchange().pathMatchers(path).hasAnyAuthority(permissions.toArray(new String[0]));
      }
    }

It is working fine as expected. Picking up the endpoints from application.yml file and adding Authorization on them. I am serving the yml file via Spring Cloud Config Server. But I want this to be updated with every changes on the config file (hosted on GitLab). The application is also picking up changes from the config server but this Bean is not getting reloaded.

What should I do in order to make @RefreshScope work in this case?


问:
depend on apache commons codec
I try to add an dependency on Maven to the Apache common codec repository (version 1.15). I am using the syntax from the Apache website

```<code><dependency>
    <groupId>commons-codec</groupId>
    <artifactId>commons-codec</artifactId>
    <version>1.15</version>
</dependency>
</code>```

If I run the code I get the Error: java: package org.apache.commons.codec.binary does not exist
My Editor (IntelliJ IDEA) marks the repository as not found: Dependency 'commons-codec:commons-codec:1.15' not found
Maven is on online mode.

How could I get the repository?

Title: depend on apache commons codec

Body:
I try to add an dependency on Maven to the Apache common codec repository (version 1.15). I am using the syntax from the Apache website

<dependency>
    <groupId>commons-codec</groupId>
    <artifactId>commons-codec</artifactId>
    <version>1.15</version>
</dependency>

If I run the code I get the Error: java: package org.apache.commons.codec.binary does not exist
My Editor (IntelliJ IDEA) marks the repository as not found: Dependency 'commons-codec:commons-codec:1.15' not found
Maven is on online mode.

How could I get the repository?


问:
PL / SQL difference between to dates in 'HH24:MI:SS'
I am trying to calculate the difference between to dates.
The date is in the format dd:mm:yyyy HH:MI:SS and the solution should be in HH:MI:SS. But I only get ",xxxxxx".

The code I tried:

`

```<code>DECLARE
    ln_date1   DATE;
    ln_date2   DATE;
    ln_diff    NUMBER;
BEGIN
    FOR cr_example IN (  SELECT example_date
                           FROM tabelle
                          WHERE id = 1 AND example_date <= '13.12.2022'
                       ORDER BY example_date DESC
                          FETCH FIRST 40 ROWS ONLY)
    LOOP
        SELECT s.date1, s.date2
          INTO ln_date1, ln_date2
          FROM tabelle1 s
         WHERE example_date = cr_example.example_date;

        ln_diff := ln_date2 - ln_date1;

        DBMS_OUTPUT.put_line ('Difference: ' || ln_diff);
    END LOOP;
END;
</code>```

`

Output:

Difference: ,0742708333333333333333333333333333333333

Dont know how to solve the issue, hoping anyone can help me.

Thanks in advance.

SOLUTION:

Thanks to William Robertson for noticing that ,0742708333333333333333333333333333333333 is in days.

To convert it in HH:MIN:SS you can use:

```<code>ln_diff := ln_date2 - ln_date1;

ln_hours := FLOOR (ln_diff * 24);
ln_minutes := FLOOR ((ln_diff * 24 - ln_hours) * 60);
ln_seconds :=
ROUND ((((ln_diff * 24 - ln_hours) * 60) - ln_minutes) * 60);

DBMS_OUTPUT.put_line (
ln_hours || ':' || ln_minutes || ':' || ln_seconds || ':');
</code>```

Body:
I am trying to calculate the difference between to dates.
The date is in the format dd:mm:yyyy HH:MI:SS and the solution should be in HH:MI:SS. But I only get ",xxxxxx".

The code I tried:

`

DECLARE
    ln_date1   DATE;
    ln_date2   DATE;
    ln_diff    NUMBER;
BEGIN
    FOR cr_example IN (  SELECT example_date
                           FROM tabelle
                          WHERE id = 1 AND example_date <= '13.12.2022'
                       ORDER BY example_date DESC
                          FETCH FIRST 40 ROWS ONLY)
    LOOP
        SELECT s.date1, s.date2
          INTO ln_date1, ln_date2
          FROM tabelle1 s
         WHERE example_date = cr_example.example_date;

        ln_diff := ln_date2 - ln_date1;

        DBMS_OUTPUT.put_line ('Difference: ' || ln_diff);
    END LOOP;
END;

`

Output:

Difference: ,0742708333333333333333333333333333333333

Dont know how to solve the issue, hoping anyone can help me.

Thanks in advance.

SOLUTION:

Thanks to William Robertson for noticing that ,0742708333333333333333333333333333333333 is in days.

To convert it in HH:MIN:SS you can use:

ln_diff := ln_date2 - ln_date1;

ln_hours := FLOOR (ln_diff * 24);
ln_minutes := FLOOR ((ln_diff * 24 - ln_hours) * 60);
ln_seconds :=
ROUND ((((ln_diff * 24 - ln_hours) * 60) - ln_minutes) * 60);

DBMS_OUTPUT.put_line (
ln_hours || ':' || ln_minutes || ':' || ln_seconds || ':');


问:
The browser (or proxy) sent a request that this server could not understand
I'm trying to implement an HTTP server that can respond to incoming (HTTP) requests using python (with flask).
I need to write a server that exposes calculator capabilities.
The server will support two modes of operation:

1)Independent calculation:
In this mode, the server will receive all the information it needs to perform the calculation: the            arguments and the operation to perform.

2)Stack-based:
In this mode, the server will receive the arguments on which the operation will work and will push them onto a stack. When the operation executes, it pops the amount of stacked arguments that it needs (different operations will need different amounts of arguments), performs the operation, and returns the result.

But when i'm trying to send a json format using Postman, I get this message: The browser (or proxy) sent a request that this server could not understand.

This is my python code:

```<code>from flask import Flask, request, jsonify
import operator
import math

app = Flask(__name__)
stack = []

operations = {
    'plus': operator.add,
    'minus': operator.sub,
    'times': operator.mul,
    'divide': operator.floordiv,
    'pow': operator.pow,
    'abs': abs,
    'fact': math.factorial,
}

@app.route('/independent/calculate', methods=['POST'])
def independent_calculate():
    data = request.get_json()
    arguments = data.get("arguments", [])
    operation_name = data.get("operation", "").lower()
    operation = operations.get(operation_name)

    if operation is None:
        return jsonify({'error-message': f'Error: unknown operation: {operation_name}'}), 409
    if len(arguments) != operation.arity:
        return jsonify({'error-message': f'Error: Not enough arguments to perform the operation {operation_name}'}), 409

    result = operation(*arguments)
    return jsonify({'result': result}), 200

@app.route('/stack/size', methods=['GET'])
def stack_size():
    return jsonify({'result': len(stack)}), 200

@app.route('/stack/arguments', methods=['PUT'])
def stack_arguments():
    data = request.get_json()
    arguments = data.get('arguments', [])
    stack.extend(reversed(arguments))
    return jsonify({'result': len(stack)}), 200

@app.route('/stack/operation', methods=['PUT'])
def stack_operation():
    data = request.get_json()
    operation_name = data.get('operation', '').lower()
    operation = operations.get(operation_name)
    if operation is None:
        return jsonify({'error-message': f'Error: unknown operation: {operation_name}'}), 409
        if len(stack) < operation.arity:
            return jsonify(
                {'error-message': f'Error: Not enough arguments to perform the operation {operation_name}'}), 409

        arguments = [stack.pop() for _ in range(operation.arity)]
        result = operation(*arguments)

        if operation_name == 'divide' and arguments[1] == 0:
            return jsonify({'error-message': 'Error while performing operation Divide: division by 0'}), 409
        if operation_name == 'fact' and arguments[0] < 0:
            return jsonify({
                               'error-message': 'Error while performing operation Factorial: not supported for the negative number'}), 409

        return jsonify({'result': result}), 200

@app.route('/stack/clear', methods=['DELETE'])
def stack_clear():
    stack.clear()
    return jsonify({'result': 0}), 200

if __name__ == '__main__':
    app.run(port=8496)

</code>```

and this is the request from the Postman:

Postman photo

Body:
I'm trying to implement an HTTP server that can respond to incoming (HTTP) requests using python (with flask).
I need to write a server that exposes calculator capabilities.
The server will support two modes of operation:

1)Independent calculation:
In this mode, the server will receive all the information it needs to perform the calculation: the            arguments and the operation to perform.

2)Stack-based:
In this mode, the server will receive the arguments on which the operation will work and will push them onto a stack. When the operation executes, it pops the amount of stacked arguments that it needs (different operations will need different amounts of arguments), performs the operation, and returns the result.

But when i'm trying to send a json format using Postman, I get this message: The browser (or proxy) sent a request that this server could not understand.

This is my python code:

from flask import Flask, request, jsonify
import operator
import math

app = Flask(__name__)
stack = []

operations = {
    'plus': operator.add,
    'minus': operator.sub,
    'times': operator.mul,
    'divide': operator.floordiv,
    'pow': operator.pow,
    'abs': abs,
    'fact': math.factorial,
}

@app.route('/independent/calculate', methods=['POST'])
def independent_calculate():
    data = request.get_json()
    arguments = data.get("arguments", [])
    operation_name = data.get("operation", "").lower()
    operation = operations.get(operation_name)

    if operation is None:
        return jsonify({'error-message': f'Error: unknown operation: {operation_name}'}), 409
    if len(arguments) != operation.arity:
        return jsonify({'error-message': f'Error: Not enough arguments to perform the operation {operation_name}'}), 409

    result = operation(*arguments)
    return jsonify({'result': result}), 200

@app.route('/stack/size', methods=['GET'])
def stack_size():
    return jsonify({'result': len(stack)}), 200

@app.route('/stack/arguments', methods=['PUT'])
def stack_arguments():
    data = request.get_json()
    arguments = data.get('arguments', [])
    stack.extend(reversed(arguments))
    return jsonify({'result': len(stack)}), 200

@app.route('/stack/operation', methods=['PUT'])
def stack_operation():
    data = request.get_json()
    operation_name = data.get('operation', '').lower()
    operation = operations.get(operation_name)
    if operation is None:
        return jsonify({'error-message': f'Error: unknown operation: {operation_name}'}), 409
        if len(stack) < operation.arity:
            return jsonify(
                {'error-message': f'Error: Not enough arguments to perform the operation {operation_name}'}), 409

        arguments = [stack.pop() for _ in range(operation.arity)]
        result = operation(*arguments)

        if operation_name == 'divide' and arguments[1] == 0:
            return jsonify({'error-message': 'Error while performing operation Divide: division by 0'}), 409
        if operation_name == 'fact' and arguments[0] < 0:
            return jsonify({
                               'error-message': 'Error while performing operation Factorial: not supported for the negative number'}), 409

        return jsonify({'result': result}), 200

@app.route('/stack/clear', methods=['DELETE'])
def stack_clear():
    stack.clear()
    return jsonify({'result': 0}), 200

if __name__ == '__main__':
    app.run(port=8496)

and this is the request from the Postman:

Postman photo


问:
Flutter pushNotification ios Missing Push Notification Entitlement warning - can't receive pusher notifications when the app in testflight
it is my first time using notifications in my app when I try to upload my app on a test flight I got a Missing Push Notification Entitlement warning message from apple and the notifications won't work I tried so many things but I'm stuck at this point, I'm using pusher service for the notifications I tried everything but still can't receive notifications</p>


问:
SQL Error: ORA-00911: invalid character- sql syntax error persisting
I keep getting this error for this script. Thanks for your help

```<code>INSERT INTO %Table(UO_PROFESR_ISTG)
 SELECT DISTINCT %ProcessInstance
 , CI.EMPLID
 ,NVL((
 SELECT EXT.EXTERNAL_SYSTEM_ID
  FROM %Table(EXTERNAL_SYSTEM) EXT
 WHERE EXT.EXTERNAL_SYSTEM = 'HRX'
   AND EXT.EFFDT = (
 SELECT MAX(EXT1.EFFDT)
  FROM %Table(EXTERNAL_SYSTEM) EXT1
 WHERE EXT1.EMPLID = EXT.EMPLID
   AND EXT1.EXTERNAL_SYSTEM = EXT.EXTERNAL_SYSTEM
   AND EXT1.EFFDT <= %CurrentDateIn)
   AND EXT.EMPLID = CI.EMPLID),' ' ) , NVL ((
 SELECT EXT.EXTERNAL_SYSTEM_ID
  FROM %Table(EXTERNAL_SYSTEM) EXT
 WHERE (EXT.EXTERNAL_SYSTEM = 'HRE'
    OR EXT.EXTERNAL_SYSTEM = 'HRW')
   AND EXT.EFFDT = (
 SELECT MAX(EXT1.EFFDT)
  FROM %Table(EXTERNAL_SYSTEM) EXT1
 WHERE EXT1.EMPLID = EXT.EMPLID
   AND EXT1.EXTERNAL_SYSTEM = EXT.EXTERNAL_SYSTEM
   AND EXT1.EFFDT <= %CurrentDateIn)
   AND EXT.EMPLID = CI.EMPLID), ' ') ,(
 SELECT NAME1.LAST_NAME
  FROM %Table(NAMES) NAME1
 WHERE NAME1.EFFDT = (
 SELECT MAX(NAME2.EFFDT)
  FROM %Table(NAMES) NAME2
 WHERE NAME2.EMPLID = NAME1.EMPLID
   AND NAME2.NAME_TYPE = NAME1.NAME_TYPE
   AND NAME2.EFFDT <= %CurrentDateIn
   AND NAME2.EFF_STATUS = 'A')
   AND NAME1.NAME_TYPE = 'PRI'
   AND NAME1.EMPLID = CI.EMPLID), (
 SELECT NAME1.FIRST_NAME
  FROM %Table(NAMES) NAME1
 WHERE NAME1.EFFDT = (
 SELECT MAX(NAME2.EFFDT)
  FROM %Table(NAMES) NAME2
 WHERE NAME2.EMPLID = NAME1.EMPLID
   AND NAME2.NAME_TYPE = NAME1.NAME_TYPE
   AND NAME2.EFFDT <= %CurrentDateIn
   AND NAME2.EFF_STATUS = 'A')
   AND NAME1.NAME_TYPE = 'PRI'
   AND NAME1.EMPLID = CI.EMPLID) ,NVL( (
 SELECT CP.LANG_CD
  FROM %Table(SCC_COMM_PREF) CP
 WHERE CP.EMPLID = CI.EMPLID), ' ') ,NVL( (
 SELECT EMAIL.EMAIL_ADDR
  FROM %Table(EMAIL_ADDRESSES) EMAIL
 WHERE EMAIL.EMPLID = CI.EMPLID
   AND EMAIL.E_ADDR_TYPE = 'UOTE') , ' ') , NVL( (
 SELECT EMAIL.EMAIL_ADDR
  FROM %Table(EMAIL_ADDRESSES) EMAIL
 WHERE EMAIL.EMPLID = CI.EMPLID
   AND EMAIL.E_ADDR_TYPE = 'UOTX') , ' ') , NVL( (
 SELECT EMAIL.EMAIL_ADDR
  FROM %Table(EMAIL_ADDRESSES) EMAIL
 WHERE EMAIL.EMPLID = CI.EMPLID
   AND EMAIL.E_ADDR_TYPE = 'UOTS') , ' ')
  FROM %Table(CLASS_INSTR) CI , %Table(INSTR_ADVISOR) INS
 WHERE CI.STRM IN (
 SELECT TRM.STRM
  FROM %Table(TERM_TBL) TRM
 WHERE TRM.INSTITUTION = 'UOTTA'
   AND TRM.ACAD_CAREER = 'UGRD'
   AND TRM.TERM_BEGIN_DT >= %Bind(TERM_BEGIN_DT)
   AND CI.EMPLID <> ' ')
   AND INS.EMPLID = CI.EMPLID
   AND INS.EFFDT = (
 SELECT MAX(INS1.EFFDT)
  FROM %Table(INSTR_ADVISOR) INS1
 WHERE INS1.EMPLID = INS.EMPLID
   AND INS1.INSTITUTION = INS.INSTITUTION
   AND INS1.EFFDT <= %CurrentDateIn)
   AND INS.EFF_STATUS = 'A'
</code>```

I tried changing the brackets and the syntax. The script used to work before but now It keeps giving me this error. Any help would be appreciated.

```<code>Error at Command Line : 3 Column : 13
Error report -
SQL Error: ORA-00911: invalid character
00911. 00000 -  "invalid character"

</code>```

This is the error i keep getting, The script used to work before. The error is in line 3 but also on any line that has a table.

Body:
I keep getting this error for this script. Thanks for your help

INSERT INTO %Table(UO_PROFESR_ISTG)
 SELECT DISTINCT %ProcessInstance
 , CI.EMPLID
 ,NVL((
 SELECT EXT.EXTERNAL_SYSTEM_ID
  FROM %Table(EXTERNAL_SYSTEM) EXT
 WHERE EXT.EXTERNAL_SYSTEM = 'HRX'
   AND EXT.EFFDT = (
 SELECT MAX(EXT1.EFFDT)
  FROM %Table(EXTERNAL_SYSTEM) EXT1
 WHERE EXT1.EMPLID = EXT.EMPLID
   AND EXT1.EXTERNAL_SYSTEM = EXT.EXTERNAL_SYSTEM
   AND EXT1.EFFDT <= %CurrentDateIn)
   AND EXT.EMPLID = CI.EMPLID),' ' ) , NVL ((
 SELECT EXT.EXTERNAL_SYSTEM_ID
  FROM %Table(EXTERNAL_SYSTEM) EXT
 WHERE (EXT.EXTERNAL_SYSTEM = 'HRE'
    OR EXT.EXTERNAL_SYSTEM = 'HRW')
   AND EXT.EFFDT = (
 SELECT MAX(EXT1.EFFDT)
  FROM %Table(EXTERNAL_SYSTEM) EXT1
 WHERE EXT1.EMPLID = EXT.EMPLID
   AND EXT1.EXTERNAL_SYSTEM = EXT.EXTERNAL_SYSTEM
   AND EXT1.EFFDT <= %CurrentDateIn)
   AND EXT.EMPLID = CI.EMPLID), ' ') ,(
 SELECT NAME1.LAST_NAME
  FROM %Table(NAMES) NAME1
 WHERE NAME1.EFFDT = (
 SELECT MAX(NAME2.EFFDT)
  FROM %Table(NAMES) NAME2
 WHERE NAME2.EMPLID = NAME1.EMPLID
   AND NAME2.NAME_TYPE = NAME1.NAME_TYPE
   AND NAME2.EFFDT <= %CurrentDateIn
   AND NAME2.EFF_STATUS = 'A')
   AND NAME1.NAME_TYPE = 'PRI'
   AND NAME1.EMPLID = CI.EMPLID), (
 SELECT NAME1.FIRST_NAME
  FROM %Table(NAMES) NAME1
 WHERE NAME1.EFFDT = (
 SELECT MAX(NAME2.EFFDT)
  FROM %Table(NAMES) NAME2
 WHERE NAME2.EMPLID = NAME1.EMPLID
   AND NAME2.NAME_TYPE = NAME1.NAME_TYPE
   AND NAME2.EFFDT <= %CurrentDateIn
   AND NAME2.EFF_STATUS = 'A')
   AND NAME1.NAME_TYPE = 'PRI'
   AND NAME1.EMPLID = CI.EMPLID) ,NVL( (
 SELECT CP.LANG_CD
  FROM %Table(SCC_COMM_PREF) CP
 WHERE CP.EMPLID = CI.EMPLID), ' ') ,NVL( (
 SELECT EMAIL.EMAIL_ADDR
  FROM %Table(EMAIL_ADDRESSES) EMAIL
 WHERE EMAIL.EMPLID = CI.EMPLID
   AND EMAIL.E_ADDR_TYPE = 'UOTE') , ' ') , NVL( (
 SELECT EMAIL.EMAIL_ADDR
  FROM %Table(EMAIL_ADDRESSES) EMAIL
 WHERE EMAIL.EMPLID = CI.EMPLID
   AND EMAIL.E_ADDR_TYPE = 'UOTX') , ' ') , NVL( (
 SELECT EMAIL.EMAIL_ADDR
  FROM %Table(EMAIL_ADDRESSES) EMAIL
 WHERE EMAIL.EMPLID = CI.EMPLID
   AND EMAIL.E_ADDR_TYPE = 'UOTS') , ' ')
  FROM %Table(CLASS_INSTR) CI , %Table(INSTR_ADVISOR) INS
 WHERE CI.STRM IN (
 SELECT TRM.STRM
  FROM %Table(TERM_TBL) TRM
 WHERE TRM.INSTITUTION = 'UOTTA'
   AND TRM.ACAD_CAREER = 'UGRD'
   AND TRM.TERM_BEGIN_DT >= %Bind(TERM_BEGIN_DT)
   AND CI.EMPLID <> ' ')
   AND INS.EMPLID = CI.EMPLID
   AND INS.EFFDT = (
 SELECT MAX(INS1.EFFDT)
  FROM %Table(INSTR_ADVISOR) INS1
 WHERE INS1.EMPLID = INS.EMPLID
   AND INS1.INSTITUTION = INS.INSTITUTION
   AND INS1.EFFDT <= %CurrentDateIn)
   AND INS.EFF_STATUS = 'A'

I tried changing the brackets and the syntax. The script used to work before but now It keeps giving me this error. Any help would be appreciated.

Error at Command Line : 3 Column : 13
Error report -
SQL Error: ORA-00911: invalid character
00911. 00000 -  "invalid character"

This is the error i keep getting, The script used to work before. The error is in line 3 but also on any line that has a table.


问:
How to activiti Expressions invoked spring bean
The bpmn file has been deployed to the db.

activiti Docs

hello.bpmn20.xml shows how a method on a Spring bean can be invoked using a UEL method expression
If the code where the Printer is located  is multi-instance deployment,
all instances are linked to the same database. which one will be called by the bpmn file.


问:
realloc invalid pointer C
I have realloc () : invalid pointer when try to initUniversity Test
We have a binary file which consist of students. I need to add all of them in University, but i have this error. What's the problem?
Here is function to add new group

```<code>bool addNewGroup(University *university, const Group group) {
    if (university == NULL) {
        return false;
    }
    university->groupsCount += 1;
    Group *t;
    if (university->groupsCount == 1) {
        if (!(university->groups = calloc(1, sizeof(Group)))) {
            return false;
        }
        university->groups[0] = group;
        return true;
    }
    if (!(t = realloc(university->groups,
        university->groupsCount  * sizeof(Group)))) {
        return false;
    }
    university->groups = t;
    university->groups[university->groupsCount - 1] = group;
    strcpy(university->groups[university->groupsCount - 1].name, group.name);
    return true;
}

char *_strtoupper(char *str) {
    if (str == NULL) {
        return NULL;
    }
    for (int i = 0; i < strlen(str); ++i) {
        if (str[i] > 96 && str[i] < 123) {
                str[i] -=32;
        }
    }
    return str;

}

int strcm(char *s, char *st) {
    char cs[SIZE];
    char cst[SIZE];
    strcpy(cs, s);
    strcpy(cst, st);
    return strcmp(_strtoupper(cs), _strtoupper(cst));
}
here is add new student

bool addNewStudent(Group *group, Student student) {
    if (group == NULL) {
        return false;
    }
    int ind = 0;
    int fl = 0;
    if (student.id == 0) {
        student.id = g_Id;
        ++g_Id;
    }
    ++group->studentsCount;
    Student *t;
    if (group->studentsCount == 1) {
        if (!(group->students = calloc(1, sizeof(Student)))) {
            return false;
        }
        group->students[0] = student;
        return true;
    }
    if (!(t = realloc(group->students, group->studentsCount * sizeof(Student)))) {
        return false;
    }
    group->students = t;
    group->students[group->studentsCount - 1] = student;
    Student tmp;
    for (int i = 0; i < group->studentsCount - 1; ++i) {
        for (int j = 0; j < group->studentsCount - 1 - i; ++j) {
            if (strcm(group->students[j].surname, group->students[j + 1].surname) > 0) {
                tmp = group->students[j];
                group->students[j] = group->students[j + 1];
                group->students[j + 1] = tmp;
            }
        }
    }
    return true;
}

here is problem function

University* initUniversity(const char *fileName) {
    University* un;
    if (!(un = (University *)calloc(1, sizeof(University)))) {
        return un;
    }
    if (fileName == NULL) {
        return un;
    }
    FILE *fd = fopen(fileName, "rb");
    if (fd == NULL) {
        return un;
    }
    Student student;
    Group group;
    char gr[SIZE] = "";
    int i = -1;
    int j = 0;
    unsigned max = 0;
    while (fread(&student,sizeof(Student), 1, fd)) {
        if (student.id > max ) {
            g_Id = student.id + 1;
            max = student.id;
        }
        if (strcmp(gr, student.groupName) != 0) {
            ++i;
            j = 0;
            strcpy(group.name, student.groupName);
            addNewGroup(un, group);
        }
        addNewStudent(&un->groups[i], student);
        strcpy(gr, student.groupName);
        }
    fclose(fd);
    return un;
}
</code>```

here is stuctures used in work

```<code>typedef struct
{
    unsigned long id;       // Уникальный id, получаемый из g_Id
    char name[SIZE];        // Имя
    char surname[SIZE];     // Фамилия
    char groupName[SIZE];   // Название группы
    unsigned birthYear;     // Год рождения
} Student;

// Структура описывающая группу
// Cоздается при чтении, если getGroup() вернула NULL; название группы берется из структуры студента
typedef struct
{
    char name[SIZE];        // Название группы
    unsigned studentsCount; // Количество студентов в группе (размер динамического массива)
    Student *students;      // Динамический массив со студентами
} Group;

// Структура описывающая университет
typedef struct
{
    unsigned groupsCount;   // Количество групп в университете
    Group *groups;          // Динамический массив с группами
} University;
</code>```

I really don't understand what is wrong

Title: realloc invalid pointer C

Body:
I have realloc () : invalid pointer when try to initUniversity Test
We have a binary file which consist of students. I need to add all of them in University, but i have this error. What's the problem?
Here is function to add new group

bool addNewGroup(University *university, const Group group) {
    if (university == NULL) {
        return false;
    }
    university->groupsCount += 1;
    Group *t;
    if (university->groupsCount == 1) {
        if (!(university->groups = calloc(1, sizeof(Group)))) {
            return false;
        }
        university->groups[0] = group;
        return true;
    }
    if (!(t = realloc(university->groups,
        university->groupsCount  * sizeof(Group)))) {
        return false;
    }
    university->groups = t;
    university->groups[university->groupsCount - 1] = group;
    strcpy(university->groups[university->groupsCount - 1].name, group.name);
    return true;
}

char *_strtoupper(char *str) {
    if (str == NULL) {
        return NULL;
    }
    for (int i = 0; i < strlen(str); ++i) {
        if (str[i] > 96 && str[i] < 123) {
                str[i] -=32;
        }
    }
    return str;

}

int strcm(char *s, char *st) {
    char cs[SIZE];
    char cst[SIZE];
    strcpy(cs, s);
    strcpy(cst, st);
    return strcmp(_strtoupper(cs), _strtoupper(cst));
}
here is add new student

bool addNewStudent(Group *group, Student student) {
    if (group == NULL) {
        return false;
    }
    int ind = 0;
    int fl = 0;
    if (student.id == 0) {
        student.id = g_Id;
        ++g_Id;
    }
    ++group->studentsCount;
    Student *t;
    if (group->studentsCount == 1) {
        if (!(group->students = calloc(1, sizeof(Student)))) {
            return false;
        }
        group->students[0] = student;
        return true;
    }
    if (!(t = realloc(group->students, group->studentsCount * sizeof(Student)))) {
        return false;
    }
    group->students = t;
    group->students[group->studentsCount - 1] = student;
    Student tmp;
    for (int i = 0; i < group->studentsCount - 1; ++i) {
        for (int j = 0; j < group->studentsCount - 1 - i; ++j) {
            if (strcm(group->students[j].surname, group->students[j + 1].surname) > 0) {
                tmp = group->students[j];
                group->students[j] = group->students[j + 1];
                group->students[j + 1] = tmp;
            }
        }
    }
    return true;
}

here is problem function

University* initUniversity(const char *fileName) {
    University* un;
    if (!(un = (University *)calloc(1, sizeof(University)))) {
        return un;
    }
    if (fileName == NULL) {
        return un;
    }
    FILE *fd = fopen(fileName, "rb");
    if (fd == NULL) {
        return un;
    }
    Student student;
    Group group;
    char gr[SIZE] = "";
    int i = -1;
    int j = 0;
    unsigned max = 0;
    while (fread(&student,sizeof(Student), 1, fd)) {
        if (student.id > max ) {
            g_Id = student.id + 1;
            max = student.id;
        }
        if (strcmp(gr, student.groupName) != 0) {
            ++i;
            j = 0;
            strcpy(group.name, student.groupName);
            addNewGroup(un, group);
        }
        addNewStudent(&un->groups[i], student);
        strcpy(gr, student.groupName);
        }
    fclose(fd);
    return un;
}

here is stuctures used in work

typedef struct
{
    unsigned long id;       // Уникальный id, получаемый из g_Id
    char name[SIZE];        // Имя
    char surname[SIZE];     // Фамилия
    char groupName[SIZE];   // Название группы
    unsigned birthYear;     // Год рождения
} Student;

// Структура описывающая группу
// Cоздается при чтении, если getGroup() вернула NULL; название группы берется из структуры студента
typedef struct
{
    char name[SIZE];        // Название группы
    unsigned studentsCount; // Количество студентов в группе (размер динамического массива)
    Student *students;      // Динамический массив со студентами
} Group;

// Структура описывающая университет
typedef struct
{
    unsigned groupsCount;   // Количество групп в университете
    Group *groups;          // Динамический массив с группами
} University;

I really don't understand what is wrong


问:
Optimizing queries with acts_as_taggable_on
Using Rails 3.1 and gem 'acts-as-taggable-on' version 2.1.1.

I have a class:

```<code>class Meal < ActiveRecord::Base
  acts_as_taggable_on :foods
  ...
end
</code>```

I have several different scopes on Meal that I use on a dashboard-type page. In the controller, I call, for example:

```<code>def index
  @today = Meal.from_today
  @yesterday = Meal.from_yesterday
end
</code>```

I iterate over @today and @yesterday separately on the dashboard page.

I'd like to optimize the database calls. Right now, I call <%= meal.food_list %> in the view while iterating over each meal in both @today and @yesterday. For each meal, it queries the database to find the foods.

I've been trying to chain the queries in the controller with something like:

@today = Meal.from_today.includes(:foods)

but that doesn't work. Given this situation, how should I optimize the queries? Am I misusing acts-as-taggable-on?

ContentLicense: CC BY-SA 3.0

Body:
Using Rails 3.1 and gem 'acts-as-taggable-on' version 2.1.1.

I have a class:

class Meal < ActiveRecord::Base
  acts_as_taggable_on :foods
  ...
end

I have several different scopes on Meal that I use on a dashboard-type page. In the controller, I call, for example:

def index
  @today = Meal.from_today
  @yesterday = Meal.from_yesterday
end

I iterate over @today and @yesterday separately on the dashboard page.

I'd like to optimize the database calls. Right now, I call <%= meal.food_list %> in the view while iterating over each meal in both @today and @yesterday. For each meal, it queries the database to find the foods.

I've been trying to chain the queries in the controller with something like:

@today = Meal.from_today.includes(:foods)

but that doesn't work. Given this situation, how should I optimize the queries? Am I misusing acts-as-taggable-on?


问:
How to solve parse error while using pandas script
Consider the following pipe-delimited file called SrcFile.csv:

col1|col2|col3 1|A|4 2|B|5 3|**test1|test2|test3**|6

Here,line 4 has 3 fields as it contains two pipe symbol after test1 and test2, which results in the ParserError.

I'm using the below script for this conversion. However, many rows are getting skipped as I have records like

col1|col2|col3 3|**test1|test2|test3**|6
4|test1|test2|test3|7`

Is there anyway to handle this parse error by adding TEXT QUALIFIER as | symbol

Script Tried

`import os
os.chdir("/opt/alb_test/alb/albt1/Source/alb/al/conversion/scrpt")

Reading the csv file

import pandas as pd
print(pd.file)

col_names=["C1","C2","C3"]

df_new  = pd.read_csv("SrcFile.csv", names=col_names, sep="\t",skiprows=1, low_memory=False,error_bad_lines=False,header=None).dropna(axis=1, how="all")

saving xlsx file

df_new.to_excel("SrcFile.xlsx", index=False)
`

I need to check if there is anyway to handle parse error by TEXT QUALIFIER as | symbol


问:
JS Generate Html table multi header based on a dictionnary
Im trying to generate an HTML table based on this dictionnary in JS :

const data = {
  Schools: {
    school_1: {
      class_1: ["student_1"],
      size: 1, // nb class/group in the section
    },
    size: 1,
  },
  "High schools": {
    "high school_1": {
      class_1: ["student_1", "student_2"],
      size: 1,
    },
    "high school_2": {
      class_3: {
        group_1: ["student_1", "student_3"],
        group_2: ["student_2"],
        size: 2,
      },
      class_4: ["student_1", "student_3"],
      size: 3, // 2 group in class_3 + class_4
    },
    size: 4,
  },
};
```
<p>The 'size' attribute is used to set the 'colspan' value in the html table.
The depth of the dictionnary may change like add group or sub group.</p>
<p>Table to generate :</p>
<pre class="lang-html prettyprint-override"><code><table class="table table-striped table-bordered text-center w-100" style="overflow: scroll">
  <thead>
  <tr>
    <th scope="col" colspan="1">#</th>
    <th scope="col" colspan="1">Schools</th>
    <th scope="col" colspan="4">High schools</th>
  </tr>
  </thead>
  <tbody>
  <tr>
    <th scope="col" colspan="1">#</th>
    <th scope="col" colspan="1">school_1</th>
    <th scope="col" colspan="1">high school_1</th>
    <th scope="col" colspan="3">high school_2</th>
  </tr>
  <tr>
    <th scope="col" colspan="1">#</th>
    <th scope="col" colspan="1">class_1</th>
    <th scope="col" colspan="1">class_1</th>
    <th scope="col" colspan="2">class_3</th>
    <th scope="col" colspan="1">class_4</th>
  </tr>
  <tr>
    <th scope="col" colspan="1">#</th>
    <th scope="col" colspan="1"></th>
    <th scope="col" colspan="1"></th>
    <th scope="col" colspan="1">group_1</th>
    <th scope="col" colspan="1">group_2</th>
    <th scope="col" colspan="1"></th>
  </tr>
  <tr>
    <th scope="row">student_1</th>
    <td>Yes</td>
    <td>Yes</td>
    <td>Yes</td>
    <td>No</td>
    <td>Yes</td>
  </tr>
  <tr>
    <th scope="row">student_2</th>
    <td>No</td>
    <td>Yes</td>
    <td>No</td>
    <td>Yes</td>
    <td>No</td>
  </tr>
  <tr>
    <th scope="row">student_3</th>
    <td>No</td>
    <td>No</td>
    <td>Yes</td>
    <td>No</td>
    <td>Yes</td>
  </tr>
  </tbody>
</table>
</code>```

For the moment, I did not find a good solution :(
I'm using bootstrap to show the table with multiple index.
Maybe the html structure I used is not the good way but with bootstrap 4, I dont see another way to have the same result.

Help please...

Body:
Im trying to generate an HTML table based on this dictionnary in JS :

const data = {
  Schools: {
    school_1: {
      class_1: ["student_1"],
      size: 1, // nb class/group in the section
    },
    size: 1,
  },
  "High schools": {
    "high school_1": {
      class_1: ["student_1", "student_2"],
      size: 1,
    },
    "high school_2": {
      class_3: {
        group_1: ["student_1", "student_3"],
        group_2: ["student_2"],
        size: 2,
      },
      class_4: ["student_1", "student_3"],
      size: 3, // 2 group in class_3 + class_4
    },
    size: 4,
  },
};

The 'size' attribute is used to set the 'colspan' value in the html table.
The depth of the dictionnary may change like add group or sub group.

Table to generate :

    #
    Schools
    High schools

    #
    school_1
    high school_1
    high school_2

    #
    class_1
    class_1
    class_3
    class_4

    #

    group_1
    group_2

    student_1
    Yes
    Yes
    Yes
    No
    Yes

    student_2
    No
    Yes
    No
    Yes
    No

    student_3
    No
    No
    Yes
    No
    Yes

For the moment, I did not find a good solution :(
I'm using bootstrap to show the table with multiple index.
Maybe the html structure I used is not the good way but with bootstrap 4, I dont see another way to have the same result.

Help please...


问:
Excel Map Chart automatically expands when I don't want it to
I have 250 rows in Excel that I wanted to make a zip code map with.  I included a table slicer to select a state. This works great some of the time.  If I choose Maine which has just one record, the chart is around 25 rows tall (default row size).  If I choose New York with 12 records, the map expands slightly to about 30 rows.  But if I choose Pennsylvania which has 181 records, the chart expands to around 250 rows tall and I needs to scroll way down to see my map of PA.  How can I keep the size of the chart static to prevent scrolling down for one state and back up for another?</p>


问:
Is it possible to set a Hibernate Query Hint by default in a Spring Boot application?
I must use the Hibernate Query Hint HINT_PASS_DISTINCT_THROUGH in every requests that uses DISTINCT keyword in my Spring Boot application.
Instead of setting the hint with the @QueryHint annotation or the Query.setHint method, I'm wondering if there's a way to set it once for all queries, for example with an application property?


问:
ASP.Net MVC connections trying to remote SQL Server, unexpectedly creating a table
I am using the following connection string to connect to a SQL Server database

```<code>Data Source=ip,1433;Initial Catalog=mydb;User ID=dev_user;Password=testPassword
</code>```

But instead of connecting, I am getting the following error

System.Data.SqlClient.SqlException: 'CREATE TABLE permission denied in database 'mydb'.

Installing Hangfire SQL objects...

Database schema [HangFire] already exists'

Why is it creating a database instead of connecting to SQL Server?

I have tried setting with Integrated Security to either true or SSPI, but I'm getting this error:

The target principal name is incorrect. Cannot generate SSPI contex" error instead

What am I missing?

Body:
I am using the following connection string to connect to a SQL Server database

Data Source=ip,1433;Initial Catalog=mydb;User ID=dev_user;Password=testPassword

But instead of connecting, I am getting the following error

System.Data.SqlClient.SqlException: 'CREATE TABLE permission denied in database 'mydb'.

Installing Hangfire SQL objects...

Database schema [HangFire] already exists'

Why is it creating a database instead of connecting to SQL Server?

I have tried setting with Integrated Security to either true or SSPI, but I'm getting this error:

The target principal name is incorrect. Cannot generate SSPI contex" error instead

What am I missing?