问:
How to make the list into table Django?
I have got an a list:

```<code>[{'name': 'WEB-Разработчик/программист (SEO-правки)', 'description': 'Hastra Agency ищет разработчика с опытом работы с связи с ростом отдела SEO-продвижения. Требуемый о...', 'key_skills': ['HTML', 'CSS', 'MySQL', 'PHP', 'SEO'], 'employer': 'Hastra Agency', 'salary': 'None - 60000 RUR', 'area': 'Москва', 'published_at': '2022-12-12', 'alternate_url': 'https://hh.ru/vacancy/73732873'}, {'name': 'Веб-разработчик golang, react, vue, nuxt, angular, websockets', 'description': 'Обязанности: Стек: react, vue, nuxt, angular, websockets, golang Поддержка текущего проекта с сущест...', 'key_skills': [], 'employer': 'МегаСео', 'salary': '150000 - None RUR', 'area': 'Москва', 'published_at': '2022-12-12', 'alternate_url': 'https://hh.ru/vacancy/73705217'}, ....., ......
</code>```

Array is with 10 lists.

How can I make it into table? CSV file?

Columns are name, description, key_skills ...

Rows are 1, 2, 3, 4, 5 ...

I need to make this table in Django, how can I do it?

Title: How to make the list into table Django?

Body:
I have got an a list:

[{'name': 'WEB-Разработчик/программист (SEO-правки)', 'description': 'Hastra Agency ищет разработчика с опытом работы с связи с ростом отдела SEO-продвижения. Требуемый о...', 'key_skills': ['HTML', 'CSS', 'MySQL', 'PHP', 'SEO'], 'employer': 'Hastra Agency', 'salary': 'None - 60000 RUR', 'area': 'Москва', 'published_at': '2022-12-12', 'alternate_url': 'https://hh.ru/vacancy/73732873'}, {'name': 'Веб-разработчик golang, react, vue, nuxt, angular, websockets', 'description': 'Обязанности: Стек: react, vue, nuxt, angular, websockets, golang Поддержка текущего проекта с сущест...', 'key_skills': [], 'employer': 'МегаСео', 'salary': '150000 - None RUR', 'area': 'Москва', 'published_at': '2022-12-12', 'alternate_url': 'https://hh.ru/vacancy/73705217'}, ....., ......

Array is with 10 lists.

How can I make it into table? CSV file?

Columns are name, description, key_skills ...

Rows are 1, 2, 3, 4, 5 ...

I need to make this table in Django, how can I do it?


来源: stackexchange

问:
how to aggregate events received within specific time?
I'm consuming messages from readStream, but in messages I dont have any time based column. In my scenario, I want to aggregate all messages I received in every last 10 mins.

How can I achieve this in spark ? I saw tumbling window function but it works only on timestamp column which is already coming in message.

Any suggestion please ?

Thanks

ContentLicense: CC BY-SA 4.0


问:
`GlueSchemaRegistryDeserializerDataParser` replacement in aws-sdk-java-v2
We're using the GlueSchemaRegistryDeserializerDataParser class from https://github.com/awslabs/aws-glue-schema-registry.

This seems to be from the v1 of the AWS SDK (or am I wrong?)

Is there a replacement in aws-sdk-java-v2?


问:
Flask session not preserved on mobile browser
I'm new to Flask and I decided that the best way to learn it is to jump straight in the deep end and try to make an app from scratch. I have successfully made it and it works perfectly on desktop, but sessions aren't maintained when I try to use my mobile. I have an iPhone 12 and I've tried it on Chrome, Safari, Opera and Firefox and none work. It works on Edge, Chrome and Firefox (those were all I tested on) on my desktop PC.

Here is my init file:

```<code>from flask import Flask, jsonify, request, make_response, render_template, session, redirect, url_for

app = Flask(__name__)
app.config['SECRET_KEY'] = "Actual one is a fixed, random string like 89hsfd98sdhf89u983qwj9"

@app.route('/')
def index(): return render_template('index.html')

# This is where the session is created
@app.route('/player/add', methods=['POST'])
def player_add():
     req = request.get_json()
     session['session_key'] = _generate_session_key(STRING_LENGTH)
     session['name'] = req['name']
     return make_response(jsonify({"result": player.player_add(req['name'], session['session_key'])}), 200)

# This is the important one where the session is called
@app.route('/player', methods=['GET'])
def get_session_name():
     try:
          if not _valid_session(): return make_response(jsonify({'status': False}), 200)
          data = player.player_info(session['name'])
     except: data = {'status': False}
     return make_response(jsonify(data), 200)
"""
Many more app routes
"""

if __name__ == '__main__':
    app.run()`
</code>```

If it helps, I communicate with the Flask server from the frontend using fetch like this:

```<code>fetch(`${window.origin}/player`, {
    method: "GET",
    credentials: "include",
    cache: "no-cache",
    headers: new Headers({
        "content-type": "application/json"
    })
}).then(...)
</code>```

If a session has been made, then the app will display the user's entered name. If not, it will prompt the user to enter their name (and start a session). Again, it works perfectly on desktop browsers, but with mobile it just responding as if no session has been created (which is {'status': False}).

There's probably a lot of bad practice here, but I've been researching for a while and I have no idea why it would only work on desktop and not mobile. Please let me know if I should provide more information.

The site is being hosted on PythonAnywhere, if that helps. No errors on the console or from the backend.

Any help or guidance would be greatly appreciated! Even if the problem persists, at least being able to use it on mobile with a few temporary settings changes would be alright.

I've tried:

Using credentials: "same-origin" when calling fetch

Setting:

app.config["SESSION_TYPE"] = "filesystem

app.config["SESSION_PERMANENT"] = False

app.config['SESSION_COOKIE_SECURE'] = True

app.config['SESSION_COOKIE_SAMESITE'] = 'None'

Using HTTPS instead of HTTP

Disabled 'Prevent Cross-Site Tracking' (essentially allowing for third-party cookies)

Clearing the sessions and regenerating the SECRET_KEY

Clearing all stored cookies and history in the browser

Body:
I'm new to Flask and I decided that the best way to learn it is to jump straight in the deep end and try to make an app from scratch. I have successfully made it and it works perfectly on desktop, but sessions aren't maintained when I try to use my mobile. I have an iPhone 12 and I've tried it on Chrome, Safari, Opera and Firefox and none work. It works on Edge, Chrome and Firefox (those were all I tested on) on my desktop PC.

Here is my init file:

from flask import Flask, jsonify, request, make_response, render_template, session, redirect, url_for

app = Flask(__name__)
app.config['SECRET_KEY'] = "Actual one is a fixed, random string like 89hsfd98sdhf89u983qwj9"

@app.route('/')
def index(): return render_template('index.html')

# This is where the session is created
@app.route('/player/add', methods=['POST'])
def player_add():
     req = request.get_json()
     session['session_key'] = _generate_session_key(STRING_LENGTH)
     session['name'] = req['name']
     return make_response(jsonify({"result": player.player_add(req['name'], session['session_key'])}), 200)

# This is the important one where the session is called
@app.route('/player', methods=['GET'])
def get_session_name():
     try:
          if not _valid_session(): return make_response(jsonify({'status': False}), 200)
          data = player.player_info(session['name'])
     except: data = {'status': False}
     return make_response(jsonify(data), 200)
"""
Many more app routes
"""

if __name__ == '__main__':
    app.run()`

If it helps, I communicate with the Flask server from the frontend using fetch like this:

fetch(`${window.origin}/player`, {
    method: "GET",
    credentials: "include",
    cache: "no-cache",
    headers: new Headers({
        "content-type": "application/json"
    })
}).then(...)

If a session has been made, then the app will display the user's entered name. If not, it will prompt the user to enter their name (and start a session). Again, it works perfectly on desktop browsers, but with mobile it just responding as if no session has been created (which is {'status': False}).

There's probably a lot of bad practice here, but I've been researching for a while and I have no idea why it would only work on desktop and not mobile. Please let me know if I should provide more information.

The site is being hosted on PythonAnywhere, if that helps. No errors on the console or from the backend.

Any help or guidance would be greatly appreciated! Even if the problem persists, at least being able to use it on mobile with a few temporary settings changes would be alright.

I've tried:

Using credentials: "same-origin" when calling fetch

Setting:

app.config["SESSION_TYPE"] = "filesystem

app.config["SESSION_PERMANENT"] = False

app.config['SESSION_COOKIE_SECURE'] = True

app.config['SESSION_COOKIE_SAMESITE'] = 'None'

Using HTTPS instead of HTTP

Disabled 'Prevent Cross-Site Tracking' (essentially allowing for third-party cookies)

Clearing the sessions and regenerating the SECRET_KEY

Clearing all stored cookies and history in the browser


问:
How salesforce, neverbounce etc companies provide active user details?
I wish to understand how companies like salesforce, returnpath, neverbounce etc provide information about email id's state. For example if you say abhishek@gmail.com, then these companies can tell you whether this email id is active or cold email address.
I am having few queries regarding this.</p>
```<code>1. Does Email provider share information of email id with these companies?
2. Can we rely over the result which these companies provide about email ids state?
3. How this data reach to these companies?
</code>```

Body:
I wish to understand how companies like salesforce, returnpath, neverbounce etc provide information about email id's state. For example if you say abhishek@gmail.com, then these companies can tell you whether this email id is active or cold email address.
I am having few queries regarding this.

1. Does Email provider share information of email id with these companies?
2. Can we rely over the result which these companies provide about email ids state?
3. How this data reach to these companies?


问:
Symfony 6.2 API & Postman: return status code 200 on HttpException with different status code
When i throw an Http exception in my crud API, to avoid that symfony returns the complete error stack trace, i handle the exception with this listener:

```<code>class ExceptionListener implements EventSubscriberInterface
{
    public function onKernelException(ExceptionEvent $event): void
    {
        // You get the exception object from the received event
        $exception = $event->getThrowable();
        $message = sprintf(
            'My Error says: %s with code: %s',
            $exception->getMessage(),
            $exception->getCode()
        );

        // Customize your response object to display the exception details
        $response = new JsonResponse(['error' => $message]);

        // HttpExceptionInterface is a special type of exception that
        // holds status code and header details
        if ($exception instanceof HttpExceptionInterface) {
            $response->setStatusCode($exception->getStatusCode());
            $response->headers->set( 'X-Status-Code', $exception->getStatusCode());
            $response->headers->replace($exception->getHeaders());
        } else {
            $response->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR);
        }

        // sends the modified response object to the event
        $event->setResponse($response);
    }

    public static function getSubscribedEvents()
    {
        return [
            KernelEvents::EXCEPTION => ['onKernelException', 256],
        ];
    }
}
</code>```

So on Postman i can see

```<code>{
    "error": "My Error says: Invalid body format with code: 0"
}
</code>```

instead of the error stacktrace in html, but the status code remains 200.

Response on postman

Can you help me?

With xdebug i've seen that $response->statusCode is correctly setted to 400.

My service.yaml

```<code>  App\EventListener\ExceptionListener:
    tags:
      - { name: kernel.event_listener, event: kernel.exception,  method: onKernelException }
</code>```

Body:
When i throw an Http exception in my crud API, to avoid that symfony returns the complete error stack trace, i handle the exception with this listener:

class ExceptionListener implements EventSubscriberInterface
{
    public function onKernelException(ExceptionEvent $event): void
    {
        // You get the exception object from the received event
        $exception = $event->getThrowable();
        $message = sprintf(
            'My Error says: %s with code: %s',
            $exception->getMessage(),
            $exception->getCode()
        );

        // Customize your response object to display the exception details
        $response = new JsonResponse(['error' => $message]);

        // HttpExceptionInterface is a special type of exception that
        // holds status code and header details
        if ($exception instanceof HttpExceptionInterface) {
            $response->setStatusCode($exception->getStatusCode());
            $response->headers->set( 'X-Status-Code', $exception->getStatusCode());
            $response->headers->replace($exception->getHeaders());
        } else {
            $response->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR);
        }

        // sends the modified response object to the event
        $event->setResponse($response);
    }

    public static function getSubscribedEvents()
    {
        return [
            KernelEvents::EXCEPTION => ['onKernelException', 256],
        ];
    }
}

