问:
‘OSError: [Errno 22] Invalid argument’ when attempting to open a file in the %LOCALAPPDATA%\Microsoft\WindowsApps directory
Python won't let me open this file. Why not? The format of the command is correct, and it's definitely a file that exists on disk.</p>
```<code>Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, os.path
>>> path = os.path.join(os.getenv('LOCALAPPDATA'), r"Microsoft\WindowsApps\ilspy.exe")
>>> f = open(path, "rb")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument: 'C:\\Users\\<my name>\\AppData\\Local\\Microsoft\\WindowsApps\\ilspy.exe'
>>>
</code>```

Body:
Python won't let me open this file. Why not? The format of the command is correct, and it's definitely a file that exists on disk.

Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, os.path
>>> path = os.path.join(os.getenv('LOCALAPPDATA'), r"Microsoft\WindowsApps\ilspy.exe")
>>> f = open(path, "rb")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument: 'C:\\Users\\<my name>\\AppData\\Local\\Microsoft\\WindowsApps\\ilspy.exe'
>>>


来源: stackexchange

问:
Using the Stripe API to allow a free trial of a single product in a multi-product subscription
We have three products, small, medium and large. I'm using the Stripe API to charge customers on a prorated for each product they use every month.

I'd like new customers to be able to have a free 14 day trial of the first small product they add to their subscription.

Picture a VPS company allowing a free trial of their small VPS, but wanting to charge if a customer adds a medium and large one in the first month.

The problem I'm encountering is that free trials apply to all products in a subscription. If I use the trial_period_days attribute when creating a subscription or a checkout session, that applies to all products in that subscription for that month. i.e. customer adds a small product, then adds 100 large products, and receives all of them for free during the trial.

I've tried looking into coupons as an alternative, as in applying the cost of a small product to a customers subscription, but if they remove a product at any time from the subscription, the pro-rated refund excludes the coupon, and so the amount vanishes.

Is there any way to use the Stripe API to product the first product only with a free trial; while still only having one recurring subscription?

ContentLicense: CC BY-SA 4.0


问:
Connecting to MySQL with Ecto in Docker
I am in the process of Dockerizing my project, and the following is my docker-compose.yml:

version: '3.8'

services:
  server:
    image: server
    environment:
      DB_HOST: 0.0.0.0
      DB_DATABASE: dev
      DB_PORT: 3306
      DB_USER: dev
      DB_PASSWORD: dev
    ports:
      - "4000:4000"
    restart: on-failure
    depends_on:
      database:
        condition: service_started
  database:
    image: mysql:latest
    command: --default-authentication-plugin=mysql_native_password
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: dev
      MYSQL_PASSWORD: dev
      MYSQL_DATABASE: dev
    volumes:
      - mysql_data:/var/lib/mysql

volumes:
  mysql_data:
```
<p>and the <code>Dockerfile</code> for <code>server</code>:</p>
```FROM elixir:latest

EXPOSE 4000

RUN mkdir /server
COPY . /server
WORKDIR /server

RUN mix local.rebar --force
RUN mix local.hex --force
RUN mix deps.get

RUN mix do compile

CMD [ "sh", "/server/entry.sh" ]
```
<p>where <code>entry.sh</code> is:</p>
<pre class="lang-bash prettyprint-override"><code># Exit on failure
set -e

mix ecto.create
mix ecto.migrate
mix run priv/repo/seeds.exs

exec mix phx.server
</code>```

When I run this using docker compose up, I get an error that Phoenix can't connect to the MySQL database. I have tried using hosts 0.0.0.0 and localhost, however both don't work.

This is the corresponding section of my config/dev.exs:

```<code>config :app, App.Repo
  username: System.get_env("DB_USER"),
  password: System.get_env("DB_PASSWORD"),
  hostname: System.get_env("DB_HOST"),
  database: System.get_env("DB_DATABASE"),
  port: 3306,
  stacktrace: true,
  pool_size: 10
</code>```

The following is the exact error message I get:

```<code>server-1    | 11:23:07.417 [error] GenServer #PID<0.272.0> terminating
server-1    | ** (DBConnection.ConnectionError) (0.0.0.0:3306) connection refused - :econnrefused
server-1    |     (db_connection 2.4.3) lib/db_connection/connection.ex:100: DBConnection.Connection.connect/2
server-1    |     (connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
server-1    |     (stdlib 4.2) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
server-1    | Last message: nil
server-1    | State: MyXQL.Connection
server-1    |
server-1    | 11:23:07.430 [error] GenServer #PID<0.278.0> terminating
server-1    | ** (DBConnection.ConnectionError) (0.0.0.0:3306) connection refused - :econnrefused
server-1    |     (db_connection 2.4.3) lib/db_connection/connection.ex:100: DBConnection.Connection.connect/2
server-1    |     (connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
server-1    |     (stdlib 4.2) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
server-1    | Last message: nil
server-1    | State: MyXQL.Connection
server-1    | ** (Mix) The database for App.Repo couldn't be created: %RuntimeError{message: "killed"}
server-1 exited with code 1
</code>```

Title: Connecting to MySQL with Ecto in Docker

Body:
I am in the process of Dockerizing my project, and the following is my docker-compose.yml:

version: '3.8'

services:
  server:
    image: server
    environment:
      DB_HOST: 0.0.0.0
      DB_DATABASE: dev
      DB_PORT: 3306
      DB_USER: dev
      DB_PASSWORD: dev
    ports:
      - "4000:4000"
    restart: on-failure
    depends_on:
      database:
        condition: service_started
  database:
    image: mysql:latest
    command: --default-authentication-plugin=mysql_native_password
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: dev
      MYSQL_PASSWORD: dev
      MYSQL_DATABASE: dev
    volumes:
      - mysql_data:/var/lib/mysql

volumes:
  mysql_data:

and the Dockerfile for server:

FROM elixir:latest

EXPOSE 4000

RUN mkdir /server
COPY . /server
WORKDIR /server

RUN mix local.rebar --force
RUN mix local.hex --force
RUN mix deps.get

RUN mix do compile

CMD [ "sh", "/server/entry.sh" ]

where entry.sh is:

# Exit on failure
set -e

mix ecto.create
mix ecto.migrate
mix run priv/repo/seeds.exs

exec mix phx.server

When I run this using docker compose up, I get an error that Phoenix can't connect to the MySQL database. I have tried using hosts 0.0.0.0 and localhost, however both don't work.

This is the corresponding section of my config/dev.exs:

config :app, App.Repo
  username: System.get_env("DB_USER"),
  password: System.get_env("DB_PASSWORD"),
  hostname: System.get_env("DB_HOST"),
  database: System.get_env("DB_DATABASE"),
  port: 3306,
  stacktrace: true,
  pool_size: 10

The following is the exact error message I get:

server-1    | 11:23:07.417 [error] GenServer #PID<0.272.0> terminating
server-1    | ** (DBConnection.ConnectionError) (0.0.0.0:3306) connection refused - :econnrefused
server-1    |     (db_connection 2.4.3) lib/db_connection/connection.ex:100: DBConnection.Connection.connect/2
server-1    |     (connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
server-1    |     (stdlib 4.2) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
server-1    | Last message: nil
server-1    | State: MyXQL.Connection
server-1    |
server-1    | 11:23:07.430 [error] GenServer #PID<0.278.0> terminating
server-1    | ** (DBConnection.ConnectionError) (0.0.0.0:3306) connection refused - :econnrefused
server-1    |     (db_connection 2.4.3) lib/db_connection/connection.ex:100: DBConnection.Connection.connect/2
server-1    |     (connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
server-1    |     (stdlib 4.2) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
server-1    | Last message: nil
server-1    | State: MyXQL.Connection
server-1    | ** (Mix) The database for App.Repo couldn't be created: %RuntimeError{message: "killed"}
server-1 exited with code 1


问:
Flutter Cubit State Design for Navigation
Good day everyone!
Let's imagine I am using Flutter Cubit with @freezed for an authentication screen. There are several ways on how to structure the state but all come with a problem I can't find a way around. I normally design my States like this:

```<code>@freezed
class SignUpState with _$SignUpState {
  const factory SignUpState({
    @Default('') String email,
    @Default('') String password,
    InputPasswordError? passwordError,
    InputEmailError? emailError,
    AppError? error,
    @Default(false) bool loadingStatus
    @Default(false) bool passwordVisibilityStatus,
    @Default(false) bool successBottomSheetVisibleStatus,
  }) = _SignUpState;
}
</code>```

If I now emit a new State when authentication is done with successBottomSheetVisibleStatus set to true it will show a bottom sheet form blocListener. On BottomSheet().show().then(cubit.onSuccessBottomSheetClosed) the status of successBottomSheetVisibleStatus will be set back to false. The Problem here is if I may want to emit a different State while the bottom sheet is still visible it will get re triggered. I know i can just check in listenWhen: (p, c) => p.status != c.status but this will prevent other events firing if i have multiple functionalities inside the listener.

I could rewrite the state into a different pattern like the following:

```<code>@freezed
class SignUpState with _$SignUpState {
  const factory SignUpState.initial(...) = SignUpStateInitial;
  const factory SignUpState.navigateToHome() = SignUpStateNavigateToHome;
}
</code>```

This approach would fix these issue BUT i always need the same state since. I also could fix this by adding buildWhen: (p, c) => c is SignUpStateInitial but that seems a bit to hacky and will cause other problems, since this check does not happen on the first state.

How to design the State in a way for it to be able to handle all these requirements?

Body:
Good day everyone!
Let's imagine I am using Flutter Cubit with @freezed for an authentication screen. There are several ways on how to structure the state but all come with a problem I can't find a way around. I normally design my States like this:

@freezed
class SignUpState with _$SignUpState {
  const factory SignUpState({
    @Default('') String email,
    @Default('') String password,
    InputPasswordError? passwordError,
    InputEmailError? emailError,
    AppError? error,
    @Default(false) bool loadingStatus
    @Default(false) bool passwordVisibilityStatus,
    @Default(false) bool successBottomSheetVisibleStatus,
  }) = _SignUpState;
}

If I now emit a new State when authentication is done with successBottomSheetVisibleStatus set to true it will show a bottom sheet form blocListener. On BottomSheet().show().then(cubit.onSuccessBottomSheetClosed) the status of successBottomSheetVisibleStatus will be set back to false. The Problem here is if I may want to emit a different State while the bottom sheet is still visible it will get re triggered. I know i can just check in listenWhen: (p, c) => p.status != c.status but this will prevent other events firing if i have multiple functionalities inside the listener.

I could rewrite the state into a different pattern like the following:

@freezed
class SignUpState with _$SignUpState {
  const factory SignUpState.initial(...) = SignUpStateInitial;
  const factory SignUpState.navigateToHome() = SignUpStateNavigateToHome;
}

This approach would fix these issue BUT i always need the same state since. I also could fix this by adding buildWhen: (p, c) => c is SignUpStateInitial but that seems a bit to hacky and will cause other problems, since this check does not happen on the first state.

How to design the State in a way for it to be able to handle all these requirements?


问:
Zapier Integration using Dotnet Identity Authentication
I have a Dotnet (core) application where I'm integrating Zapier. Now on Zapier's developer platform when I'm creating a new integration, the first step is Authentication where they have different types of auth, e.g. OAuth V2, Session Auth, etc. In my application, I authorize users and all the API calls using Dotnet's Identity Provider where I use User.Identity.IsAuthenticated to check whether the user is signed in and the Authorize attribute to verify an API call.

I tried all types of auth provided in Zapier's developer portal but it fails. I would really appreciate some input about integrating Zapier with my application.


问:
EXCEL: Look for cells in column with fuzzy duplicates
my problem is as follows:
Imagine I have a large Excel dataset that has a company identifier in column (A) and long string texts within cells in column (B). These texts in those cells contain many words, imagine it as being the company description. I need to find fuzzy duplicates in this database, i.e. an example could be:

In cell B2 I have:

"Amazon.com Inc (Amazon) is an online retailer and web service provider. The company provides products such as apparel, auto and industrial items, beauty and health products, electronics, grocery, books, games, jewellery, kids and baby products, movies, music, sports goods, toys, tools and other related products."

and in cell B222 I have:

"%& COMPANY DESCRIPTION: Amazon is an online retailer and web service provider. Amazon provides products such as apparel, auto and industrial items, beauty and health products, electronics, grocery, books, games, jewellery, kids and baby products, movies, music, sports goods, toys, tools and other related products. Amazon is a great company."

So my point is: is there a way to find B222 fast and somehow show in B2 that there is a fuzzy duplicate, e.g. with an 80% match, in B222?

I have tried multiple tools such as Ablebits and the Levenshtein Distance in VBA. However I am not 100% satisfied with the result.

Thank you for any help!

Best,


问:
How to remove value from state?
I need simple functionality: show Button when value is more than 0. And for this I use code below.

I created some Text Fields with similar states (4) and I don't understand why only in 3rd this didn't work.

My code:

```<code>export default function TextFields() {
...
const [showButton3, setShowButton3] = useState("");
...

  const handleChange = (event) => {
    setShowButton3(event.target.value);
    console.log("value is:", event.target.value);
  };

  return (

<InputOutlined
          type={"text"}
          id={"text3"}
          name={"text3"}
          value={showButton3}
          onChange={handleChange}
          leftElement={
            <Img
              width={36}
              height={36}
              radius={12}
              src={
                "https://images.unsplash.com/photo-1665174271625-178021f8b1a5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1160&q=80"
              }
            />
          }
          rightElement={
            showButton3 ? (
              <IconButton
                icon={<MdClose size={24} />}
                variant={"surface"}
                type="reset"
                onClick={() => setShowButton3("")}
              ></IconButton>
            ) : null
          }
        >
          Your name
        </InputOutlined>
)}
</code>```

I have checked Component, here I add some text

And when I want to clear value, I get this

You can see, value is cleared. But I still see it in my input. How to fix that? Or maybe I doing something wrong?

Proof:

This is very similar Components. I changed id, but I don't understand why value isn't removed. Maybe I need to use useRef or useId. But I have 4 different inputs and only 1 have this issue.

Title: How to remove value from state?

Body:
I need simple functionality: show Button when value is more than 0. And for this I use code below.

I created some Text Fields with similar states (4) and I don't understand why only in 3rd this didn't work.

My code:

export default function TextFields() {
...
const [showButton3, setShowButton3] = useState("");
...

  const handleChange = (event) => {
    setShowButton3(event.target.value);
    console.log("value is:", event.target.value);
  };

  return (

<InputOutlined
          type={"text"}
          id={"text3"}
          name={"text3"}
          value={showButton3}
          onChange={handleChange}
          leftElement={

          }
          rightElement={
            showButton3 ? (
              <IconButton
                icon={<MdClose size={24} />}
                variant={"surface"}
                type="reset"
                onClick={() => setShowButton3("")}
              ></IconButton>
            ) : null
          }
        >
          Your name
        </InputOutlined>
)}

I have checked Component, here I add some text

And when I want to clear value, I get this

You can see, value is cleared. But I still see it in my input. How to fix that? Or maybe I doing something wrong?

Proof:

This is very similar Components. I changed id, but I don't understand why value isn't removed. Maybe I need to use useRef or useId. But I have 4 different inputs and only 1 have this issue.


问:
Cache connection in rails using graphql and graphql-fragment_cache
I have a rails app using the ruby-graphql and graphql-fragment_cache gem and a query for pages:

field :all_pages, PageType.connection_type, null: true
```
<p>When I resolve and cache it using the graphql-fragment_cache gem all the pages get cached - which makes sense of course.</p>
<pre class="lang-rb prettyprint-override"><code>def all_pages
  cache_fragment {
    chain = Page
    chain = scope_status(chain, context[:stage])
    chain = lookahead_for_collection(chain, lookahead)
    chain = search_records(chain, search)
    chain = order_records(chain, order)
    chain.all
  }
end
</code>```

I am using the api in a Gatsby website. So whenever there is an update in my rails app a webhook gets posted to Gatsby Cloud to rebuild the site. This rebuild will fetch all pages with all available fields which is very heavy. Also because they are a lot.

Is there an option to cache all pages but only invalidate a single one (similar to rails.cache.fetch_multi) so that all pages that did not change get fetched from the cache except the one that changed? This would speed up my app significantly.

Thank you!

Body:
I have a rails app using the ruby-graphql and graphql-fragment_cache gem and a query for pages:

field :all_pages, PageType.connection_type, null: true

When I resolve and cache it using the graphql-fragment_cache gem all the pages get cached - which makes sense of course.

def all_pages
  cache_fragment {
    chain = Page
    chain = scope_status(chain, context[:stage])
    chain = lookahead_for_collection(chain, lookahead)
    chain = search_records(chain, search)
    chain = order_records(chain, order)
    chain.all
  }
end

I am using the api in a Gatsby website. So whenever there is an update in my rails app a webhook gets posted to Gatsby Cloud to rebuild the site. This rebuild will fetch all pages with all available fields which is very heavy. Also because they are a lot.

Is there an option to cache all pages but only invalidate a single one (similar to rails.cache.fetch_multi) so that all pages that did not change get fetched from the cache except the one that changed? This would speed up my app significantly.

Thank you!


问:
Send data in a complete tree structure using django serializers
I have 2 models: Folder and Entity.

```<code>class Folder(models.Model):
    name = models.CharField(max_length=255, null=False, blank=False)
    parent = models.ForeignKey('self', on_delete=models.SET_NULL, null=True, blank=True, related_name="child")

class Entity(models.Model):
    name = models.CharField(max_length=255, null=False, blank=False)
    folder = models.ForeignKey('Folder', on_delete=models.SET_NULL, null=True, blank=True, related_name="entities")
</code>```

So a folder can have both child folders and entities. Now I want to send the data in a tree structure and I have written a serializer for it.

```<code>class ListFolderSerializer(serializers.ModelSerializer):
    children = serializers.SerializerMethodField()

    class Meta:
        model = Folder
        fields = ['id', 'name', 'children']

    def get_children(self, instance):
        child_folders = Folder.objects.filter(parent=instance).order_by("name")
        child_entities = Entity.objects.filter(folder=instance).order_by("name")
        all_children = []
        if child_folders or child_entities:
            child_folders_data = ListFolderSerializer(child_folders, many=True).data
            child_entities_data = ListEntitySerializer(child_entities, many=True).data
            all_children.extend(child_folders_data)
            all_children.extend(child_entities_data)
            return all_children
        else:
            return None

class ListEntitySerializer(serializers.ModelSerializer):

    class Meta:
        model = Entity
        fields = ['id', 'name']
</code>```

This is working fine but as the data keep on increasing the time to get this tree is increasing. So any optimized way to do this?

Body:
I have 2 models: Folder and Entity.

class Folder(models.Model):
    name = models.CharField(max_length=255, null=False, blank=False)
    parent = models.ForeignKey('self', on_delete=models.SET_NULL, null=True, blank=True, related_name="child")

class Entity(models.Model):
    name = models.CharField(max_length=255, null=False, blank=False)
    folder = models.ForeignKey('Folder', on_delete=models.SET_NULL, null=True, blank=True, related_name="entities")

So a folder can have both child folders and entities. Now I want to send the data in a tree structure and I have written a serializer for it.

class ListFolderSerializer(serializers.ModelSerializer):
    children = serializers.SerializerMethodField()

    class Meta:
        model = Folder
        fields = ['id', 'name', 'children']

    def get_children(self, instance):
        child_folders = Folder.objects.filter(parent=instance).order_by("name")
        child_entities = Entity.objects.filter(folder=instance).order_by("name")
        all_children = []
        if child_folders or child_entities:
            child_folders_data = ListFolderSerializer(child_folders, many=True).data
            child_entities_data = ListEntitySerializer(child_entities, many=True).data
            all_children.extend(child_folders_data)
            all_children.extend(child_entities_data)
            return all_children
        else:
            return None

class ListEntitySerializer(serializers.ModelSerializer):

    class Meta:
        model = Entity
        fields = ['id', 'name']

This is working fine but as the data keep on increasing the time to get this tree is increasing. So any optimized way to do this?


问:
Is there an optimized way to convert a numpy array to fortran order when using memmaps
I have a memmapped numpy array:

```<code>arr = np.load("a.npy", mmap_mode='r')
</code>```

It is bigger than my memory. For my further computation I need it in fortran order instead of C. So I can use np.asfortranarray to convert it and then use np.save to store it in a new file.

However when I do this my memory usage increases proportionally to the input and as such makes me think that an object is being created in memory, I would like it to be fully a, file to file interaction.

How can I convert a.npy into fortran order without having the full object in memory?

For example, I have array:

```<code>arr =array([[1, 2],
            [3, 4]])
</code>```

This is stored on disk as follows by numpy:

```<code>fortran_order: False
01 02 03 04
</code>```

I can do the following transformations:

1

```<code>np.asfortranarray(arr)
array([[1, 2],
       [3, 4]])
</code>```

saved as:

```<code>fortran_order: True
01 03 02 04
</code>```

2

```<code>np.asfortranarray(arr.T)
array([[1, 3],
       [2, 4]])
</code>```

saved as:

```<code>fortran_order: True
01 02 03 04
</code>```

3

```<code>arr.T
array([[1, 3],
       [2, 4]])
</code>```

saved as:

```<code>fortran_order: True
01 02 03 04
</code>```

arr.T only converts the high level accessiblity, I need the on disk ordering to be swapped (this will help with my overall task by keeping the array indexing with C in cache). This can be done by calling np.asfortranarray without arr.T however this incurs a full data copy instead of a transposed view being created and written in the transposed order.

Body:
I have a memmapped numpy array:

arr = np.load("a.npy", mmap_mode='r')

It is bigger than my memory. For my further computation I need it in fortran order instead of C. So I can use np.asfortranarray to convert it and then use np.save to store it in a new file.

However when I do this my memory usage increases proportionally to the input and as such makes me think that an object is being created in memory, I would like it to be fully a, file to file interaction.

How can I convert a.npy into fortran order without having the full object in memory?

For example, I have array:

arr =array([[1, 2],
            [3, 4]])

This is stored on disk as follows by numpy:

fortran_order: False
01 02 03 04

I can do the following transformations:

1

np.asfortranarray(arr)
array([[1, 2],
       [3, 4]])

saved as:

fortran_order: True
01 03 02 04

2

np.asfortranarray(arr.T)
array([[1, 3],
       [2, 4]])

saved as:

fortran_order: True
01 02 03 04

3

arr.T
array([[1, 3],
       [2, 4]])

saved as:

fortran_order: True
01 02 03 04

arr.T only converts the high level accessiblity, I need the on disk ordering to be swapped (this will help with my overall task by keeping the array indexing with C in cache). This can be done by calling np.asfortranarray without arr.T however this incurs a full data copy instead of a transposed view being created and written in the transposed order.


问:
Specify executable virtual memory origin in bare-metal ELF Rust linker
I am building an operating system in Rust, and so far I have used a configuration where the kernel is mapped in the lower part of the address space. Now I have reached a point where I am loading userspace executables, and it is very counterintuitive to have all executables linked to map themselves to higher addresses. I haven't set it myself, but it seems that Rust maps my kernel's executable sections to address 0x200000 by default (checked using objdump -h).

I am using the following target json:

```<code>{
    "llvm-target": "x86_64-unknown-none",
    "data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
    "arch": "x86_64",
    "target-endian": "little",
    "target-pointer-width": "64",
    "target-c-int-width": "32",
    "os": "none",
    "executables": true,
    "linker-flavor": "ld.lld",
    "linker": "rust-lld",
    "panic-strategy": "abort",
    "disable-redzone": true,
    "features": "-mmx,-sse,+soft-float"
}
</code>```

I have tried to use rustc parameter -Clink-arg=-Tlink.ld. link.ld is a script which has the following:

```<code>MEMORY {
    KERNEL(rx): ORIGIN = 0xc0000000, LENGTH = 1024M
}
</code>```

However, this does not seem to do anything. It doesn't even give a linker error when I introduce a syntax error into this linker script. How can I make my kernel map itself to 0xc0000000? The bootloader I'm using supports this, and automatically maps ELF sections where they belong.

Body:
I am building an operating system in Rust, and so far I have used a configuration where the kernel is mapped in the lower part of the address space. Now I have reached a point where I am loading userspace executables, and it is very counterintuitive to have all executables linked to map themselves to higher addresses. I haven't set it myself, but it seems that Rust maps my kernel's executable sections to address 0x200000 by default (checked using objdump -h).

I am using the following target json:

{
    "llvm-target": "x86_64-unknown-none",
    "data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
    "arch": "x86_64",
    "target-endian": "little",
    "target-pointer-width": "64",
    "target-c-int-width": "32",
    "os": "none",
    "executables": true,
    "linker-flavor": "ld.lld",
    "linker": "rust-lld",
    "panic-strategy": "abort",
    "disable-redzone": true,
    "features": "-mmx,-sse,+soft-float"
}

I have tried to use rustc parameter -Clink-arg=-Tlink.ld. link.ld is a script which has the following:

MEMORY {
    KERNEL(rx): ORIGIN = 0xc0000000, LENGTH = 1024M
}

However, this does not seem to do anything. It doesn't even give a linker error when I introduce a syntax error into this linker script. How can I make my kernel map itself to 0xc0000000? The bootloader I'm using supports this, and automatically maps ELF sections where they belong.


问:
Alternate clicking on multiple dropdown options with selenium
This python function below, clicks on all downward arrow on the test page, then from the lists thats drops down, clicks on London amongst a list of other cities, including Berlin, Dubai, New York.

```<code>def selover15():
    itemgg = driver.find_elements(By.XPATH, "//span[@class='af-select-icon-item']")
    elems = driver.find_elements(By.XPATH, "//span[text()='London']")
    for items in itemgg:
      for x in elems:
        driver.execute_script("arguments[0].click();", x)
      driver.execute_script("arguments[0].click();", items)
</code>```

However, I need to alternate clicking  with London, then Berlin.
Instead of London, London, London... I want London, Berlin, London, Berlin... How do i achieve this please?

Body:
This python function below, clicks on all downward arrow on the test page, then from the lists thats drops down, clicks on London amongst a list of other cities, including Berlin, Dubai, New York.

def selover15():
    itemgg = driver.find_elements(By.XPATH, "//span[@class='af-select-icon-item']")
    elems = driver.find_elements(By.XPATH, "//span[text()='London']")
    for items in itemgg:
      for x in elems:
        driver.execute_script("arguments[0].click();", x)
      driver.execute_script("arguments[0].click();", items)

However, I need to alternate clicking  with London, then Berlin.
Instead of London, London, London... I want London, Berlin, London, Berlin... How do i achieve this please?


问:
Get top 10 records from each parent category in a single array
I have 2 collection- 'video' & 'category', I have to join them and show columns from both the collection then i have to fetch 10 video_id of each parent category in single array. I am attaching the query which i wrote

fetching 10 video_id of each parent category-

```<code>db.vid_v2.aggregate([
  { $match: {"parent_category": { $exists: true, $ne: null } } },
  {$group: {_id: "$parent_category"}}
]).forEach(function(doc){
  print(db.vid_v2.find({parent_category: doc._id},{parent_category :1 , video_id: 1}).sort({date:1}).limit(10))})
</code>```

the above query is working but the output is in multiple array, I need the output in single array with joining the video collection with category collection and showing category_name in the output

ps - video_id and parent_category are from video collection,

Any help will be appreciated.

Body:
I have 2 collection- 'video' & 'category', I have to join them and show columns from both the collection then i have to fetch 10 video_id of each parent category in single array. I am attaching the query which i wrote

fetching 10 video_id of each parent category-

db.vid_v2.aggregate([
  { $match: {"parent_category": { $exists: true, $ne: null } } },
  {$group: {_id: "$parent_category"}}
]).forEach(function(doc){
  print(db.vid_v2.find({parent_category: doc._id},{parent_category :1 , video_id: 1}).sort({date:1}).limit(10))})

the above query is working but the output is in multiple array, I need the output in single array with joining the video collection with category collection and showing category_name in the output

ps - video_id and parent_category are from video collection,

Any help will be appreciated.


问:
Color correcting one image to fit another
I have a bunch of optical microscopy images of graphene, where we've taken an image before an after the samples have been subject to different treatments. Unfortunately something has gone wrong in the calibration of most of the latter images, meaning that they look darker and has a different color compared the first. We have +40 image pairs and manually color correcting them is both extremely time consuming and too imprecise. What i would like to do is find a good basis for color correction from one photo to another, which i can then apply to all the images. Beneath is shown an exampleBefore (Upper) and after (Lower)

Does anyone know a way to do this?

For example of full quality images:
https://imgur.com/a/93KRhLM

I've tried to manually color correct in Gimp, but i gave up after 2 hours of adjustments


问:
How to do this in flutter

This a time slot picker for booking meeting rooms, I want to show the booked times and select (from the available times) the start time and end time by sliding

Title: How to do this in flutter


问:
How to give policy to other branch than default in azuredevops by terraform
I want to give policy to other branch than default one. For example azuredevops_branch_policy_status_check

I have this module:

```<code>resource "azuredevops_user_entitlement" "example-entitlement" {
  principal_name       = var.username
  account_license_type = "basic"
}

resource "azuredevops_branch_policy_status_check" "example-status-check" {
  project_id = azuredevops_project.project.id

  enabled  = true
  blocking = true

  settings {
    name                 = "Release"
    author_id            = azuredevops_user_entitlement.example-entitlement.id
    invalidate_on_update = true
    applicability        = "conditional"
    display_name         = "PreCheck"

    scope {
      repository_id  = azuredevops_git_repository.example-import.id
      repository_ref = azuredevops_git_repository.example-import.default_branch
      match_type     = "Exact"
    }

    scope {
      match_type     = "DefaultBranch"
    }
  }
}
</code>```

and I wonder where should I put other branch so the policy would be applied to the one I want not the default branch (for example my other branch's name is test-branch)

Body:
I want to give policy to other branch than default one. For example azuredevops_branch_policy_status_check

I have this module:

resource "azuredevops_user_entitlement" "example-entitlement" {
  principal_name       = var.username
  account_license_type = "basic"
}

resource "azuredevops_branch_policy_status_check" "example-status-check" {
  project_id = azuredevops_project.project.id

  enabled  = true
  blocking = true

  settings {
    name                 = "Release"
    author_id            = azuredevops_user_entitlement.example-entitlement.id
    invalidate_on_update = true
    applicability        = "conditional"
    display_name         = "PreCheck"

    scope {
      repository_id  = azuredevops_git_repository.example-import.id
      repository_ref = azuredevops_git_repository.example-import.default_branch
      match_type     = "Exact"
    }

    scope {
      match_type     = "DefaultBranch"
    }
  }
}

and I wonder where should I put other branch so the policy would be applied to the one I want not the default branch (for example my other branch's name is test-branch)


问:
aws kubernetes version update
I need some help
aws forcing me to update my production cluster 1.21 to 1.22
so, is it safe and what are the pitfalls I may encounter?
If I understood correctly when pressing update button it is going to update only control plane? And if so, can I use with my updated control plane my worker nodes with old workloads (yaml files) ? Or can I update my control plane and create new group with worker nodes and move pods to updated nodes? And how to be with statefulsets, they have pvc and if I move stateful pod to another node how could it find pvc?</p>

Title: aws kubernetes version update


问:
Script for a web link to try two mirror links and if the first times out, opens the second one instead?
For context, the problem I'm facing is that our business still has to use Internet Explorer 11 for some of our stuff. As a result, loads of people are trying to open newer sites (like mine) which are only accessible on newer browsers like Edge and Chrome. I have not accommodated for IE when building because it will be phased out completely from our business in the next 6 months.

I've tried to force users to open the link (to my site) in Edge, by using the link href edge-browser:http://google.co.uk/ however the problem with this is that if the user is already using Edge browser, Edge doesn't recognise the edge-browser: prefix and the link just times out! Very infuriating.

I'm wondering if anyone has a work-around, or whether there might be a way to script a button that tries the Edge link first and if it times out after 3-4 seconds, reverts to the second link instead? What about if there is a way of detecting which browser the user is using, and only showing them the appropriate link? I've trialed having two links present but our employees don't understand the difference or which link to press, and are complaining that the formatting of the site is all wrong when accessing via IE.

Let me know what you think - sorry, I am not very tech-savvy when it comes to browsers.


问:
error for piecewise regression function call
Here is what I want to do:

I create a timeseries signal

Calculate a second signal called RSI

Calculate and return indexes for when the RSI passes min and max thresholds using the function def get_break_indices.

Make a piece wise regression and use the indexes in (3) to use as breakpoints in the def piecewise_linear_regression.

```<code> def get_break_indices(y, rsi, upper_threshold=60, lower_threshold=30):

 # Initialize the list of breaks
 breaks = []

 # Initialize a flag to track whether the RSI value has previously passed the upper or lower threshold
 passed_threshold = False

 # Iterate over the RSI values
 for i in range(len(rsi)):
     # If the RSI value passes the upper threshold or the lower threshold,
     # add the index to the list of breaks if the RSI value has not previously passed the threshold
     # and the index is not already in the list
     if rsi[i] > upper_threshold or rsi[i] < lower_threshold:
         if not passed_threshold and i not in breaks:
             breaks.append(i)
             passed_threshold = True
     # If the RSI value does not pass the upper or lower threshold, reset the flag
     else:
         passed_threshold = False

 return breaks
</code>```

Piece wise regression function:

```<code> def piecewise_linear_regression(X_train, y_train, X_test, breaks):
    # Initialize an array to store the predictions
    y_pred = np.zeros(len(X_test))
    # Initialize the start index for the training data slice
    start = 0
    # Iterate through the break indices
    for i, end in enumerate(breaks):
        # Skip the iteration if there are no samples in the training data slice
        # This check is necessary because the breaks list may contain consecutive indices
        if start == end:
            start += 1
            continue
        # Calculate the start and end indices for the test data slice
        test_start = breaks[i] + len(X_train)
        test_end = breaks[i + 1] + len(X_train) + 1 if i + 1 < len(breaks) else len(X_test)
        # Skip the iteration if there are no samples in the test data slice
        if test_start == test_end:
            continue
        # Fit a linear regression model to the training data slice
        reg = LinearRegression().fit(X_train[start:end], y_train[start:end])
        # Use the model to make predictions for the current test data slice
        y_pred[test_start:test_end] = reg.predict(X_test[test_start:test_end]).reshape(y_pred[test_start:test_end].shape)
        # Update the start index for the next iteration
        start = end
    return y_pred
</code>```

Test example that fails:

```<code>X = np.arange(0, 100).reshape(-1, 1)

y = np.sin(2 * np.pi * X) + np.random.randn(100, 1)

# Split the data into training and test sets
X_train, X_test = X[:80], X[80:]
y_train, y_test = y[:80], y[80:]

# Calculate the RSI values for the training data
rsi = np.zeros_like(y_train)
for i in range(1, len(y_train)):
    if y_train[i] > y_train[i-1]:
        rsi[i] = 100 - 100 / (1 + (y_train[i] / y_train[i-1]))
    else:
        rsi[i] = 100 - 100 / (1 + (y_train[i-1] / y_train[i]))

# Get the indices of the time series data when the RSI values pass the upper threshold or the lower threshold
breaks = get_break_indices(y_train, rsi)

# Convert the breaks list to a numpy array
breaks = np.array(breaks)

y_pred = piecewise_linear_regression(X_train, y_train, X_test, breaks)
plt.plot(X_train, y_train, label='Training Data')
plt.plot(X_test, y_test, label='Test Data')
plt.plot(X_test, y_pred, label='Prediction')
plt.legend()
plt.show()
</code>```

This gives me an error I can't figure out how to solve:

```<code>y_pred = piecewise_linear_regression(X_train, y_train, X_test, breaks)
Traceback (most recent call last):

  File "<ipython-input-94-3b9258c6d489>", line 26, in <module>
    y_pred = piecewise_linear_regression(X_train, y_train, X_test, breaks)

  File "<ipython-input-93-f47a28fa273f>", line 22, in piecewise_linear_regression
    y_pred[test_start:test_end] = reg.predict(X_test[test_start:test_end]).reshape(y_pred[test_start:test_end].shape)

  File "/opt/anaconda3/lib/python3.8/site-packages/sklearn/linear_model/_base.py", line 238, in predict
    return self._decision_function(X)

  File "/opt/anaconda3/lib/python3.8/site-packages/sklearn/linear_model/_base.py", line 220, in _decision_function
    X = check_array(X, accept_sparse=['csr', 'csc', 'coo'])

  File "/opt/anaconda3/lib/python3.8/site-packages/sklearn/utils/validation.py", line 63, in inner_f
    return f(*args, **kwargs)

  File "/opt/anaconda3/lib/python3.8/site-packages/sklearn/utils/validation.py", line 669, in check_array
    raise ValueError("Found array with %d sample(s) (shape=%s) while a"

ValueError: Found array with 0 sample(s) (shape=(0, 1)) while a minimum of 1 is required.
</code>```

Body:
Here is what I want to do:

I create a timeseries signal

Calculate a second signal called RSI

Calculate and return indexes for when the RSI passes min and max thresholds using the function def get_break_indices.

Make a piece wise regression and use the indexes in (3) to use as breakpoints in the def piecewise_linear_regression.

 def get_break_indices(y, rsi, upper_threshold=60, lower_threshold=30):

 # Initialize the list of breaks
 breaks = []

 # Initialize a flag to track whether the RSI value has previously passed the upper or lower threshold
 passed_threshold = False

 # Iterate over the RSI values
 for i in range(len(rsi)):
     # If the RSI value passes the upper threshold or the lower threshold,
     # add the index to the list of breaks if the RSI value has not previously passed the threshold
     # and the index is not already in the list
     if rsi[i] > upper_threshold or rsi[i] < lower_threshold:
         if not passed_threshold and i not in breaks:
             breaks.append(i)
             passed_threshold = True
     # If the RSI value does not pass the upper or lower threshold, reset the flag
     else:
         passed_threshold = False

 return breaks

Piece wise regression function:

 def piecewise_linear_regression(X_train, y_train, X_test, breaks):
    # Initialize an array to store the predictions
    y_pred = np.zeros(len(X_test))
    # Initialize the start index for the training data slice
    start = 0
    # Iterate through the break indices
    for i, end in enumerate(breaks):
        # Skip the iteration if there are no samples in the training data slice
        # This check is necessary because the breaks list may contain consecutive indices
        if start == end:
            start += 1
            continue
        # Calculate the start and end indices for the test data slice
        test_start = breaks[i] + len(X_train)
        test_end = breaks[i + 1] + len(X_train) + 1 if i + 1 < len(breaks) else len(X_test)
        # Skip the iteration if there are no samples in the test data slice
        if test_start == test_end:
            continue
        # Fit a linear regression model to the training data slice
        reg = LinearRegression().fit(X_train[start:end], y_train[start:end])
        # Use the model to make predictions for the current test data slice
        y_pred[test_start:test_end] = reg.predict(X_test[test_start:test_end]).reshape(y_pred[test_start:test_end].shape)
        # Update the start index for the next iteration
        start = end
    return y_pred

Test example that fails:

X = np.arange(0, 100).reshape(-1, 1)

y = np.sin(2 * np.pi * X) + np.random.randn(100, 1)

# Split the data into training and test sets
X_train, X_test = X[:80], X[80:]
y_train, y_test = y[:80], y[80:]

# Calculate the RSI values for the training data
rsi = np.zeros_like(y_train)
for i in range(1, len(y_train)):
    if y_train[i] > y_train[i-1]:
        rsi[i] = 100 - 100 / (1 + (y_train[i] / y_train[i-1]))
    else:
        rsi[i] = 100 - 100 / (1 + (y_train[i-1] / y_train[i]))

# Get the indices of the time series data when the RSI values pass the upper threshold or the lower threshold
breaks = get_break_indices(y_train, rsi)

# Convert the breaks list to a numpy array
breaks = np.array(breaks)

y_pred = piecewise_linear_regression(X_train, y_train, X_test, breaks)
plt.plot(X_train, y_train, label='Training Data')
plt.plot(X_test, y_test, label='Test Data')
plt.plot(X_test, y_pred, label='Prediction')
plt.legend()
plt.show()

This gives me an error I can't figure out how to solve:

y_pred = piecewise_linear_regression(X_train, y_train, X_test, breaks)
Traceback (most recent call last):

  File "<ipython-input-94-3b9258c6d489>", line 26, in <module>
    y_pred = piecewise_linear_regression(X_train, y_train, X_test, breaks)

  File "<ipython-input-93-f47a28fa273f>", line 22, in piecewise_linear_regression
    y_pred[test_start:test_end] = reg.predict(X_test[test_start:test_end]).reshape(y_pred[test_start:test_end].shape)

  File "/opt/anaconda3/lib/python3.8/site-packages/sklearn/linear_model/_base.py", line 238, in predict
    return self._decision_function(X)

  File "/opt/anaconda3/lib/python3.8/site-packages/sklearn/linear_model/_base.py", line 220, in _decision_function
    X = check_array(X, accept_sparse=['csr', 'csc', 'coo'])

  File "/opt/anaconda3/lib/python3.8/site-packages/sklearn/utils/validation.py", line 63, in inner_f
    return f(*args, **kwargs)

  File "/opt/anaconda3/lib/python3.8/site-packages/sklearn/utils/validation.py", line 669, in check_array
    raise ValueError("Found array with %d sample(s) (shape=%s) while a"

ValueError: Found array with 0 sample(s) (shape=(0, 1)) while a minimum of 1 is required.


问:
Pine Script logic for plotshapes, got most working but stuck on two
I've got most of the plotshapes working but I can't figure out the final two.

Basically the code is an RSI, but it highlights when the RSI has broken out of a diagonal channel, or out of breaks a horizontal level (using pivots). These are shown by teal and magenta triangles.

I've got correctly plotted shapes and alerts for the horizontal breaks, and also for:

no break to long diagonal (blue arrows)

no break to short diagonal (red arrows)

long diagonal break ending (grey dot)

short diagonal break ending (grey dot)

I can't get the logic correct for a long diagonal going directly to a short (without grey RSI in-between) and vice versa

Code is below, I have tried to remove as much unneeded code as possible, and have commented to help you understand what is what in the code.

I think you only need to look near the bottom where I commented:

//--------------------------- LOOK HERE AND DOWNWARDS ---------------------------//

Here is the full code:

```<code>//@version=5
indicator('test', overlay=false)

//-------------------- INPUTS -------------------- //
// Section Titles
grrsi='ðŸ“ˆ Relative Strength Index ðŸ“ˆ'
grhts='ðŸš¦ Range Shifts ðŸš¦'
// Colours
red=color.red
gray=color.gray
yellow=color.yellow
fuchsia = #da00ff
aqua = #00ffef

len = input.int(14, minval=1, title='RSI Length', group=grrsi)
showDiags = input(true, title='Show Diag Breaks', group=grrsi)

ShowPivots = input(false, title='Show Pivot Points', group=grrsi)
left = input.int(10, minval=1, title='Pivot Length Left Hand Side', group=grrsi)
right = input.int(10, minval=1, title='Pivot Length Right Hand Side', group=grrsi)

// RSI
rsi = ta.rsi(close, len)

//-------------------- PIVOTS -------------------- //
// Adapted from 'Pivot Points High Low (HH/HL/LH/LL)' - Mohamed3nan

// Determine pivots
pvtLenL = left
pvtLenR = right

// Get High and Low Pivot Points
pvthi = ta.pivothigh(rsi, pvtLenL, pvtLenR)
pvtlo = ta.pivotlow(rsi, pvtLenL, pvtLenR)

// Get HH, LH, LL, HL
valuewhen_1 = ta.valuewhen(pvthi, rsi[pvtLenR], 1)
valuewhen_2 = ta.valuewhen(pvthi, rsi[pvtLenR], 0)
higherhigh = na(pvthi) ? na : valuewhen_1 < valuewhen_2 ? pvthi : na
valuewhen_3 = ta.valuewhen(pvthi, rsi[pvtLenR], 1)
valuewhen_4 = ta.valuewhen(pvthi, rsi[pvtLenR], 0)
lowerhigh = na(pvthi) ? na : valuewhen_3 > valuewhen_4 ? pvthi : na
valuewhen_5 = ta.valuewhen(pvtlo, rsi[pvtLenR], 1)
valuewhen_6 = ta.valuewhen(pvtlo, rsi[pvtLenR], 0)
higherlow = na(pvtlo) ? na : valuewhen_5 < valuewhen_6 ? pvtlo : na
valuewhen_7 = ta.valuewhen(pvtlo, rsi[pvtLenR], 1)
valuewhen_8 = ta.valuewhen(pvtlo, rsi[pvtLenR], 0)
lowerlow = na(pvtlo) ? na : valuewhen_7 > valuewhen_8 ? pvtlo : na

plot(ShowPivots ? rsi[pvtLenR] : na, 'HH', style=plot.style_circles, linewidth=2, color=higherhigh ? aqua : na, offset=-pvtLenR)
plot(ShowPivots ? rsi[pvtLenR] : na, 'HL', style=plot.style_circles, linewidth=2, color=higherlow ? aqua : na, offset=-pvtLenR)
plot(ShowPivots ? rsi[pvtLenR] : na, 'LH', style=plot.style_circles, linewidth=2, color=lowerhigh ? fuchsia : na, offset=-pvtLenR)
plot(ShowPivots ? rsi[pvtLenR] : na, 'LL', style=plot.style_circles, linewidth=2, color=lowerlow ? fuchsia : na, offset=-pvtLenR)

//Count How many candles for current Pivot Level, If new reset.
counthi = 0
countlo = 0
counthi := na(pvthi) ? nz(counthi[1]) + 1 : 0
countlo := na(pvtlo) ? nz(countlo[1]) + 1 : 0

pvthis = 0.0
pvtlos = 0.0
pvthis := na(pvthi) ? pvthis[1] : rsi[pvtLenR]
pvtlos := na(pvtlo) ? pvtlos[1] : rsi[pvtLenR]

// Horizontal Pivot State
var stateHB = 0
if ta.crossover(rsi, pvthis)
    stateHB := 1
    stateHB
if ta.crossunder(rsi, pvtlos)
    stateHB := 2
    stateHB
stateHB := stateHB

statechangeL = ta.crossover(rsi, pvthis) and stateHB[1] == 2
statechangeS = ta.crossunder(rsi, pvtlos) and stateHB[1] == 1
stateHB_col = stateHB == 1 ? color.blue : stateHB == 2 ? color.red : na

//-------------------- DIAGONALS -------------------- //
// Adapted from 'Trendlines' - BacktestRookies

ph = pvthi
pl = pvtlo

phv1 = ta.valuewhen(ph, rsi[right], 0)
phb1 = ta.valuewhen(ph, bar_index[right], 0)
phv2 = ta.valuewhen(ph, rsi[right], 1)
phb2 = ta.valuewhen(ph, bar_index[right], 1)

plv1 = ta.valuewhen(pl, rsi[right], 0)
plb1 = ta.valuewhen(pl, bar_index[right], 0)
plv2 = ta.valuewhen(pl, rsi[right], 1)
plb2 = ta.valuewhen(pl, bar_index[right], 1)

// TRENDLINE CODE
// --------------
get_slope(x1, x2, y1, y2) =>
    m = (y2 - y1) / (x2 - x1)
    m

get_y_intercept(m, x1, y1) =>
    b = y1 - m * x1
    b

get_y(m, b, ts) =>
    Y = m * ts + b
    Y

int res_x1 = na
float res_y1 = na
int res_x2 = na
float res_y2 = na

int sup_x1 = na
float sup_y1 = na
int sup_x2 = na
float sup_y2 = na

// Resistance
res_x1 := ph ? phb1 : res_x1[1]
res_y1 := ph ? phv1 : res_y1[1]
res_x2 := ph ? phb2 : res_x2[1]
res_y2 := ph ? phv2 : res_y2[1]

res_m = get_slope(res_x1, res_x2, res_y1, res_y2)
res_b = get_y_intercept(res_m, res_x1, res_y1)
res_y = get_y(res_m, res_b, bar_index)

// Support
sup_x1 := pl ? plb1 : sup_x1[1]
sup_y1 := pl ? plv1 : sup_y1[1]
sup_x2 := pl ? plb2 : sup_x2[1]
sup_y2 := pl ? plv2 : sup_y2[1]

sup_m = get_slope(sup_x1, sup_x2, sup_y1, sup_y2)
sup_b = get_y_intercept(sup_m, sup_x1, sup_y1)
sup_y = get_y(sup_m, sup_b, bar_index)

//--------------------------- LOOK HERE AND DOWNWARDS ---------------------------//
//--------------------------- LOOK HERE AND DOWNWARDS ---------------------------//
//--------------------------- LOOK HERE AND DOWNWARDS ---------------------------//

// Diagonal Breaks
long_break = rsi > res_y ? color.blue : na
short_break = rsi < sup_y ? color.red : na
no_break = rsi < res_y and rsi > sup_y ? gray : na

//-------------------- Plots -------------------- //
//Plot the diagonal colours on the RSI Line
r = plot(rsi, 'RSI', color=not showDiags ? yellow : na, linewidth=1)
rl = plot(showDiags ? rsi : na, color=long_break, title='RSI Long Diag', style=plot.style_line, linewidth=2)
rs = plot(showDiags ? rsi : na, color=short_break, title='RSI Short Diag', style=plot.style_line, linewidth=2)
rnb = plot(showDiags ? rsi : na, color=no_break, title='RSI No Diag', style=plot.style_line, linewidth=1)

diag_long = false
diag_short = false
no_diagL = false
no_diagS = false
HZB_L = false
HZB_S = false
diag_long2 = false
diag_short2 = false

// Logic for plotshapes
//no break to long diagonal (blue arrows)
if (rsi[1] < res_y[1] and rsi[1] > sup_y[1] and rsi > res_y)
    diag_long := true
else
    diag_long :=  false

// no break to short diagonal (red arrows)
if (rsi[1] < res_y[1] and rsi[1] > sup_y[1] and rsi < sup_y)
    diag_short := true
else
    diag_short := false

//long diagonal break ending (grey dot)
if (rsi[1] > res_y[1] and rsi < res_y and rsi > sup_y)
    no_diagL := true
else
    no_diagL := false

//short diagonal break ending (grey dot)
if (rsi[1] < sup_y[1] and rsi < res_y and rsi > sup_y)
    no_diagS := true
else
    no_diagS := false

//long horizontal break triangle
if (ta.crossover(rsi, pvthis) and stateHB[1] == 2)
    HZB_L := true
else
    HZB_L := false

//short horizontal break triangle
if (ta.crossunder(rsi, pvtlos) and stateHB[1] == 1)
    HZB_S := true
else
    HZB_S := false

//long diag to short diag (cross)
if (rsi[1] < sup_y[1] and rsi > res_y)
    diag_long2 := true
else
    diag_long2 := false

//short diag to long diag (xcross)
if (rsi[1] > res_y[1] and rsi < sup_y)
    diag_short2 := true
else
    diag_short2 :=  false

plotshape(HZB_L, style=shape.triangleup, location=location.bottom, color=aqua)
plotshape(HZB_S, style=shape.triangledown, location=location.top, color=fuchsia)
plotshape(diag_long, style=shape.arrowup, location=location.bottom, color=color.new(color.blue, 25))
plotshape(diag_short, style=shape.arrowdown, location=location.top, color=color.new(color.red, 25))
plotshape(no_diagL, style=shape.circle, location=location.bottom, color=color.new(color.gray, 25))
plotshape(no_diagS, style=shape.circle, location=location.top, color=color.new(color.gray, 25))

plotshape(diag_long2, style=shape.cross, location=location.bottom, color=color.new(color.white, 25))
plotshape(diag_short2, style=shape.xcross, location=location.top, color=color.new(color.white, 25))

As you can see in the code I have tried to look back at the condition for the previous diag break and have the current bar match the condition for the new diag break, but it's not working like I expected.

//long diag to short diag (cross)
if (rsi[1] < sup_y[1] and rsi > res_y)
    diag_long2 := true
else
    diag_long2 := false

//short diag to long diag (xcross)
if (rsi[1] > res_y[1] and rsi < sup_y)
    diag_short2 := true
else
    diag_short2 :=  false

I've tried countless other versions which I haven't recorded and couldn't get anything to work properly.

I thought about trying to use the plots (code below) instead of plotshapes, but I'm not sure if it's possible? The shapes are visual backtesting, and allowing the use of alerts.

// Diagonal Breaks
long_break = rsi > res_y ? color.blue : na
short_break = rsi < sup_y ? color.red : na
no_break = rsi < res_y and rsi > sup_y ? gray : na

//-------------------- Plots -------------------- //
//Plot the diagonal colours on the RSI Line
r = plot(rsi, 'RSI', color=not showDiags ? yellow : na, linewidth=1)
rl = plot(showDiags ? rsi : na, color=long_break, title='RSI Long Diag', style=plot.style_line, linewidth=2)
rs = plot(showDiags ? rsi : na, color=short_break, title='RSI Short Diag', style=plot.style_line, linewidth=2)
rnb = plot(showDiags ? rsi : na, color=no_break, title='RSI No Diag', style=plot.style_line, linewidth=1)
</code>```

Body:
I've got most of the plotshapes working but I can't figure out the final two.

Basically the code is an RSI, but it highlights when the RSI has broken out of a diagonal channel, or out of breaks a horizontal level (using pivots). These are shown by teal and magenta triangles.

I've got correctly plotted shapes and alerts for the horizontal breaks, and also for:

no break to long diagonal (blue arrows)

no break to short diagonal (red arrows)

long diagonal break ending (grey dot)

short diagonal break ending (grey dot)

I can't get the logic correct for a long diagonal going directly to a short (without grey RSI in-between) and vice versa

Code is below, I have tried to remove as much unneeded code as possible, and have commented to help you understand what is what in the code.

I think you only need to look near the bottom where I commented:

//--------------------------- LOOK HERE AND DOWNWARDS ---------------------------//

Here is the full code:

//@version=5
indicator('test', overlay=false)

//-------------------- INPUTS -------------------- //
// Section Titles
grrsi='ðŸ“ˆ Relative Strength Index ðŸ“ˆ'
grhts='ðŸš¦ Range Shifts ðŸš¦'
// Colours
red=color.red
gray=color.gray
yellow=color.yellow
fuchsia = #da00ff
aqua = #00ffef

len = input.int(14, minval=1, title='RSI Length', group=grrsi)
showDiags = input(true, title='Show Diag Breaks', group=grrsi)

ShowPivots = input(false, title='Show Pivot Points', group=grrsi)
left = input.int(10, minval=1, title='Pivot Length Left Hand Side', group=grrsi)
right = input.int(10, minval=1, title='Pivot Length Right Hand Side', group=grrsi)

// RSI
rsi = ta.rsi(close, len)

//-------------------- PIVOTS -------------------- //
// Adapted from 'Pivot Points High Low (HH/HL/LH/LL)' - Mohamed3nan

// Determine pivots
pvtLenL = left
pvtLenR = right

// Get High and Low Pivot Points
pvthi = ta.pivothigh(rsi, pvtLenL, pvtLenR)
pvtlo = ta.pivotlow(rsi, pvtLenL, pvtLenR)

// Get HH, LH, LL, HL
valuewhen_1 = ta.valuewhen(pvthi, rsi[pvtLenR], 1)
valuewhen_2 = ta.valuewhen(pvthi, rsi[pvtLenR], 0)
higherhigh = na(pvthi) ? na : valuewhen_1 < valuewhen_2 ? pvthi : na
valuewhen_3 = ta.valuewhen(pvthi, rsi[pvtLenR], 1)
valuewhen_4 = ta.valuewhen(pvthi, rsi[pvtLenR], 0)
lowerhigh = na(pvthi) ? na : valuewhen_3 > valuewhen_4 ? pvthi : na
valuewhen_5 = ta.valuewhen(pvtlo, rsi[pvtLenR], 1)
valuewhen_6 = ta.valuewhen(pvtlo, rsi[pvtLenR], 0)
higherlow = na(pvtlo) ? na : valuewhen_5 < valuewhen_6 ? pvtlo : na
valuewhen_7 = ta.valuewhen(pvtlo, rsi[pvtLenR], 1)
valuewhen_8 = ta.valuewhen(pvtlo, rsi[pvtLenR], 0)
lowerlow = na(pvtlo) ? na : valuewhen_7 > valuewhen_8 ? pvtlo : na

plot(ShowPivots ? rsi[pvtLenR] : na, 'HH', style=plot.style_circles, linewidth=2, color=higherhigh ? aqua : na, offset=-pvtLenR)
plot(ShowPivots ? rsi[pvtLenR] : na, 'HL', style=plot.style_circles, linewidth=2, color=higherlow ? aqua : na, offset=-pvtLenR)
plot(ShowPivots ? rsi[pvtLenR] : na, 'LH', style=plot.style_circles, linewidth=2, color=lowerhigh ? fuchsia : na, offset=-pvtLenR)
plot(ShowPivots ? rsi[pvtLenR] : na, 'LL', style=plot.style_circles, linewidth=2, color=lowerlow ? fuchsia : na, offset=-pvtLenR)

//Count How many candles for current Pivot Level, If new reset.
counthi = 0
countlo = 0
counthi := na(pvthi) ? nz(counthi[1]) + 1 : 0
countlo := na(pvtlo) ? nz(countlo[1]) + 1 : 0

pvthis = 0.0
pvtlos = 0.0
pvthis := na(pvthi) ? pvthis[1] : rsi[pvtLenR]
pvtlos := na(pvtlo) ? pvtlos[1] : rsi[pvtLenR]

// Horizontal Pivot State
var stateHB = 0
if ta.crossover(rsi, pvthis)
    stateHB := 1
    stateHB
if ta.crossunder(rsi, pvtlos)
    stateHB := 2
    stateHB
stateHB := stateHB

statechangeL = ta.crossover(rsi, pvthis) and stateHB[1] == 2
statechangeS = ta.crossunder(rsi, pvtlos) and stateHB[1] == 1
stateHB_col = stateHB == 1 ? color.blue : stateHB == 2 ? color.red : na

//-------------------- DIAGONALS -------------------- //
// Adapted from 'Trendlines' - BacktestRookies

ph = pvthi
pl = pvtlo

phv1 = ta.valuewhen(ph, rsi[right], 0)
phb1 = ta.valuewhen(ph, bar_index[right], 0)
phv2 = ta.valuewhen(ph, rsi[right], 1)
phb2 = ta.valuewhen(ph, bar_index[right], 1)

plv1 = ta.valuewhen(pl, rsi[right], 0)
plb1 = ta.valuewhen(pl, bar_index[right], 0)
plv2 = ta.valuewhen(pl, rsi[right], 1)
plb2 = ta.valuewhen(pl, bar_index[right], 1)

// TRENDLINE CODE
// --------------
get_slope(x1, x2, y1, y2) =>
    m = (y2 - y1) / (x2 - x1)
    m

get_y_intercept(m, x1, y1) =>
    b = y1 - m * x1
    b

get_y(m, b, ts) =>
    Y = m * ts + b
    Y

int res_x1 = na
float res_y1 = na
int res_x2 = na
float res_y2 = na

int sup_x1 = na
float sup_y1 = na
int sup_x2 = na
float sup_y2 = na

// Resistance
res_x1 := ph ? phb1 : res_x1[1]
res_y1 := ph ? phv1 : res_y1[1]
res_x2 := ph ? phb2 : res_x2[1]
res_y2 := ph ? phv2 : res_y2[1]

res_m = get_slope(res_x1, res_x2, res_y1, res_y2)
res_b = get_y_intercept(res_m, res_x1, res_y1)
res_y = get_y(res_m, res_b, bar_index)

// Support
sup_x1 := pl ? plb1 : sup_x1[1]
sup_y1 := pl ? plv1 : sup_y1[1]
sup_x2 := pl ? plb2 : sup_x2[1]
sup_y2 := pl ? plv2 : sup_y2[1]

sup_m = get_slope(sup_x1, sup_x2, sup_y1, sup_y2)
sup_b = get_y_intercept(sup_m, sup_x1, sup_y1)
sup_y = get_y(sup_m, sup_b, bar_index)

//--------------------------- LOOK HERE AND DOWNWARDS ---------------------------//
//--------------------------- LOOK HERE AND DOWNWARDS ---------------------------//
//--------------------------- LOOK HERE AND DOWNWARDS ---------------------------//

// Diagonal Breaks
long_break = rsi > res_y ? color.blue : na
short_break = rsi < sup_y ? color.red : na
no_break = rsi < res_y and rsi > sup_y ? gray : na

//-------------------- Plots -------------------- //
//Plot the diagonal colours on the RSI Line
r = plot(rsi, 'RSI', color=not showDiags ? yellow : na, linewidth=1)
rl = plot(showDiags ? rsi : na, color=long_break, title='RSI Long Diag', style=plot.style_line, linewidth=2)
rs = plot(showDiags ? rsi : na, color=short_break, title='RSI Short Diag', style=plot.style_line, linewidth=2)
rnb = plot(showDiags ? rsi : na, color=no_break, title='RSI No Diag', style=plot.style_line, linewidth=1)

diag_long = false
diag_short = false
no_diagL = false
no_diagS = false
HZB_L = false
HZB_S = false
diag_long2 = false
diag_short2 = false

// Logic for plotshapes
//no break to long diagonal (blue arrows)
if (rsi[1] < res_y[1] and rsi[1] > sup_y[1] and rsi > res_y)
    diag_long := true
else
    diag_long :=  false

// no break to short diagonal (red arrows)
if (rsi[1] < res_y[1] and rsi[1] > sup_y[1] and rsi < sup_y)
    diag_short := true
else
    diag_short := false

//long diagonal break ending (grey dot)
if (rsi[1] > res_y[1] and rsi < res_y and rsi > sup_y)
    no_diagL := true
else
    no_diagL := false

//short diagonal break ending (grey dot)
if (rsi[1] < sup_y[1] and rsi < res_y and rsi > sup_y)
    no_diagS := true
else
    no_diagS := false

//long horizontal break triangle
if (ta.crossover(rsi, pvthis) and stateHB[1] == 2)
    HZB_L := true
else
    HZB_L := false

//short horizontal break triangle
if (ta.crossunder(rsi, pvtlos) and stateHB[1] == 1)
    HZB_S := true
else
    HZB_S := false

//long diag to short diag (cross)
if (rsi[1] < sup_y[1] and rsi > res_y)
    diag_long2 := true
else
    diag_long2 := false

//short diag to long diag (xcross)
if (rsi[1] > res_y[1] and rsi < sup_y)
    diag_short2 := true
else
    diag_short2 :=  false

plotshape(HZB_L, style=shape.triangleup, location=location.bottom, color=aqua)
plotshape(HZB_S, style=shape.triangledown, location=location.top, color=fuchsia)
plotshape(diag_long, style=shape.arrowup, location=location.bottom, color=color.new(color.blue, 25))
plotshape(diag_short, style=shape.arrowdown, location=location.top, color=color.new(color.red, 25))
plotshape(no_diagL, style=shape.circle, location=location.bottom, color=color.new(color.gray, 25))
plotshape(no_diagS, style=shape.circle, location=location.top, color=color.new(color.gray, 25))

plotshape(diag_long2, style=shape.cross, location=location.bottom, color=color.new(color.white, 25))
plotshape(diag_short2, style=shape.xcross, location=location.top, color=color.new(color.white, 25))

As you can see in the code I have tried to look back at the condition for the previous diag break and have the current bar match the condition for the new diag break, but it's not working like I expected.

//long diag to short diag (cross)
if (rsi[1] < sup_y[1] and rsi > res_y)
    diag_long2 := true
else
    diag_long2 := false

//short diag to long diag (xcross)
if (rsi[1] > res_y[1] and rsi < sup_y)
    diag_short2 := true
else
    diag_short2 :=  false

I've tried countless other versions which I haven't recorded and couldn't get anything to work properly.

I thought about trying to use the plots (code below) instead of plotshapes, but I'm not sure if it's possible? The shapes are visual backtesting, and allowing the use of alerts.

// Diagonal Breaks
long_break = rsi > res_y ? color.blue : na
short_break = rsi < sup_y ? color.red : na
no_break = rsi < res_y and rsi > sup_y ? gray : na

//-------------------- Plots -------------------- //
//Plot the diagonal colours on the RSI Line
r = plot(rsi, 'RSI', color=not showDiags ? yellow : na, linewidth=1)
rl = plot(showDiags ? rsi : na, color=long_break, title='RSI Long Diag', style=plot.style_line, linewidth=2)
rs = plot(showDiags ? rsi : na, color=short_break, title='RSI Short Diag', style=plot.style_line, linewidth=2)
rnb = plot(showDiags ? rsi : na, color=no_break, title='RSI No Diag', style=plot.style_line, linewidth=1)


问:
Networkx add capacity to each edge via numpy array
I have a networkx multigraph and i want to assign each edge that i add through add_edges_from() a different capacity. The capacities are in a numpy array.

I tried set_edge_attributes() but this just sets the whole array for each edge as attribute.

Is there a clever way of doing that or do i have to add each edge indiviually with G.add_edge() and assigning my attribute there with an iterator?


问:
Incompatible version of OpenSSL on Fedora Linux
Am struggling to use ssl with QWebSocket.  Get the following error messages:

```<code>QML debugging is enabled. Only use this in a safe environment.
qt.tlsbackend.ossl: Incompatible version of OpenSSL (built with OpenSSL 1.x, runtime version is >= 3.x)
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
WSInterface::onError(): Got the web-socket connection error:  QAbstractSocket::UnsupportedSocketOperationError
</code>```

Using Qt 6.4.2 installed from the Qt Installer as binaries (not built from source) on Fedora 37 on Intel with gcc 12.2

QSslSocket::supportsSsl() return false.

/usr/lib64 is holding:

```<code>-rwxr-xr-x. 1 root root 430944 Nov 18 08:51 libssl3.so
lrwxrwxrwx. 1 root root     15 Nov  2 00:41 libssl.so -> libssl.so.3.0.5
lrwxrwxrwx. 1 root root     15 Nov  2 00:41 libssl.so.3 -> libssl.so.3.0.5
-rwxr-xr-x. 1 root root 677480 Nov  2 00:41 libssl.so.3.0.5
</code>```

I can't see any ssl (or even references to libssl using ldd in the Qt directories)

If I add /usr/lib64 to the front of LD_LIBRARY_PATH the application sig faults on:

```<code>this->WebSocket = new QWebSocket();
</code>```

Since the Qt Maintenance Tool provides the source code for OpenSSL 1.1.1q, I downloaded that and built it using the following commands.  Build and install was smooth:

```<code>sudo dnf group install 'Development Tools' -y
sudo dnf install perl-core zlib-devel -y
cd ~/Qt/Tools/OpenSSL/src
./config --prefix=/usr/lib64 --openssldir=/usr/lib64 shared zlib
make -j8
make test
sudo make install
</code>```

make install added the following files to /usr/lib64

```<code>lrwxrwxrwx. 1 root root     29 Jul 22 02:33 libevent_openssl-2.1.so.7 -> libevent_openssl-2.1.so.7.0.1
-rwxr-xr-x. 1 root root  36840 Jul 22 02:33 libevent_openssl-2.1.so.7.0.1
lrwxrwxrwx. 1 root root     28 Oct 24 18:02 libxmlsec1-openssl.so -> libxmlsec1-openssl.so.1.2.34
lrwxrwxrwx. 1 root root     28 Oct 24 18:02 libxmlsec1-openssl.so.1 -> libxmlsec1-openssl.so.1.2.34
-rwxr-xr-x. 1 root root 304712 Oct 24 18:02 libxmlsec1-openssl.so.1.2.34
-rw-r--r--. 1 root root  10909 Jan 10 18:43 openssl.cnf
-rw-r--r--. 1 root root  10909 Jan 10 18:43 openssl.cnf.dist

ossl-modules:
total 1736
drwxr-xr-x.   2 root root      38 Jan  8 18:32 .
dr-xr-xr-x. 173 root root  118784 Jan 10 18:43 ..
-rwxr-xr-x.   1 root root 1488504 Nov  2 00:41 fips.so
-rwxr-xr-x.   1 root root  120392 Nov  2 00:41 legacy.so
</code>```

This did not seem to change the result - same error messages when running the application; same sig fault when adding /usr/lib64 in front of LD_LIBRARY_PATH

There seems to no mention on how to proceed in the help.  Qt Forum / Bugs and Stackoverflow seem to have lots of articles.  Besides the LD_LIBRARY_PATH and building from source the other suggestion seems to be install openssl 1.1.1 from the package manager.

```<code>sudo dnf install openssl-1.1.1q-1.fc35.x86_64.rpm
</code>```

Can't find the .rpm.  If I download it from:

```<code>https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/35/Everything/x86_64/os/Packages/o/openssl-1.1.1l-2.fc35.x86_64.rpm
</code>```

then Fedora refuses to install it.

Any guidance would be appreciated.

Body:
Am struggling to use ssl with QWebSocket.  Get the following error messages:

QML debugging is enabled. Only use this in a safe environment.
qt.tlsbackend.ossl: Incompatible version of OpenSSL (built with OpenSSL 1.x, runtime version is >= 3.x)
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
WSInterface::onError(): Got the web-socket connection error:  QAbstractSocket::UnsupportedSocketOperationError

Using Qt 6.4.2 installed from the Qt Installer as binaries (not built from source) on Fedora 37 on Intel with gcc 12.2

QSslSocket::supportsSsl() return false.

/usr/lib64 is holding:

-rwxr-xr-x. 1 root root 430944 Nov 18 08:51 libssl3.so
lrwxrwxrwx. 1 root root     15 Nov  2 00:41 libssl.so -> libssl.so.3.0.5
lrwxrwxrwx. 1 root root     15 Nov  2 00:41 libssl.so.3 -> libssl.so.3.0.5
-rwxr-xr-x. 1 root root 677480 Nov  2 00:41 libssl.so.3.0.5

I can't see any ssl (or even references to libssl using ldd in the Qt directories)

If I add /usr/lib64 to the front of LD_LIBRARY_PATH the application sig faults on:

this->WebSocket = new QWebSocket();

Since the Qt Maintenance Tool provides the source code for OpenSSL 1.1.1q, I downloaded that and built it using the following commands.  Build and install was smooth:

sudo dnf group install 'Development Tools' -y
sudo dnf install perl-core zlib-devel -y
cd ~/Qt/Tools/OpenSSL/src
./config --prefix=/usr/lib64 --openssldir=/usr/lib64 shared zlib
make -j8
make test
sudo make install

make install added the following files to /usr/lib64

lrwxrwxrwx. 1 root root     29 Jul 22 02:33 libevent_openssl-2.1.so.7 -> libevent_openssl-2.1.so.7.0.1
-rwxr-xr-x. 1 root root  36840 Jul 22 02:33 libevent_openssl-2.1.so.7.0.1
lrwxrwxrwx. 1 root root     28 Oct 24 18:02 libxmlsec1-openssl.so -> libxmlsec1-openssl.so.1.2.34
lrwxrwxrwx. 1 root root     28 Oct 24 18:02 libxmlsec1-openssl.so.1 -> libxmlsec1-openssl.so.1.2.34
-rwxr-xr-x. 1 root root 304712 Oct 24 18:02 libxmlsec1-openssl.so.1.2.34
-rw-r--r--. 1 root root  10909 Jan 10 18:43 openssl.cnf
-rw-r--r--. 1 root root  10909 Jan 10 18:43 openssl.cnf.dist

ossl-modules:
total 1736
drwxr-xr-x.   2 root root      38 Jan  8 18:32 .
dr-xr-xr-x. 173 root root  118784 Jan 10 18:43 ..
-rwxr-xr-x.   1 root root 1488504 Nov  2 00:41 fips.so
-rwxr-xr-x.   1 root root  120392 Nov  2 00:41 legacy.so

This did not seem to change the result - same error messages when running the application; same sig fault when adding /usr/lib64 in front of LD_LIBRARY_PATH

There seems to no mention on how to proceed in the help.  Qt Forum / Bugs and Stackoverflow seem to have lots of articles.  Besides the LD_LIBRARY_PATH and building from source the other suggestion seems to be install openssl 1.1.1 from the package manager.

sudo dnf install openssl-1.1.1q-1.fc35.x86_64.rpm

Can't find the .rpm.  If I download it from:

https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/35/Everything/x86_64/os/Packages/o/openssl-1.1.1l-2.fc35.x86_64.rpm

then Fedora refuses to install it.

Any guidance would be appreciated.