So on Postman i can see

{
    "error": "My Error says: Invalid body format with code: 0"
}

instead of the error stacktrace in html, but the status code remains 200.

Response on postman

Can you help me?

With xdebug i've seen that $response->statusCode is correctly setted to 400.

My service.yaml

  App\EventListener\ExceptionListener:
    tags:
      - { name: kernel.event_listener, event: kernel.exception,  method: onKernelException }


问:
Create automation in jira that resolves issue and adds description of said comment to other issue
I keep getting automated support tickets from a system in our infrastructure to jira and the summary always follow the same pattern: [firing] {{issue-name}} or [resolved] {{issue-name}}

So, my goal would be, that when the issue with resolved is created, that it automatically gets cancelled and the ticket with firing and the same issue-name in it gets resolved and a comment added in the issue with the description of the "resolved" issue.

I have tried linking the issues together based on the same name, but jira won't let me do that in automation.

I hope you guys have an idea on how to fix it!

We are currently using Jira 8.20.10


问:
How to create an registration form in django and create an qr code for the given data also store data in mysql database
create an platform with Django that gets input from the user about their name, states and cities in India and create QR code for it , also the data needs to be stored in Mysql database.
The states and cities should be in dependent dropdown.

If anyone can create this project, please send the code to me via email.

Thanks for accepting!


问:
Laravel 9 sFTP Unable to write file at location text.txt. not able to write the file
I am trying to create a file on a sFtp server:

Storage::disk('backup')->put('text.txt', 'My Text');

Unfortunately, I only get the following error message back, which I can't do anything with:

League\Flysystem\UnableToWriteFile

Unable to write file at location: text.txt. not able to write the file`

I have checked the permissions for the directory, they are ok.

My Filesystem config:

```<code>'backup' => [
        'driver' => 'sftp',
        'host' => env('SFTP_HOST'),

        // Settings for basic authentication...
        'username' => env('SFTP_USERNAME'),
        'password' => env('SFTP_PASSWORD'),

        'throw' => true,
    ],
</code>```

Body:
I am trying to create a file on a sFtp server:

Storage::disk('backup')->put('text.txt', 'My Text');

Unfortunately, I only get the following error message back, which I can't do anything with:

League\Flysystem\UnableToWriteFile

Unable to write file at location: text.txt. not able to write the file`

I have checked the permissions for the directory, they are ok.

My Filesystem config:

'backup' => [
        'driver' => 'sftp',
        'host' => env('SFTP_HOST'),

        // Settings for basic authentication...
        'username' => env('SFTP_USERNAME'),
        'password' => env('SFTP_PASSWORD'),

        'throw' => true,
    ],


问:
Using np.where as an interval boundary
If I use the following code:

```<code>def edge_rollover(data, phi_width, phi_height, phi_width_fine, phi_height_fine):
    length = int(np.size(data) // 2)
    step_width_limit = 0.001

    limit = [0, 0]
    k = length - 1

    interval_start = int(np.where(data[:, 0] == 0.1)[0])

    print(interval_start)

    for i in range(k, interval_start, -1):
        x_1 = data[i, 0]
        x_2 = data[np.where(data[:,0]-data[0,0] == data[i,0]-0.1), 0]
        y_1 = data[i, 1]
        y_2 = data[np.where(data[:,1]-data[0,1] == data[i,1]-0.1), 1]
</code>```

I get the following error:

```<code>TypeError: only size-1 arrays can be converted to Python scalars
</code>```

Which I dont understand. The np.where method should only return the index of the value 0.1. So why can I not turn it into an integer or if thats not the problem then why can I not use it as a boundary for the interval?

Title: Using np.where as an interval boundary

Body:
If I use the following code:

def edge_rollover(data, phi_width, phi_height, phi_width_fine, phi_height_fine):
    length = int(np.size(data) // 2)
    step_width_limit = 0.001

    limit = [0, 0]
    k = length - 1

    interval_start = int(np.where(data[:, 0] == 0.1)[0])

    print(interval_start)

    for i in range(k, interval_start, -1):
        x_1 = data[i, 0]
        x_2 = data[np.where(data[:,0]-data[0,0] == data[i,0]-0.1), 0]
        y_1 = data[i, 1]
        y_2 = data[np.where(data[:,1]-data[0,1] == data[i,1]-0.1), 1]

I get the following error:

TypeError: only size-1 arrays can be converted to Python scalars

Which I dont understand. The np.where method should only return the index of the value 0.1. So why can I not turn it into an integer or if thats not the problem then why can I not use it as a boundary for the interval?


问:
Laravel When clicked on button with a question on it, a input will appear with the question pre filled in
First of all i am pretty much a beginner to programming, so im sorry if i didn't explain it well. In my database i have stored over 30 questions, with 2 table names called 'vraag' (questions) and 'antwoorden'(answers). I display all the 'vraag'(questions) as a button seperately. When i click on the button there appears a popup menu with a few input fields. That'll look like this: here

the menu on the right is the menu that pops up when a button is clicked. The thing what i want to do is that when a question has been clicked, it doesn't matter which one. That the clicked question is pre filled in the input field under the "Vraag" which is in my code "inpt4". With my code now it only shows the first question, no matter which question i click on, instead of every question different. Here is my code:

```<code><div class="vragen">
    @foreach ($vragen as $vraag)
    <br>
        <br>
            <button type="submit" class="{{ $vraag["class"] }}" onclick="openPopup()">{{ $vraag["omschrijving"] }}</button>
    @endforeach
</div>

@foreach($vragen as $vraag)
<div class="popup" id="popup">

<!--<div class="id">
        <label for="">ID</label>
    </div> -->

    <div class="antwoord">
        <label for="">Antwoorden</label>
    </div>

    <div class="vraag">
        <label for="">Vraag</label>
    </div>

    <br>

    <div class="vvid">
        <label for="">Volgende Vraag ID</label>
    </div>

    <div class="inpt1">
        <input type="text" value="">
    </div>

    <br>

    <div class="inpt2">
        <input type="text" name="name">
    </div>

    <div class="inpt3">
        <input type="button" onclick="closePopup()" value="Opslaan"/>
    </div>

    <div class="inpt4">
        <input type="text" value="{{ $vraag["omschrijving"] }}">
    </div>

    <div class="inpt5">
        <input type="text" value="">
    </div>

    <div class="inpt6">
        <input type="text" name="name">
    </div>

</div>

@endforeach
</code>```

Body:
First of all i am pretty much a beginner to programming, so im sorry if i didn't explain it well. In my database i have stored over 30 questions, with 2 table names called 'vraag' (questions) and 'antwoorden'(answers). I display all the 'vraag'(questions) as a button seperately. When i click on the button there appears a popup menu with a few input fields. That'll look like this: here

the menu on the right is the menu that pops up when a button is clicked. The thing what i want to do is that when a question has been clicked, it doesn't matter which one. That the clicked question is pre filled in the input field under the "Vraag" which is in my code "inpt4". With my code now it only shows the first question, no matter which question i click on, instead of every question different. Here is my code:

    @foreach ($vragen as $vraag)

            <button type="submit" class="{{ $vraag["class"] }}" onclick="openPopup()">{{ $vraag["omschrijving"] }}</button>
    @endforeach

@foreach($vragen as $vraag)

        Antwoorden

        Vraag

        Volgende Vraag ID

        <input type="text" value="">

        <input type="text" name="name">

        <input type="button" onclick="closePopup()" value="Opslaan"/>

        <input type="text" value="{{ $vraag["omschrijving"] }}">

        <input type="text" value="">

        <input type="text" name="name">

@endforeach


问:
MAMP Pro 2.0.3 doesn't work in OS-X Lion
see https://superuser.com/q/338471/98725

When I start MAMP Pro 2.0.3 on Mac OS X Lion I get the following error:

Apache wasn't able to start. Please check log for more information.

When I look at the Console it says:

kernel: nstat_lookup_entry failed: 2

Anyone know what I need to do to fix this?

Thanks,
Dan

ContentLicense: CC BY-SA 3.0


问:
calculate monthly report
I am trying to display reports in which based on employee code, I have to display how many days he/she presents on monthly basis.

```<code>Emp_Code    Date    Attendance
1001    2023-01-01  1
1001    2023-01-02  1
1001    2023-01-03  1
1001    2023-01-04  1
1001    2023-01-05  0
1001    2023-01-06  0
1001    2023-01-07  1
1001    2023-01-08  1
.
.
.
1002    2023-01-01  1
1002    2023-01-02  0
1002    2023-01-03  1
.
.
.
1003    2023-01-01  1
</code>```

Attendance is a boolean column (0,1) 0 - This means the employee is absent, and 1 Means the employee is present on that day.

SQL query to Calculate monthly report as follow:

```<code>1001 Jan 2
1001 Feb 1
1001 Mar 0
1001 Apr 2
</code>```

I wrote the query but shows me the number of present days, can anyone help me to correct it plz?

```<code>SELECT Emp_Code,MAX(DATENAME(MM,Date)) AS MonthWisePresentOrAbsent, COUNT(1) AS "DaysAbsent"
FROM tblEmployee GROUP BY MONTH(Date),Emp_Code;
</code>```

Edit Question 1
it is a simple concept like every day in January month, 1 to 25 days if I am present then the last column contains the 1 and for 26 to 31 it contains 0.

Title: calculate monthly report

Body:
I am trying to display reports in which based on employee code, I have to display how many days he/she presents on monthly basis.

Emp_Code    Date    Attendance
1001    2023-01-01  1
1001    2023-01-02  1
1001    2023-01-03  1
1001    2023-01-04  1
1001    2023-01-05  0
1001    2023-01-06  0
1001    2023-01-07  1
1001    2023-01-08  1
.
.
.
1002    2023-01-01  1
1002    2023-01-02  0
1002    2023-01-03  1
.
.
.
1003    2023-01-01  1

Attendance is a boolean column (0,1) 0 - This means the employee is absent, and 1 Means the employee is present on that day.

SQL query to Calculate monthly report as follow:

1001 Jan 2
1001 Feb 1
1001 Mar 0
1001 Apr 2

I wrote the query but shows me the number of present days, can anyone help me to correct it plz?

SELECT Emp_Code,MAX(DATENAME(MM,Date)) AS MonthWisePresentOrAbsent, COUNT(1) AS "DaysAbsent"
FROM tblEmployee GROUP BY MONTH(Date),Emp_Code;

Edit Question 1
it is a simple concept like every day in January month, 1 to 25 days if I am present then the last column contains the 1 and for 26 to 31 it contains 0.


问:
Add 'Zoom' Image effect on scroll (Using Shopify)
I'm trying to add this scroll effect to BG images (Like this site https://www.rhodeskin.com/)

When you scroll down it zooms out and when you scroll up it zooms in.


问:
Is there an Python function equivalent for Java's Runnable? (Multiple Lines)
I'm converting some Java examples to Python and I've seen direct function callers in these examples. Well, there's no problem, because I'm using lambda when it is one line (It's totally fine). However, I would like to discover if a form exists to express without creating a function like def keyword or call into a string as exec().

Example:

```<code>genericObject.onTrue(
    callWithRunnable(
        () -> { // If this were one line, I could use a lambda here (Python's Callable)
            function1();
            function2();
        },
    )
);
</code>```

Body:
I'm converting some Java examples to Python and I've seen direct function callers in these examples. Well, there's no problem, because I'm using lambda when it is one line (It's totally fine). However, I would like to discover if a form exists to express without creating a function like def keyword or call into a string as exec().

Example:

genericObject.onTrue(
    callWithRunnable(
        () -> { // If this were one line, I could use a lambda here (Python's Callable)
            function1();
            function2();
        },
    )
);


问:
How can one guarantee the availability of the SSH daemon under a memory pressure?
Are there measures one can take to guarantee, or at least increase, the ability to access the server via SSH, regardless of the level of its resources' usage (CPU, memory, etc.)? What happened was that a runaway Puma web server used up all of the available memory and the server became inaccessible.

To rephrase the question, how can one guarantee or increase the availability of the SSH daemon under, in this case, a memory pressure? Availability enough for one to SSH onto the server and pkill the problematic process(es).

If it helps, the VM in question is an AWS EC2 instance (t3a.medium with 4 GB RAM).


问:
How to enable traefik ingress routes to send traffic to mutliple ports using single URL
I have a two containers running in a namespace in K3s cluster where for example port 1001 is exposed on container foo and port 1002 is exposed on container bar. I have configured kubernetes services to map host ports and container ports 1001:1001 and 1002:1002.

I have written ingress.yaml file as below:

```<code>apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: ingress
  namespace: project
spec:
  entryPoints:
    - websecure
  routes:
  - kind: Rule
    match: Host(`abc.xyz.com`)
    priority: 1
    services:
    - kind: Service
      name: foo
      namespace: project
      port: port-foo   #name of the service endpoint port 1001 which targets container's 1001
    - kind: Service
      name: bar
      namespace: project
      port: port-bar   #name of the service endpoint port 1002 which targets container's 1002
  tls:
    domains:
      - main: xyz
        sans:
          - "*.xyz.com"
    secretName: xyz-cert

</code>```

Overall configuration is as below:

```<code>NAME                          READY   STATUS    RESTARTS   AGE
pod/foo-45521ddb4f-gk2ed      1/1     Running   0          45h
pod/bar-45599346df-p1rtd      1/1     Running   0          45h

NAME             TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
service/foo      ClusterIP   92.33.XX.XX   <none>        1001/TCP   45h
service/bar      ClusterIP   92.33.XX.XX    <none>        1002/TCP   45h

NAME                     READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/foo      1/1     1            1           45h
deployment.apps/bar      1/1     1            1           45h

NAME                                DESIRED   CURRENT   READY   AGE
replicaset.apps/foo-45521ddb4f      1         1         1       45h
replicaset.apps/bar-45599346df      1         1         1       45h

NAME     ENDPOINTS          AGE
foo      92.45.X.X:1001   45h
bar      92.51.X.X:1002    45h
</code>```

So when I hit the url abc.xyz.com in browser each time, it is loadbalancing to different ports each time (round-robin) and when I hit abc.xyz.com:1001 and abc.xyz.com:1002 , it returns the error response the page can't be reached. My objective is to route traffic using ports along with url. Please suggest.

Body:
I have a two containers running in a namespace in K3s cluster where for example port 1001 is exposed on container foo and port 1002 is exposed on container bar. I have configured kubernetes services to map host ports and container ports 1001:1001 and 1002:1002.

I have written ingress.yaml file as below:

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: ingress
  namespace: project
spec:
  entryPoints:
    - websecure
  routes:
  - kind: Rule
    match: Host(`abc.xyz.com`)
    priority: 1
    services:
    - kind: Service
      name: foo
      namespace: project
      port: port-foo   #name of the service endpoint port 1001 which targets container's 1001
    - kind: Service
      name: bar
      namespace: project
      port: port-bar   #name of the service endpoint port 1002 which targets container's 1002
  tls:
    domains:
      - main: xyz
        sans:
          - "*.xyz.com"
    secretName: xyz-cert

Overall configuration is as below:

NAME                          READY   STATUS    RESTARTS   AGE
pod/foo-45521ddb4f-gk2ed      1/1     Running   0          45h
pod/bar-45599346df-p1rtd      1/1     Running   0          45h

NAME             TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
service/foo      ClusterIP   92.33.XX.XX   <none>        1001/TCP   45h
service/bar      ClusterIP   92.33.XX.XX    <none>        1002/TCP   45h

NAME                     READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/foo      1/1     1            1           45h
deployment.apps/bar      1/1     1            1           45h

NAME                                DESIRED   CURRENT   READY   AGE
replicaset.apps/foo-45521ddb4f      1         1         1       45h
replicaset.apps/bar-45599346df      1         1         1       45h

NAME     ENDPOINTS          AGE
foo      92.45.X.X:1001   45h
bar      92.51.X.X:1002    45h

So when I hit the url abc.xyz.com in browser each time, it is loadbalancing to different ports each time (round-robin) and when I hit abc.xyz.com:1001 and abc.xyz.com:1002 , it returns the error response the page can't be reached. My objective is to route traffic using ports along with url. Please suggest.


问:
How to make a python code folder only useable by that code
HI I made a python gui code and it is saved in a folder named mygui the folder has many sub folder like image,icon,password,log,soundeffects and code so I want my python code to access the main folder as well as sub folder but I don't want an user to open file explorer and gain access to the contents of the main as well as sub folders


问:
Update an object array via ngmodel from a child component Angular
I am much more familiar with React.
My problem seems quite common.

First of all I have a TreeDataStructure class. Within this class, I have a 'filters' property that holds the filters applied to the tree in memory.

The tree is stored in the property of a component A. I transfer the 'filters' property of the tree to a component B, child of A.

This child displays all the filters one by one, and a component C, child of B, displays a single filter and allows it to be modified.

My concern is that I can't get the filter changes from C to the TreeDataStructure class stored in component A.

Here is the gist of my code:

TreeDataStructure.ts

```<code>export class DataTreeStructure {
    filters: Filters;
}

type Filters = {
    items: Array<Filter>
    linkOperator: LinkOperator //and or or
}

type Filter = {
    column: string
    operator: string
    comparaisonValue: string
}
</code>```

Component A

```<code>export class ComponentA {
    tree: DataTreeStructure
}
</code>```

Component A Template

```<code><component-b filters[tree.filters]></component-b>
</code>```

Component B

```<code>export class ComponentB {
    @Input() filters: Filters;
}
</code>```

Component B Template

```<code><ng-container *ngFor="let item of filters.items; let index = index;">
    <component-c
        [column]="filters.items[index].column"
        [operator]="filters.items[index].operator"
        [comparaisonValue]="filters.items[index].comparaisonValue"
    >
    </component-c>
</ng-container>
</code>```

Component C

```<code>export class ComponentC {
    @Input() column: string;
    @Input() operator: string;
    @Input() comparaisonValue: string;
}
</code>```

Component C Template

```<code>    <input [(ngModel)]="column"/>
    <input [(ngModel)]="operator"/>
    <input [(ngModel)]="comparaisonValue"/>
</code>```

How would you do it?

Body:
I am much more familiar with React.
My problem seems quite common.

First of all I have a TreeDataStructure class. Within this class, I have a 'filters' property that holds the filters applied to the tree in memory.

The tree is stored in the property of a component A. I transfer the 'filters' property of the tree to a component B, child of A.

This child displays all the filters one by one, and a component C, child of B, displays a single filter and allows it to be modified.

My concern is that I can't get the filter changes from C to the TreeDataStructure class stored in component A.

Here is the gist of my code:

TreeDataStructure.ts

export class DataTreeStructure {
    filters: Filters;
}

type Filters = {
    items: Array<Filter>
    linkOperator: LinkOperator //and or or
}

type Filter = {
    column: string
    operator: string
    comparaisonValue: string
}

Component A

export class ComponentA {
    tree: DataTreeStructure
}

Component A Template

<component-b filters[tree.filters]></component-b>

Component B

export class ComponentB {
    @Input() filters: Filters;
}

Component B Template

<ng-container *ngFor="let item of filters.items; let index = index;">
    <component-c
        [column]="filters.items[index].column"
        [operator]="filters.items[index].operator"
        [comparaisonValue]="filters.items[index].comparaisonValue"
    >
    </component-c>
</ng-container>

Component C

export class ComponentC {
    @Input() column: string;
    @Input() operator: string;
    @Input() comparaisonValue: string;
}

Component C Template

    <input [(ngModel)]="column"/>
    <input [(ngModel)]="operator"/>
    <input [(ngModel)]="comparaisonValue"/>

How would you do it?


问:
openssh-server on a Docker oralinux:8
I'm trying to create a Docker container with Oracle Linux 8 and configure a remote connection to connect via SSH.

The Docker file is the one below. I build it with

```<code>docker build -f build.oralinux.18.dockerfile -t mycontainer:18 .
</code>```
```<code>docker run --name build-billing -it -p6922:6922 -p22:22 -p9095:9095 mycontainer:18 bash
</code>```

I cannot connect via SSH. If I try to start the service like this or in the Dockerfile with RUN, I have this error.

$service sshd start

Redirecting to /bin/systemctl start sshd.service

System has not been booted with systemd as init system (PID 1). Can't operate.

Failed to connect to bus: Host is down

```<code>FROM oraclelinux:8

RUN yum install -y unzip \
    && yum install -y wget \
    && yum install -y telnet \
    && yum install -y sudo \
    && yum install -y libnsl \
    && yum install -y make \
    && yum install -y unzip \
    && yum install -y initscripts \
    && yum install -y vim \
    && yum install -y gcc \
    && yum install -y glibc.i686 \
    && yum install -y libaio \
    && yum install -y epel-release \
    && yum install -y passwd \
    && yum install -y tar \
    && yum install -y screen \
    && yum install -y crontabs

RUN (yum update -y; \
    yum install -y openssh-server openssh-clients; \
    yum clean all)

RUN (ssh-keygen -A; \
     sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config; \
     sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config)

RUN (mkdir -p /root/.ssh/; \
     echo "StrictHostKeyChecking=no" > /root/.ssh/config; \
     echo "UserKnownHostsFile=/dev/null" >> /root/.ssh/config)

RUN echo "root:xxxxxxxxxxx" | chpasswd

EXPOSE 9095
EXPOSE 6922
EXPOSE 22

CMD ["/usr/sbin/sshd", "-D"]
</code>```

Title: openssh-server on a Docker oralinux:8

Body:
I'm trying to create a Docker container with Oracle Linux 8 and configure a remote connection to connect via SSH.

The Docker file is the one below. I build it with

docker build -f build.oralinux.18.dockerfile -t mycontainer:18 .

docker run --name build-billing -it -p6922:6922 -p22:22 -p9095:9095 mycontainer:18 bash

I cannot connect via SSH. If I try to start the service like this or in the Dockerfile with RUN, I have this error.

$service sshd start

Redirecting to /bin/systemctl start sshd.service

System has not been booted with systemd as init system (PID 1). Can't operate.

Failed to connect to bus: Host is down

FROM oraclelinux:8

RUN yum install -y unzip \
    && yum install -y wget \
    && yum install -y telnet \
    && yum install -y sudo \
    && yum install -y libnsl \
    && yum install -y make \
    && yum install -y unzip \
    && yum install -y initscripts \
    && yum install -y vim \
    && yum install -y gcc \
    && yum install -y glibc.i686 \
    && yum install -y libaio \
    && yum install -y epel-release \
    && yum install -y passwd \
    && yum install -y tar \
    && yum install -y screen \
    && yum install -y crontabs

RUN (yum update -y; \
    yum install -y openssh-server openssh-clients; \
    yum clean all)

RUN (ssh-keygen -A; \
     sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config; \
     sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config)

RUN (mkdir -p /root/.ssh/; \
     echo "StrictHostKeyChecking=no" > /root/.ssh/config; \
     echo "UserKnownHostsFile=/dev/null" >> /root/.ssh/config)

RUN echo "root:xxxxxxxxxxx" | chpasswd

EXPOSE 9095
EXPOSE 6922
EXPOSE 22

CMD ["/usr/sbin/sshd", "-D"]


问:
catlist shortcode doesn't return the right list of posts
I have a WordPress website and it has a navigation bar with some pages like India Jobs, Scholarships etc.

I pasted this shortcode [catlist name="india-jobs" link_target=_blank numberposts=20 pagination=yes] in India jobs page but it does not give me a list of India Jobs category posts, but when I paste the same code in the About Us page it does give the list of India Jobs.

Also in navigation bar pages does not even give title of the page when I deselect all the post from that particular page category. I am using a plugin called List category posts.

I tried to change the code, also the pages paste in other pages but it does not the give the desired result.


问:
memory increase when loop mount and remount in React 18
I have a UI SDK, when SDK invoke will render React Component, and close will unmount to close UI.

My SDK was working in webview all day, and almost never reboot.

User feedback UI can not interactive when SDK working long time. So I Guess SDK has memory leak.

Below was small reproduce, and inspect memory in chrome devtools, memory was increased  when loop mount and remount.

how can i fix it?

```<code>import React from "react";
import ReactDOM from "react-dom/client";

const App = () => {
  return (
    <>
      <button>render</button>
      <button>unmount</button>
    </>
  );
};

const dom = document.getElementById("root");

const render = () => {
  const root = ReactDOM.createRoot(dom);

  root.render(
    <React.StrictMode>
      <App />
    </React.StrictMode>
  );

  setTimeout(() => root.unmount(), 100);
};

window.__begain = () => setInterval(render, 2000);

</code>```

Body:
I have a UI SDK, when SDK invoke will render React Component, and close will unmount to close UI.

My SDK was working in webview all day, and almost never reboot.

User feedback UI can not interactive when SDK working long time. So I Guess SDK has memory leak.

Below was small reproduce, and inspect memory in chrome devtools, memory was increased  when loop mount and remount.

how can i fix it?

import React from "react";
import ReactDOM from "react-dom/client";

const App = () => {
  return (
    <>
      <button>render</button>
      <button>unmount</button>
    </>
  );
};

const dom = document.getElementById("root");

const render = () => {
  const root = ReactDOM.createRoot(dom);

  root.render(
    <React.StrictMode>
      <App />
    </React.StrictMode>
  );

  setTimeout(() => root.unmount(), 100);
};

window.__begain = () => setInterval(render, 2000);


问:
want to convert to xml to jpeg in python

<bold>Risk</bold>

<bold>Total Cholesterol (mg/dl)</bold>

<bold>LDL Cholesterol (mg/dl)</bold>

<bold>HDL Cholesterol (mg/dl)</bold>

<bold>Triglycerides (mg/dl)</bold>

High

>245

>190

<36

>1,000

Moderate

221–244

160–189

35–44

500–999

Mild

201–220

130–159

45–54

250–499

Average

182–200

100–129

55–64

151–249

Low

<182

<100

>65

<150

</tgroup>

`


问:
Android Virtual Devices - hardware buttons not showing
Anyone know how to get Android Virtual Devices to show hardware buttons (back, home, etc..)?  I can't get these show on the device.  They only appear at the side in the menu bar.


问:
Why does my pip access two site-packages?
I have a bit of confusion with pip and multiple python installations.
When running python -m pip install pb_tool I get console output:

```<code>Requirement already satisfied: pb_tool in c:\osgeo4w\apps\python39\lib\site-packages (3.1.0)
Requirement already satisfied: colorama in c:\users\hbh1\appdata\roaming\python\python39\site-packages (from pb_tool) (0.4.6)
Requirement already satisfied: Sphinx in c:\users\hbh1\appdata\roaming\python\python39\site-packages (from pb_tool) (6.1.1)
Requirement already satisfied: Click in c:\osgeo4w\apps\python39\lib\site-packages (from pb_tool) (7.1.2)
...
</code>```

I am wondering, why there are mixed site-packages paths, some in c:\osgeo4w\apps\ and some in c:\users\hbh1\appdata\...?

I installed pb_tool with the OSGeo4W python, I'd expect to find it and its requirements found/installed in c:\osgeo4w\..., not (even partially?!) in the c:\users\hbh1\appdata\..., especially when running pip with python -m.

To elaborate: This is not necessarily a problem, but I'd like to understand, why and also if/how I can circumvent this behavior. It caused me some confusion as to which python installation has which modules installed, and I'd like to keep things separate and an overview over where I installed what.

Some time back I ran pip install pb_tool in my dev shell and couldn't run pb_tool afterwards, despite the successful install. I assume, the problem is, that I didn't have c:\users\hbh1\appdata\roaming\python\python39\site-packages on the PATH in that current environment. But somehow pip knew it, installed pb_tool there and python didn't know about it (I didn't add it, since I'd like a "clean and separated" dev enviroment with it's own python packages)...
I carefully checked PATH, my python/pip versions and which is which (cleaning PATH, using where pip/where python and py -0b to check the windows python launcher as well). My setup basically is:

```<code>  # add to PATH depending on the version I use
  C:\Apps\Python39\
  C:\OSGeo4W\apps\Python39  # respectively C:\OSGeo4W\bin

  # and their corresponding script dirs
  C:\Apps\Python39\Scripts
  C:\Users\hbh1\AppData\Roaming\Python\Python39\Scripts
  C:\OSGeo4W\apps\Python39\Scripts

  # and if relevant: Windows Python Launcher listing these (py -0p), where I only use the first (the second one is not on PATH):
  -3.9-64        C:\Apps\Python39\python.exe *
  -2.7-32        C:\Apps\ArcGIS\Python27\ArcGIS10.8\python.exe
</code>```

C:\OSGeo4W\ is a dev environment for me and I use a "clean" shell for command line tools I use with it (meaning that I don't use the system PATH, but start with a .bat in which I clean the PATH and only add what I specifically need, plus a few general sytem paths).

```<code>@echo off
SET OSGEO4W_ROOT=C:\OSGeo4W
set path=%OSGEO4W_ROOT%\bin;%WINDIR%\system32;%WINDIR%;%WINDIR%\system32\WBem
path %PATH%;%OSGEO4W_ROOT%\apps\Python39\Scripts
path %PATH%;%OSGEO4W_ROOT%\apps\qgis-ltr\bin
path %PATH%;%OSGEO4W_ROOT%\apps\grass\grass78\lib
path %PATH%;%OSGEO4W_ROOT%\apps\Qt5\bin

set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis-ltr\python
set PYTHONHOME=%OSGEO4W_ROOT%\apps\Python39

set PATH=C:\Program Files\Git\bin;%PATH%

cmd.exe
</code>```

I am still puzzled, why in this environment, pip install would put anything in the c:\users\hbh1\appdata\roaming\python\python39\site-packages which is "normally" used by my C:\Apps\Python39\ installation.

Body:
I have a bit of confusion with pip and multiple python installations.
When running python -m pip install pb_tool I get console output:

Requirement already satisfied: pb_tool in c:\osgeo4w\apps\python39\lib\site-packages (3.1.0)
Requirement already satisfied: colorama in c:\users\hbh1\appdata\roaming\python\python39\site-packages (from pb_tool) (0.4.6)
Requirement already satisfied: Sphinx in c:\users\hbh1\appdata\roaming\python\python39\site-packages (from pb_tool) (6.1.1)
Requirement already satisfied: Click in c:\osgeo4w\apps\python39\lib\site-packages (from pb_tool) (7.1.2)
...

I am wondering, why there are mixed site-packages paths, some in c:\osgeo4w\apps\ and some in c:\users\hbh1\appdata\...?

I installed pb_tool with the OSGeo4W python, I'd expect to find it and its requirements found/installed in c:\osgeo4w\..., not (even partially?!) in the c:\users\hbh1\appdata\..., especially when running pip with python -m.

To elaborate: This is not necessarily a problem, but I'd like to understand, why and also if/how I can circumvent this behavior. It caused me some confusion as to which python installation has which modules installed, and I'd like to keep things separate and an overview over where I installed what.

Some time back I ran pip install pb_tool in my dev shell and couldn't run pb_tool afterwards, despite the successful install. I assume, the problem is, that I didn't have c:\users\hbh1\appdata\roaming\python\python39\site-packages on the PATH in that current environment. But somehow pip knew it, installed pb_tool there and python didn't know about it (I didn't add it, since I'd like a "clean and separated" dev enviroment with it's own python packages)...
I carefully checked PATH, my python/pip versions and which is which (cleaning PATH, using where pip/where python and py -0b to check the windows python launcher as well). My setup basically is:

  # add to PATH depending on the version I use
  C:\Apps\Python39\
  C:\OSGeo4W\apps\Python39  # respectively C:\OSGeo4W\bin

  # and their corresponding script dirs
  C:\Apps\Python39\Scripts
  C:\Users\hbh1\AppData\Roaming\Python\Python39\Scripts
  C:\OSGeo4W\apps\Python39\Scripts

  # and if relevant: Windows Python Launcher listing these (py -0p), where I only use the first (the second one is not on PATH):
  -3.9-64        C:\Apps\Python39\python.exe *
  -2.7-32        C:\Apps\ArcGIS\Python27\ArcGIS10.8\python.exe

C:\OSGeo4W\ is a dev environment for me and I use a "clean" shell for command line tools I use with it (meaning that I don't use the system PATH, but start with a .bat in which I clean the PATH and only add what I specifically need, plus a few general sytem paths).

@echo off
SET OSGEO4W_ROOT=C:\OSGeo4W
set path=%OSGEO4W_ROOT%\bin;%WINDIR%\system32;%WINDIR%;%WINDIR%\system32\WBem
path %PATH%;%OSGEO4W_ROOT%\apps\Python39\Scripts
path %PATH%;%OSGEO4W_ROOT%\apps\qgis-ltr\bin
path %PATH%;%OSGEO4W_ROOT%\apps\grass\grass78\lib
path %PATH%;%OSGEO4W_ROOT%\apps\Qt5\bin

set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis-ltr\python
set PYTHONHOME=%OSGEO4W_ROOT%\apps\Python39

set PATH=C:\Program Files\Git\bin;%PATH%

cmd.exe

I am still puzzled, why in this environment, pip install would put anything in the c:\users\hbh1\appdata\roaming\python\python39\site-packages which is "normally" used by my C:\Apps\Python39\ installation.


问:
WhatsApp not passing text from link to Windows Desktop Application
My application needs to be able to send a WhatsApp message with a predefined template using the following link (in my code it obviously contains a real phone number instead of the placeholder):

```<code>https://wa.me/phone_number?text=Thanks%20for%20reaching%20out!
</code>```

This previously worked up until a few months ago.

Starting from a few months ago I found that it would only paste the message into the WhatsApp Windows application if WhatsApp was previously opened to that contact or if the app was closed, otherwise it would open WhatsApp to that contact but would not paste the predefined message. Does anyone have any solutions for this?

Also I see that the message does indeed get passed to WhatsApp's website, but then their site does not seem to pass the message to the app.

Correct me if I'm wrong but it seems like this is indeed the correct way the link is supposed to be defined.

I am unaware if this issue exists in versions of WhatsApp made for other operating systems.

EDIT: This does not seem to be an issue on mobile. This issue might be specifically with the Windows Desktop App which would explain why this issue isn't coming up a lot.

Body:
My application needs to be able to send a WhatsApp message with a predefined template using the following link (in my code it obviously contains a real phone number instead of the placeholder):

https://wa.me/phone_number?text=Thanks%20for%20reaching%20out!

This previously worked up until a few months ago.

Starting from a few months ago I found that it would only paste the message into the WhatsApp Windows application if WhatsApp was previously opened to that contact or if the app was closed, otherwise it would open WhatsApp to that contact but would not paste the predefined message. Does anyone have any solutions for this?

Also I see that the message does indeed get passed to WhatsApp's website, but then their site does not seem to pass the message to the app.

Correct me if I'm wrong but it seems like this is indeed the correct way the link is supposed to be defined.

I am unaware if this issue exists in versions of WhatsApp made for other operating systems.

EDIT: This does not seem to be an issue on mobile. This issue might be specifically with the Windows Desktop App which would explain why this issue isn't coming up a lot.


问:
SpringBoot Keycloak missing implementation problem
i have problem with Keycloack 19 implementation for SpringBoot 3. I have checked some tutorials and every thing seems OK, but i get error beacause missing implementation of initi(B) in SecurityConfigurer.

```<code>  <dependency>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-spring-security-adapter</artifactId>
        </dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.keycloak.bom</groupId>
                <artifactId>keycloak-adapter-bom</artifactId>
                <version>${keycloakVersion}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
</code>```

And, here is my implementation

```<code>@Configuration
@EnableWebSecurity
@RequiredArgsConstructor
public class KeycloakWebSecurityConfig extends KeycloakWebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        super.configure(http);
        http.csrf()
                .disable()
                .authorizeRequests()
                .anyRequest()
                .authenticated();
        http.csrf().disable();
    }
    @Autowired
    public void configrueGlobal(AuthenticationManagerBuilder auth) throws Exception {
        KeycloakAuthenticationProvider keycloakAuthenticationProvider = keycloakAuthenticationProvider();
        keycloakAuthenticationProvider.setGrantedAuthoritiesMapper(new SimpleAuthorityMapper());
        auth.authenticationProvider(keycloakAuthenticationProvider);
    }
    @Bean
    @Override
    protected SessionAuthenticationStrategy sessionAuthenticationStrategy() {
       return new RegisterSessionAuthenticationStrategy(new SessionRegistryImpl());    }
    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder(12);
    }
}
</code>```

[![IJ Error][1]][1]
[1]: https://i.stack.imgur.com/JEHPR.png

Body:
i have problem with Keycloack 19 implementation for SpringBoot 3. I have checked some tutorials and every thing seems OK, but i get error beacause missing implementation of initi(B) in SecurityConfigurer.

  <dependency>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-spring-security-adapter</artifactId>
        </dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.keycloak.bom</groupId>
                <artifactId>keycloak-adapter-bom</artifactId>
                <version>${keycloakVersion}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

And, here is my implementation

@Configuration
@EnableWebSecurity
@RequiredArgsConstructor
public class KeycloakWebSecurityConfig extends KeycloakWebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        super.configure(http);
        http.csrf()
                .disable()
                .authorizeRequests()
                .anyRequest()
                .authenticated();
        http.csrf().disable();
    }
    @Autowired
    public void configrueGlobal(AuthenticationManagerBuilder auth) throws Exception {
        KeycloakAuthenticationProvider keycloakAuthenticationProvider = keycloakAuthenticationProvider();
        keycloakAuthenticationProvider.setGrantedAuthoritiesMapper(new SimpleAuthorityMapper());
        auth.authenticationProvider(keycloakAuthenticationProvider);
    }
    @Bean
    @Override
    protected SessionAuthenticationStrategy sessionAuthenticationStrategy() {
       return new RegisterSessionAuthenticationStrategy(new SessionRegistryImpl());    }
    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder(12);
    }
}

[![IJ Error][1]][1]
[1]: https://i.stack.imgur.com/JEHPR.png


问:
ttkbootstrap - When more than 10 columns are added in tableview widget, they become out of order
When I add more than 10 columns in tableview they become out of order. It works fine if number of columns are less than 10. Anyone know how to fix that.
Bug - ttkbootstrap bug

Added more than 10 columns, now 10th column is shown after 2nd, then 11th and so on.


问:
How can show the keypoints from the JSON file?
```<code>IMG_DIR = '/Dataset/*.png'
JSON = '/JSON/json.json'
</code>```
```<code>with open('JSON/json.json') as json_file:
    data = json.load(json_file)
    print(data)
</code>```
```<code>{'_via_settings': {'ui': {'annotation_editor_height': 25, 'annotation_editor_fontsize': 0.8, 'leftsidebar_width': 18, 'image_grid': {'img_height': 80, 'rshape_fill': 'none', 'rshape_fill_opacity': 0.3, 'rshape_stroke': 'yellow', 'rshape_stroke_width': 2, 'show_region_shape': True, 'show_image_policy': 'all'}, 'image': {'region_label': '__via_region_id__', 'region_color': '__via_default_region_color__', 'region_label_font': '10px Sans', 'on_image_annotation_editor_placement': 'NEAR_REGION'}}, 'core': {'buffer_size': 18, 'filepath': {}, 'default_filepath': ''}, 'project': {'name': 'via_project_12Jan2023_11h22m'}}, '_via_img_metadata': {'512_512_imran20200801_170919.png848': {'filename': '512_512_imran20200801_170919.png', 'size': 848, 'regions': [], 'file_attributes': {}}, '512_1024_eduart_5493.png1472': {'filename': '512_1024_eduart_5493.png', 'size': 1472, 'regions': [], 'file_attributes': {}}, '512_1024_eduart_5840.png2300': {'filename': '512_1024_eduart_5840.png', 'size': 2300, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 409, 'cy': 120}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 356, 'cy': 403}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 360, 'cy': 476}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '512_1024_eduart_420210722_170544.png1850': {'filename': '512_1024_eduart_420210722_170544.png', 'size': 1850, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 69, 'cy': 43}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 194, 'cy': 49}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 176, 'cy': 222}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 350, 'cy': 240}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 506, 'cy': 188}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '512_2048_eduart_5702.png2076': {'filename': '512_2048_eduart_5702.png', 'size': 2076, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 336, 'cy': 51}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 201, 'cy': 421}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '512_2560_eduart_5extra_35.png1905': {'filename': '512_2560_eduart_5extra_35.png', 'size': 1905, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 349, 'cy': 295}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 495, 'cy': 24}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '512_2560_evgenii_Ext_120201005_142724.png1390': {'filename': '512_2560_evgenii_Ext_120201005_142724.png', 'size': 1390, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 393, 'cy': 212}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 435, 'cy': 169}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '1024_2048_eduart_420210919_151508.png1218': {'filename': '1024_2048_eduart_420210919_151508.png', 'size': 1218, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 37, 'cy': 466}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 327, 'cy': 439}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 431, 'cy': 454}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 499, 'cy': 451}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '1536_1024_imranparkhaus_rub_32.png1016': {'filename': '1536_1024_imranparkhaus_rub_32.png', 'size': 1016, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 235, 'cy': 428}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '1536_1536_eduart_5642.png1076': {'filename': '1536_1536_eduart_5642.png', 'size': 1076, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 152, 'cy': 436}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '1536_2560_evgenii_NL_3_120200916_154505.png1609': {'filename': '1536_2560_evgenii_NL_3_120200916_154505.png', 'size': 1609, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 51, 'cy': 399}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 458, 'cy': 104}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '2048_1024_imran20200801_171936.png1101': {'filename': '2048_1024_imran20200801_171936.png', 'size': 1101, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 298, 'cy': 411}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '2048_1024_imran20200801_184730.png870': {'filename': '2048_1024_imran20200801_184730.png', 'size': 870, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 481, 'cy': 451}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '2048_1536_imran20200801_171936.png1243': {'filename': '2048_1536_imran20200801_171936.png', 'size': 1243, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 4, 'cy': 354}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 169, 'cy': 344}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 321, 'cy': 270}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 396, 'cy': 241}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}}, '_via_attributes': {'region': {'keypoints': {'type': 'text', 'description': '', 'default_value': ''}}, 'file': {}}}
</code>```
```<code>with open('/JSON/json.json') as json_file:
    json_string = json_file.read()
    data = json.loads(json_string)
    print(type(data))
</code>```
```<code><class 'dict'>
</code>```

How can show the key points of the JSON data? I just need to show I mean visualize the key points from the JSON.

Body:
IMG_DIR = '/Dataset/*.png'
JSON = '/JSON/json.json'

with open('JSON/json.json') as json_file:
    data = json.load(json_file)
    print(data)

{'_via_settings': {'ui': {'annotation_editor_height': 25, 'annotation_editor_fontsize': 0.8, 'leftsidebar_width': 18, 'image_grid': {'img_height': 80, 'rshape_fill': 'none', 'rshape_fill_opacity': 0.3, 'rshape_stroke': 'yellow', 'rshape_stroke_width': 2, 'show_region_shape': True, 'show_image_policy': 'all'}, 'image': {'region_label': '__via_region_id__', 'region_color': '__via_default_region_color__', 'region_label_font': '10px Sans', 'on_image_annotation_editor_placement': 'NEAR_REGION'}}, 'core': {'buffer_size': 18, 'filepath': {}, 'default_filepath': ''}, 'project': {'name': 'via_project_12Jan2023_11h22m'}}, '_via_img_metadata': {'512_512_imran20200801_170919.png848': {'filename': '512_512_imran20200801_170919.png', 'size': 848, 'regions': [], 'file_attributes': {}}, '512_1024_eduart_5493.png1472': {'filename': '512_1024_eduart_5493.png', 'size': 1472, 'regions': [], 'file_attributes': {}}, '512_1024_eduart_5840.png2300': {'filename': '512_1024_eduart_5840.png', 'size': 2300, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 409, 'cy': 120}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 356, 'cy': 403}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 360, 'cy': 476}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '512_1024_eduart_420210722_170544.png1850': {'filename': '512_1024_eduart_420210722_170544.png', 'size': 1850, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 69, 'cy': 43}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 194, 'cy': 49}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 176, 'cy': 222}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 350, 'cy': 240}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 506, 'cy': 188}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '512_2048_eduart_5702.png2076': {'filename': '512_2048_eduart_5702.png', 'size': 2076, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 336, 'cy': 51}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 201, 'cy': 421}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '512_2560_eduart_5extra_35.png1905': {'filename': '512_2560_eduart_5extra_35.png', 'size': 1905, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 349, 'cy': 295}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 495, 'cy': 24}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '512_2560_evgenii_Ext_120201005_142724.png1390': {'filename': '512_2560_evgenii_Ext_120201005_142724.png', 'size': 1390, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 393, 'cy': 212}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 435, 'cy': 169}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '1024_2048_eduart_420210919_151508.png1218': {'filename': '1024_2048_eduart_420210919_151508.png', 'size': 1218, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 37, 'cy': 466}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 327, 'cy': 439}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 431, 'cy': 454}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 499, 'cy': 451}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '1536_1024_imranparkhaus_rub_32.png1016': {'filename': '1536_1024_imranparkhaus_rub_32.png', 'size': 1016, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 235, 'cy': 428}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '1536_1536_eduart_5642.png1076': {'filename': '1536_1536_eduart_5642.png', 'size': 1076, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 152, 'cy': 436}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '1536_2560_evgenii_NL_3_120200916_154505.png1609': {'filename': '1536_2560_evgenii_NL_3_120200916_154505.png', 'size': 1609, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 51, 'cy': 399}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 458, 'cy': 104}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '2048_1024_imran20200801_171936.png1101': {'filename': '2048_1024_imran20200801_171936.png', 'size': 1101, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 298, 'cy': 411}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '2048_1024_imran20200801_184730.png870': {'filename': '2048_1024_imran20200801_184730.png', 'size': 870, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 481, 'cy': 451}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}, '2048_1536_imran20200801_171936.png1243': {'filename': '2048_1536_imran20200801_171936.png', 'size': 1243, 'regions': [{'shape_attributes': {'name': 'point', 'cx': 4, 'cy': 354}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 169, 'cy': 344}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 321, 'cy': 270}, 'region_attributes': {'keypoints': 'keypoints'}}, {'shape_attributes': {'name': 'point', 'cx': 396, 'cy': 241}, 'region_attributes': {'keypoints': 'keypoints'}}], 'file_attributes': {}}}, '_via_attributes': {'region': {'keypoints': {'type': 'text', 'description': '', 'default_value': ''}}, 'file': {}}}

with open('/JSON/json.json') as json_file:
    json_string = json_file.read()
    data = json.loads(json_string)
    print(type(data))

<class 'dict'>

How can show the key points of the JSON data? I just need to show I mean visualize the key points from the JSON.


问:
How to calculate Arithmetic Intensity?
I have the following code snippet, of which I have to calculate the Arithmetic Intensity.

```<code>const int N = 8192;
float a[N], b[N], c[N], d[N];
...
#pragma omp parallel for simd
for(int i = 0; i < N; i++)
{
 const float tmp_a = a[i];
 const float tmp_b = b[i];
 c[i] += tmp_a*tmp_b;
 d[i] = tmp_a+tmp_b;
}

</code>```

Case 1 : What will be the AI if tmp_a and tmp_b are in registers
Case 2 : What will be the AI if tmp_a and tmp_b are in RAM or cache

I know AI is given as number of floating point operations divided by the number of bytes transferred. How should the bytes transferred depend on the data being stored in RAM/registers/Cache? What additional information do we need to calculate the maximum floating point throughput achievable by the code?

Title: How to calculate Arithmetic Intensity?

Body:
I have the following code snippet, of which I have to calculate the Arithmetic Intensity.

const int N = 8192;
float a[N], b[N], c[N], d[N];
...
#pragma omp parallel for simd
for(int i = 0; i < N; i++)
{
 const float tmp_a = a[i];
 const float tmp_b = b[i];
 c[i] += tmp_a*tmp_b;
 d[i] = tmp_a+tmp_b;
}

Case 1 : What will be the AI if tmp_a and tmp_b are in registers
Case 2 : What will be the AI if tmp_a and tmp_b are in RAM or cache

I know AI is given as number of floating point operations divided by the number of bytes transferred. How should the bytes transferred depend on the data being stored in RAM/registers/Cache? What additional information do we need to calculate the maximum floating point throughput achievable by the code?


问:
CKEditor 5 - CKEditorError: editor-create-initial-data - React JS
I am using custom ckeditor 5 build generated by ckeditor online builder.

While using custom build at the time of initialization when editor contains no data at that time I am getting this error in the browser console.

ckedior initial data error image

My function looks like this:

```<code>const TextEditor = ({ editorState, onEditorStateChange }) => {
  const CustomConfig = {
    toolbar: {
      shouldNotGroupWhenFull: false, // Auto wrap toolbar items
    },
  };

  return (
    <CKEditor
      config={CustomConfig}
      data={editorState}
      editor={ClassicEditor}
      required
      onChange={(event, editor) => {
        const data = editor.getData();
        onEditorStateChange(data);
      }}
    />
  );
};
</code>```

I have tried to add initialData in my customConfig as below but still getting error:

```<code>const TextEditor = ({ editorState, onEditorStateChange }) => {
  const CustomConfig = {
    toolbar: {
      shouldNotGroupWhenFull: false, // Auto wrap toolbar items
    },
    initialData: "",
  };

  return (
    <CKEditor
      config={CustomConfig}
      data={editorState}
      editor={ClassicEditor}
      required
      onChange={(event, editor) => {
        const data = editor.getData();
        onEditorStateChange(data);
      }}
    />
  );
};
</code>```

Body:
I am using custom ckeditor 5 build generated by ckeditor online builder.

While using custom build at the time of initialization when editor contains no data at that time I am getting this error in the browser console.

ckedior initial data error image

My function looks like this:

const TextEditor = ({ editorState, onEditorStateChange }) => {
  const CustomConfig = {
    toolbar: {
      shouldNotGroupWhenFull: false, // Auto wrap toolbar items
    },
  };

  return (
    <CKEditor
      config={CustomConfig}
      data={editorState}
      editor={ClassicEditor}
      required
      onChange={(event, editor) => {
        const data = editor.getData();
        onEditorStateChange(data);
      }}
    />
  );
};

I have tried to add initialData in my customConfig as below but still getting error:

const TextEditor = ({ editorState, onEditorStateChange }) => {
  const CustomConfig = {
    toolbar: {
      shouldNotGroupWhenFull: false, // Auto wrap toolbar items
    },
    initialData: "",
  };

  return (
    <CKEditor
      config={CustomConfig}
      data={editorState}
      editor={ClassicEditor}
      required
      onChange={(event, editor) => {
        const data = editor.getData();
        onEditorStateChange(data);
      }}
    />
  );
};


问:
Catch some exceptions and throw only a new one with the info of all the previous
I have a for loop with a try/catch block inside. If any exception is thrown I store them in a list and allow the loop to continue procesing.

When the loop has finished I pretend to throw an exception that encapsulates all the info (messages and stack traces) of all the stored exceptions.

I have thought on concatenating messages and stack traces and creating a new Exception with this info but I guess if there is a better approach.

```<code>List<Exception> exceptions = new ArrayList<>();
for (.....) {
    try{
        someProcessThatMayThrowAnException();
    } catch (Exception ex) {
        exceptions.add(ex);
    }
}

if (!CollectionUtils.isEmpty(exceptions)) {
    StringBuilder messages = new StringBuilder();
    for (Exception ex : exceptions) {
        messages.append(ex.getMessage()).append(System.lineSeparator());
        for (StackTraceElement ste : ex.getStackTrace()) {
            messages.append(ste.toString()).append(System.lineSeparator());
        }
    }

    throw new RuntimeException(messages.toString());
}

</code>```

Body:
I have a for loop with a try/catch block inside. If any exception is thrown I store them in a list and allow the loop to continue procesing.

When the loop has finished I pretend to throw an exception that encapsulates all the info (messages and stack traces) of all the stored exceptions.

I have thought on concatenating messages and stack traces and creating a new Exception with this info but I guess if there is a better approach.

List<Exception> exceptions = new ArrayList<>();
for (.....) {
    try{
        someProcessThatMayThrowAnException();
    } catch (Exception ex) {
        exceptions.add(ex);
    }
}

if (!CollectionUtils.isEmpty(exceptions)) {
    StringBuilder messages = new StringBuilder();
    for (Exception ex : exceptions) {
        messages.append(ex.getMessage()).append(System.lineSeparator());
        for (StackTraceElement ste : ex.getStackTrace()) {
            messages.append(ste.toString()).append(System.lineSeparator());
        }
    }

    throw new RuntimeException(messages.toString());
}


问:
How to get a unique file identity cross-platform and filesystems in Go?
I'm looking for a way to get a file's inode on Linux and a file identity on Windows, or any other unique file identity as cross-platform as possible and more efficient than hashing file contents. Platforms are Linux,Windows,Mac.

The purpose of this is to be able track files as efficiently as possible so the program can locate them after the user has renamed or moved them. If I have a file path + file ID and the file is not at the path, I need a way to find the new file path on all mounted volumes (or fail if it has been deleted). Hashing all files is prohibitively expensive and creates a whole bunch of new error possibilities since files are going to be updated and renamed regularly.

I'm hoping there is an existing library but haven't found anything cross-platform yet. If there is none, I'd be very grateful for help on how to use syscalls in x/sys, and to hear about any limitations inodes and file identities have.


问:
Python txt Notepad file cannot be saved as a ipynb and cannot be run on Visual Studio
I have a Python code correction received in text form. I am unable to save the file as ipynb. Please note my background is finance and I am not experienced with coding so the solution might be very easy.</p>


问:
MS Project workflow templates location
I want to change some fields in MS Project list when it creates the new project.

I tried to find in SharePoint but I couldn't find the templates used by the workflow.

Title: MS Project workflow templates location


问:
How to disable 'Let site view files?' message (when running locally)
I am looking for a way to disable the popup message which shows when using window.showDirectoryPicker. This page is served from localhost via WebView2 component in a WPF app.

```<code><!DOCTYPE html>
<html>

<body>
    <div class="fl" style="margin: 0 0 2rem 0"><button id="addToFolder">Give access to folder</button></div>
</body>

</html>

<script>
    let directory;
    document.getElementById('addToFolder').addEventListener('click', async () => {
        try {
            directory = await window.showDirectoryPicker({
                startIn: 'desktop'
            });

            for await (const entry of directory.values()) {
                let newEl = document.createElement('div');
                newEl.innerHTML = `<strong>${entry.name}</strong> - ${entry.kind}`;
                document.getElementById('folder-info').append(newEl);
            }
        } catch (e) {
            console.log(e);
        }
    });
</script>
</code>```

Note that I already have full file system access via the WPF app, so its not a security concern.

Body:
I am looking for a way to disable the popup message which shows when using window.showDirectoryPicker. This page is served from localhost via WebView2 component in a WPF app.

<!DOCTYPE html>

<button id="addToFolder">Give access to folder</button>

Note that I already have full file system access via the WPF app, so its not a security concern.


问:
Which regex to use to get rid of ^[(B from file in python
In my python code I receive a log file which I want to store so that the user can read it.
The log file contains special characters like: ^[[m^[(B
which I want to remove.

Example line from the log file:
<13>Jan 11 13:14:39 [2023-01-11, 13:14:39.700] fio_start.info:^[[m^[(B: Cleanup started

According to the answer given in this thread How can I remove the ANSI escape sequences from a string in python

I have used re.compile with different regular expressions e.g. like this:

ansi_escape = re.compile(r'(?:\x1B[@-Z\-_]|[\x80-\x9A\x9C-\x9F]|(?:\x1B[|\x9B)[0-?][ -/][@-~])')
new_fileContents = ansi_escape.sub('', str(fileContents))

which removes the '^[[m' but not the '^[(B':

<13>Jan 11 13:14:39 [2023-01-11, 13:14:39.700] fio_start.info:^[(B: Cleanup started

Can someone please help me to find the correct regex to remove also the ^[(B?


问:
how to load string from sharedPrefs in manifest?
How can I load a String from SharedPrefs in the Manifest file? Is it possible? Thank you for your help.</p>
```<code>sharedPreference.getString("username","defaultName")
</code>```

Body:
How can I load a String from SharedPrefs in the Manifest file? Is it possible? Thank you for your help.

sharedPreference.getString("username","defaultName")


问:
SQL code in VB MS Access inserts the new records to the middle of the table, not at the botom
In MS Access, I need to insert new records using SQL code.
I wrote the following code in VB and it inserts the code to the middle of the table.
Is there any chance to find out the reason?

```<code>sql = "INSERT INTO Audit_riskModelHistory (Action, User, modelKey, modelEventKey) " & _
"VALUES ('New Record Inserted', 'Mike-Admin', " & _
Me.cmb1.Value & ", " & Me.cmb2.Value & ")"

DoCmd.SetWarnings False
DoCmd.RunSQL (sql)
DoCmd.SetWarnings True
</code>```

I tried looking at the properties of the table but I did not find the reason.

Body:
In MS Access, I need to insert new records using SQL code.
I wrote the following code in VB and it inserts the code to the middle of the table.
Is there any chance to find out the reason?

sql = "INSERT INTO Audit_riskModelHistory (Action, User, modelKey, modelEventKey) " & _
"VALUES ('New Record Inserted', 'Mike-Admin', " & _
Me.cmb1.Value & ", " & Me.cmb2.Value & ")"

DoCmd.SetWarnings False
DoCmd.RunSQL (sql)
DoCmd.SetWarnings True

I tried looking at the properties of the table but I did not find the reason.


问:
Best way to orchestrate a sequence of events based on user input in a browser game?
I really struggled to phrase the title, which shows how lost I am. I consider myself a good web developer, but structures like this break my head :D

–––

The game

I'm remaking a little ear-training game of mine (http://twelvenotes.co/) with Nuxt3.

The game features 8 rounds of questions. Each round plays 2 musical notes and the player must tell which one is higher.

The interactive concept for the new version has changed. The game does not start automatically, but waits for a "Start now" input from the Playeyr. Each round the two notes play automatically in sequence. The Player has two options now:

Click on one note to lock in the answer to which note he thinks is higher

Replay the two notes in the same sequence, but lose "1 life" (or "extra listen") of 3

Answering a question shows an animation indicating if Player is right or wrong. After the animation is completed the game should move to the next round automatically and also start the round automatically, after the animated transition to the new round is done.

The whole game and each round individually is timed with a visible stop watch which will influence the final score.

After 8 rounds the Player is presented with an end screen showing the performance and a score.

The problem

As of right now, Creating the array of playable rounds, locking in the answer, moving to the next round, playing notes, replaying notes are all separate functions.

Now to the question: Whats the best way to control all these functions? Especially with timeouts needed for animations and playing notes etc. it's hard to structure which function does what and who tells it when to do it.

Who controls when we move to the next round and when we will start that round? Moving to the next round should only be possible when the current round has been answered. But should all of this be the job of moveToNextRound()? And who actually starts the round as in playing the notes, starting a stopwatch for this round etc. – And who stops the timer of the played round when the round has been answered? Is that a job for moveToNextRound() or startRound(roundIndex) or is that the job of a new function finishRound() - but who then calls finishRound()? Or should it be finishCurrentRound(). When a question is answered we need time for an animation telling the player if his answer was right or not and so on and so forth...

... I guess you get the picture. Structuring this is not easy for me. While doing it I constantly go back and forth between which function does what.

The question

Can you guys point me to best practices or resources in that field? Only thing I can think of googling is: "Gamecontroller"... which obviously only gives you results for gaming console gamepads.

Thanks!


问:
Rate limit on guild.roles.create?
My project involves checking a json with course data and creating roles for each course. This worked fine the first few times but after making a few errors, deleting and recreating, the roles aren't being created.

Update roles command:
Essentially the roles get fetched once so multiple fetch requests aren't needed.

```<code>const guild = interaction.guild;

        await guild.roles.fetch();
        const rolesAdded = Array.from(guild.roles.cache.values()).map((r) => { return r.name; });

        for(const d of getDisciplines()){
            const roles = getDiscplineRoles(d);
            for(const r of roles){
                if(rolesAdded.includes(r[0])) continue;
                let colour;
                if(r[1] == "M"){
                    colour = "Purple";
                } else if (r[1] == "S"){
                    colour = "Blue";
                }

                addRole(guild, r[0], colour);
                rolesAdded.push(r[0]);

            }

            let courses = getCourses(d);
            courses = courses.map((c) => {
                return c[0];
            });

            for(const course of courses){
                if(rolesAdded.includes(course)) continue;
                addRole(interaction.guild, course, "LightGrey");
                rolesAdded.push(course);
            }

        }

        await interaction.reply("Roles created");
</code>```

addRole function:
The console.log runs fine so i know this works

```<code>    addRole: async function(guild, roleName, colour) {
        // Get role and create if it doesn't exist
        const role = await guild.roles.cache.find((r) => r.name === roleName);

        if (role !== undefined){
            return;
        }

        console.log(`${roleName} does not exists`);

        await guild.roles.create({
            name: roleName,
            color: colour,
        });

    }
</code>```

I have tried looking up something about a limit but have only found 2 forum posts mentioning 2 numbers, 250 and 1000.
Note: No error is returned at all, the program just seems to be waiting for the request to be filled

Links:

https://github.com/discord/discord-api-docs/issues/1480

https://support.discord.com/hc/en-us/community/posts/360050533812-Extreme-rate-limits-on-the-role-create-endpoint

Title: Rate limit on guild.roles.create?

Body:
My project involves checking a json with course data and creating roles for each course. This worked fine the first few times but after making a few errors, deleting and recreating, the roles aren't being created.

Update roles command:
Essentially the roles get fetched once so multiple fetch requests aren't needed.

const guild = interaction.guild;

        await guild.roles.fetch();
        const rolesAdded = Array.from(guild.roles.cache.values()).map((r) => { return r.name; });

        for(const d of getDisciplines()){
            const roles = getDiscplineRoles(d);
            for(const r of roles){
                if(rolesAdded.includes(r[0])) continue;
                let colour;
                if(r[1] == "M"){
                    colour = "Purple";
                } else if (r[1] == "S"){
                    colour = "Blue";
                }

                addRole(guild, r[0], colour);
                rolesAdded.push(r[0]);

            }

            let courses = getCourses(d);
            courses = courses.map((c) => {
                return c[0];
            });

            for(const course of courses){
                if(rolesAdded.includes(course)) continue;
                addRole(interaction.guild, course, "LightGrey");
                rolesAdded.push(course);
            }

        }

        await interaction.reply("Roles created");

addRole function:
The console.log runs fine so i know this works

    addRole: async function(guild, roleName, colour) {
        // Get role and create if it doesn't exist
        const role = await guild.roles.cache.find((r) => r.name === roleName);

        if (role !== undefined){
            return;
        }

        console.log(`${roleName} does not exists`);

        await guild.roles.create({
            name: roleName,
            color: colour,
        });

    }

I have tried looking up something about a limit but have only found 2 forum posts mentioning 2 numbers, 250 and 1000.
Note: No error is returned at all, the program just seems to be waiting for the request to be filled

Links:

https://github.com/discord/discord-api-docs/issues/1480

https://support.discord.com/hc/en-us/community/posts/360050533812-Extreme-rate-limits-on-the-role-create-endpoint


问:
Adding a market to a line chart Plotly python
I'm trying to add a point to the last observation on a time series chart with plotly. It is not very different from the example here https://stackoverflow.com/a/72539011/3021252 for instance. Except it is the last observation. Unfortunately following such pattern modifies the axis range.

Here is an example of an original chart

```<code>import plotly.express as px

df = px.data.gapminder().query("country=='Canada'")
fig = px.line(df, x="year", y="lifeExp", title='Life expectancy in Canada')
fig.show()
</code>```

But after adding a marker

```<code>import plotly.graph_objects as go
fig.add_trace(
    go.Scatter(
        x=[df["year"].values[-1]],
        y=[df["lifeExp"].values[-1]],
        mode='markers'
    )
)
</code>```

It looks like that

Has anyone have an idea how not to introduce this gap on the right?

Body:
I'm trying to add a point to the last observation on a time series chart with plotly. It is not very different from the example here https://stackoverflow.com/a/72539011/3021252 for instance. Except it is the last observation. Unfortunately following such pattern modifies the axis range.

Here is an example of an original chart

import plotly.express as px

df = px.data.gapminder().query("country=='Canada'")
fig = px.line(df, x="year", y="lifeExp", title='Life expectancy in Canada')
fig.show()

But after adding a marker

import plotly.graph_objects as go
fig.add_trace(
    go.Scatter(
        x=[df["year"].values[-1]],
        y=[df["lifeExp"].values[-1]],
        mode='markers'
    )
)

It looks like that

Has anyone have an idea how not to introduce this gap on the right?


问:
nginx Wordpress URL rewrite in oracle cloud
I have installed Wordpress into oracle cloud ubuntu (nginx)
now everything is good but permalinks are not working..
how to give permission access.. Please help
www.beingyou.store is working but www.beingyou.store/cart is not

Following is my /etc/nginx/sites-available/default

```<code>##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {

    # SSL configuration
    #
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    #
    # Note: You should disable gzip for SSL traffic.
    # See: https://bugs.debian.org/773332
    #
    # Read up on ssl_ciphers to ensure a secure configuration.
    # See: https://bugs.debian.org/765782
    #
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    #
    # include snippets/snakeoil.conf;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.php;

    server_name beingyou.store www.beingyou.store;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
    }

    # pass PHP scripts to FastCGI server
    #
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;

    #   # With php-fpm (or other unix sockets):
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
    #   # With php-cgi (or other tcp sockets):
    #   fastcgi_pass 127.0.0.1:9000;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #   deny all;
    #}

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/beingyou.store/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/beingyou.store/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#   listen 80;
#   listen [::]:80;
#
#   server_name example.com;
#
#   root /var/www/example.com;
#   index index.html;
#
#   location / {
#       try_files $uri $uri/ =404;
#   }
#}

server {
    if ($host = www.beingyou.store) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    if ($host = beingyou.store) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80 default_server;
    listen [::]:80 default_server;

    server_name beingyou.store www.beingyou.store;
    return 404; # managed by Certbot

}
</code>```

I tried to google it but not getting proper answers

Body:
I have installed Wordpress into oracle cloud ubuntu (nginx)
now everything is good but permalinks are not working..
how to give permission access.. Please help
www.beingyou.store is working but www.beingyou.store/cart is not

Following is my /etc/nginx/sites-available/default

##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {

    # SSL configuration
    #
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    #
    # Note: You should disable gzip for SSL traffic.
    # See: https://bugs.debian.org/773332
    #
    # Read up on ssl_ciphers to ensure a secure configuration.
    # See: https://bugs.debian.org/765782
    #
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    #
    # include snippets/snakeoil.conf;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.php;

    server_name beingyou.store www.beingyou.store;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
    }

    # pass PHP scripts to FastCGI server
    #
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;

    #   # With php-fpm (or other unix sockets):
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
    #   # With php-cgi (or other tcp sockets):
    #   fastcgi_pass 127.0.0.1:9000;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #   deny all;
    #}

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/beingyou.store/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/beingyou.store/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#   listen 80;
#   listen [::]:80;
#
#   server_name example.com;
#
#   root /var/www/example.com;
#   index index.html;
#
#   location / {
#       try_files $uri $uri/ =404;
#   }
#}

server {
    if ($host = www.beingyou.store) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    if ($host = beingyou.store) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80 default_server;
    listen [::]:80 default_server;

    server_name beingyou.store www.beingyou.store;
    return 404; # managed by Certbot

}

I tried to google it but not getting proper answers


问:
Implementing exponential backoff in spark between consecutive attempts
On our AWS EMR spark cluster we have 100-150 jobs running at a given time. Each cluster-task-node is allocated 7 of 8 cores. But at some hour in a day the load average touches 10 --causing task failure/ task lost/ executors lost/ heart beat missed. If we decrease the allocated cores/node the cluster is under utilised (load avg 4)

To avoid executors lost/ tasks lost --we tried increasing maxAttempts, but all the attempts are happening in that hour window only and the job is failing.

So, as intermediary we are thinking of

having try catch in the main method. So that executor lost, max attempts exceeded exceptions can be caught and... re-trigger the code

The EMR-core-nodes have 6 of 8cores allocated to spark --May be for this reason the driver never crashed!

So the questions

Will re-triggering main code in the same JVM several times any side affects? It can happen that there are some dataframes already created in the previous run and now they are getting recreated. Or recached or the SQL is getting re-executed

if this is not the way then any suggestions on how to get exponential backoff?

we are using spark 3.3 on AWS EMR 6.X. The spark job is triggered via sh file.