问:
Unity URP - Trying to draw a mesh using vertices computed in compute shader without reading back to cpu to assign to mesh object
I'm working on terrain generation using marching cubes. As of now I'm able to generate the terrain vertices in a compute shader but I can't figure out how to draw the mesh without reading the vertices back to the cpu and assigning them to a new mesh object. the marching cubes compute shader output is an AppendStructuredBuffer where the vertices are set up so every 3 consecutive vertices in the buffer makes one triangle.

output is an append buffer of triangles:

```<code>struct Triangle { float3 a, b, c; };
AppendStructuredBuffer<Triangle> triangles;
</code>```

I've looked at Graphics.DrawProcedural but it looks like I need to write a custom shader for that which would take in the compute buffers and draw from them but idk how to make that work since I only have access to shadergraph in urp.
Mesh.SetVertexBufferData seemed promising but it won't take a pointer to a compute buffer on the gpu, only C# arrays and lists which it then sends over.

Body:
I'm working on terrain generation using marching cubes. As of now I'm able to generate the terrain vertices in a compute shader but I can't figure out how to draw the mesh without reading the vertices back to the cpu and assigning them to a new mesh object. the marching cubes compute shader output is an AppendStructuredBuffer where the vertices are set up so every 3 consecutive vertices in the buffer makes one triangle.

output is an append buffer of triangles:

struct Triangle { float3 a, b, c; };
AppendStructuredBuffer<Triangle> triangles;

I've looked at Graphics.DrawProcedural but it looks like I need to write a custom shader for that which would take in the compute buffers and draw from them but idk how to make that work since I only have access to shadergraph in urp.
Mesh.SetVertexBufferData seemed promising but it won't take a pointer to a compute buffer on the gpu, only C# arrays and lists which it then sends over.


来源: stackexchange

问:
Can I edit package documentation on pub.dev after publishing?
I wrote a pub package, but since the README is in markdown and there is no markdown preview in Android Studio, the documentation I wrote turned out bad. I used
https://stackedit.io/app# to see how it looks, and there it looks fine, but after publishing it, the one on pub.dev doesn't look the same as the one from the website. Is there a way to edit a README without publishing a new package version?

ContentLicense: CC BY-SA 4.0


问:
Make bazel rerun only actions depneding on modified go std package
I am interested in relinking a bazel project after modifying (and compiling) go's standard library.

Building the project with no cache takes a long time, and I need to do this modification and build multiple times successively, meaning it needs to happen as quickly as possible.

My bazel project builds many packages but ends up with one final binary that is relevant for these purposes.

I tried to just modify the file in usr/local/go/src and delete only the final binary from bazel's output path. This didn't make bazel  rerun any actions (even though they depend on a .go file that was supposedly modified).

How could I then make the minimal amount of actions run again so that my modification applies to the final binary?

More specifically, how can I recompile a specific (standard library) package and then only relink the binary instead of also recompiling it and its dependencies.


问:
Creating a Plane of best fit from points
Is there a way to make a plane of best fit using matplotlib?
I'm trying to get a smooth curved plane or even just a flat one, but I'm unsure on how to do so.

My points are arranged as shown in the following image:

They are quite smooth, except for a few exceptions, which are mostly clear.

My current code is:

```<code>from mpl_toolkits import mplot3d
import matplotlib.pyplot as plt
from sklearn import linear_model
plt.style.use('seaborn-poster')

x = np.array([12.5, 10, 9.5, 7.5, 6])
y = np.array([30, 45, 50, 55, 60, 65])
z = np.array([
    [62.13, 55.41, 54.49, 46.46, 42.13],
    [67.11, 59.43, 56.39, 52.64, 41.89],
    [82.89, 61.13, 57.30, 50.75, 43.02],
    [73.31, 60.57, 57.17, 52.64, 41.73],
    [78.11, 62.92, 63.40, 58.08, 48.69],
    [83.96, 65.19, 60.22, 53.57, 44.22]
])

X, Y = np.meshgrid(x, y)
Z = z

x1, y1, z1 = X.flatten(), Y.flatten(), Z.flatten()

X_data = np.array([x1, y1]).reshape((-1, 2))
Y_data = z1

reg = linear_model.LinearRegression().fit(X_data, Y_data)
a1, a2, c = float(reg.coef_[0]), float(reg.coef_[1]), float(reg.intercept_)

fig = plt.figure(figsize = (9,9))
ax = plt.axes(projection='3d')
ax.grid()

ax.plot_surface(X, Y, z)

ax.scatter(X, Y, z, c = 'r', s = 50)
ax.set_title('Figure 1.21 - Plot of Final results')

ax.set_xlabel('Radius of Ball (mm)', labelpad=20)
ax.set_ylabel('Height from which ball was dropped (cm)', labelpad=20)
ax.set_zlabel('Diameter of ripple (mm)', labelpad=20)

plt.show()
</code>```

I have the a1, a2 and c values using linear regression but how do I plot them?
Is linear regression going to give the right sort of result for this graph?
I'm quite new to matplotlib, so sorry if this seems obvious.

Body:
Is there a way to make a plane of best fit using matplotlib?
I'm trying to get a smooth curved plane or even just a flat one, but I'm unsure on how to do so.

My points are arranged as shown in the following image:

They are quite smooth, except for a few exceptions, which are mostly clear.

My current code is:

from mpl_toolkits import mplot3d
import matplotlib.pyplot as plt
from sklearn import linear_model
plt.style.use('seaborn-poster')

x = np.array([12.5, 10, 9.5, 7.5, 6])
y = np.array([30, 45, 50, 55, 60, 65])
z = np.array([
    [62.13, 55.41, 54.49, 46.46, 42.13],
    [67.11, 59.43, 56.39, 52.64, 41.89],
    [82.89, 61.13, 57.30, 50.75, 43.02],
    [73.31, 60.57, 57.17, 52.64, 41.73],
    [78.11, 62.92, 63.40, 58.08, 48.69],
    [83.96, 65.19, 60.22, 53.57, 44.22]
])

X, Y = np.meshgrid(x, y)
Z = z

x1, y1, z1 = X.flatten(), Y.flatten(), Z.flatten()

X_data = np.array([x1, y1]).reshape((-1, 2))
Y_data = z1

reg = linear_model.LinearRegression().fit(X_data, Y_data)
a1, a2, c = float(reg.coef_[0]), float(reg.coef_[1]), float(reg.intercept_)

fig = plt.figure(figsize = (9,9))
ax = plt.axes(projection='3d')
ax.grid()

ax.plot_surface(X, Y, z)

ax.scatter(X, Y, z, c = 'r', s = 50)
ax.set_title('Figure 1.21 - Plot of Final results')

ax.set_xlabel('Radius of Ball (mm)', labelpad=20)
ax.set_ylabel('Height from which ball was dropped (cm)', labelpad=20)
ax.set_zlabel('Diameter of ripple (mm)', labelpad=20)

plt.show()

I have the a1, a2 and c values using linear regression but how do I plot them?
Is linear regression going to give the right sort of result for this graph?
I'm quite new to matplotlib, so sorry if this seems obvious.


问:
ExpressJS Connection_Reset after Post data input
I am doing a json to html work in expressjs but when i post data to search in my file my server restart itself and gives me ERR_CONNECTION_RESET how can i fix it? `

```<code> <div>
    <form action="/" method="post">
      <label for="Search">Please enter the name of the person you want to Search. (Attention capital letters)</label>
      <input type="text" name="Search" id="Search">
      <button  type="submit">Search</button>
    </form>
  </div>
</code>```

 this is my html search code  and this is my expressjs code

```<code>app.post("/", function(req,res){

let searching = String(req.body.Search);
let employees1= JSON.parse(fs.readFileSync('./employees.json','utf-8')) ;
let searching_in_employees = employees1.map((emp) => {
if(emp.preferredFullName==searching){
console.log(emp.jobTitleName);}
 })
searching_in_employees;

})
</code>```

`
im getting the console.log(jobtitlename) anyway but this annoying me

I tried to give button refresh page but did not work, still getting the error.

Body:
I am doing a json to html work in expressjs but when i post data to search in my file my server restart itself and gives me ERR_CONNECTION_RESET how can i fix it? `

    <form action="/" method="post">
      Please enter the name of the person you want to Search. (Attention capital letters)
      <input type="text" name="Search" id="Search">
      <button  type="submit">Search</button>
    </form>

 this is my html search code  and this is my expressjs code

app.post("/", function(req,res){

let searching = String(req.body.Search);
let employees1= JSON.parse(fs.readFileSync('./employees.json','utf-8')) ;
let searching_in_employees = employees1.map((emp) => {
if(emp.preferredFullName==searching){
console.log(emp.jobTitleName);}
 })
searching_in_employees;

})

`
im getting the console.log(jobtitlename) anyway but this annoying me

I tried to give button refresh page but did not work, still getting the error.


问:
How do Services slot in with the Repository Pattern in Android Development?
I am a relatively new android developer and am currently in the early stages of a new project. I am using Compose and have a solid idea of what my application will do.

Based on my research I have found out that the Repository Pattern is the recommended one. My understanding is the following Activity <-> ViewModel <-> Repo Interface <-> Repository <-> Data sources(Such as remote or local database).

My problem is where should a service start/bind and/or be used.  For example, I have a service that handles location using Google's API and want to use that data to control Google Maps. Should I in this case start the service inside the ViewModel? The repository?

I tried to read many stackoverflow posts, read the documentation and watch tutorials, but all of them only cover how to deal with databases such as Room.

My first stockoverflow post and I am ready to get destroyed, but hope for some assistance!


问:
SvelteKit - can I consume a +server.ts endpoint from a store?
In my svelte website, I want to consume an endpoint inside a store, to fetch a list of servers for me to display in html divs. I cannot seem to understand how to call the API for me to fetch the servers.

from the serverSection component
(https://github.com/maxijabase/electricservers.com.ar/blob/master/src/components/serverSection.svelte)

src/components/serverSection.svelte

```<code><script lang="ts">
  export let bgImage: string
  export let logo: string
  export let text: string

  import { fetchServers, serversStore } from '../stores/servers'
  import Server from './server.svelte'

  fetchServers()
</script>

<!-- some html -->
</code>```

I'm trying to fetch a list of servers from an endpoint I created in a +server.ts file
(https://github.com/maxijabase/electricservers.com.ar/blob/master/src/routes/api/%2Bserver.ts)

this is src/stores/servers.ts

```<code>import { writable, type Writable } from 'svelte/store'

export const serversStore: Writable<any> = writable()

export const fetchServers = async () => {
  const response = await fetch('/api', {
    method: 'GET',
    headers: {
      'content-type': 'application/json',
      accept: 'application/json',
    },
  })
  serversStore.set(response)
}
</code>```

this is src/routes/api/+server.ts

```<code>
import type { RequestHandler } from './$types'
import { Server } from '@fabricio-191/valve-server-query'
import { serverList } from 'src/servers/serversList'
import { json } from '@sveltejs/kit'

export const GET: RequestHandler = async () => {
  let infoList: Server.Info[] = []
  for await (const server of serverList) {
    const sv = await Server({ ip: server.ip, port: server.port, timeout: 3000 })
    const svInfo = await sv.getInfo()
    infoList.push(svInfo)
  }
  return json(infoList)
}
</code>```

but I'm getting

```<code>Cannot read properties of undefined (reading 'length')
TypeError: Cannot read properties of undefined (reading 'length')
    at Module.each (/node_modules/.pnpm/svelte@3.55.0/node_modules/svelte/internal/index.mjs:1841:31)
    at eval (/src/components/serverSection.svelte:28:63)
    at Object.$$render (/node_modules/.pnpm/svelte@3.55.0/node_modules/svelte/internal/index.mjs:1876:22)
    at eval (/src/routes/+page.svelte:20:120)
    at Object.$$render (/node_modules/.pnpm/svelte@3.55.0/node_modules/svelte/internal/index.mjs:1876:22)
    at Object.default (root.svelte:41:38)
    at eval (/src/routes/+layout.svelte:11:41)
    at Object.$$render (/node_modules/.pnpm/svelte@3.55.0/node_modules/svelte/internal/index.mjs:1876:22)
    at root.svelte:40:37
    at $$render (/node_modules/.pnpm/svelte@3.55.0/node_modules/svelte/internal/index.mjs:1876:22)
C:\Users\Maxi\Documents\Programming\electricservers.com.ar\node_modules\.pnpm\undici@5.14.0\node_modules\undici\index.js:105
      Error.captureStackTrace(err, this)
            ^

TypeError: Failed to parse URL from /api
    at fetch (C:\Users\Maxi\Documents\Programming\electricservers.com.ar\node_modules\.pnpm\undici@5.14.0\node_modules\undici\index.js:105:13)
    at async Module.fetchServers (/src/stores/servers.ts:8:20) {
  [cause]: TypeError [ERR_INVALID_URL]: Invalid URL
      at new NodeError (node:internal/errors:372:5)
      at URL.onParseError (node:internal/url:553:9)
      at new URL (node:internal/url:629:5)
      at new Request (C:\Users\Maxi\Documents\Programming\electricservers.com.ar\node_modules\.pnpm\undici@5.14.0\node_modules\undici\lib\fetch\request.js:78:21)
      at fetch (C:\Users\Maxi\Documents\Programming\electricservers.com.ar\node_modules\.pnpm\undici@5.14.0\node_modules\undici\lib\fetch\index.js:136:21)
      at fetch (C:\Users\Maxi\Documents\Programming\electricservers.com.ar\node_modules\.pnpm\undici@5.14.0\node_modules\undici\index.js:103:20)
      at Module.fetchServers (/src/stores/servers.ts:8:26)
      at eval (/src/components/serverSection.svelte:19:24)
      at Object.$$render (/node_modules/.pnpm/svelte@3.55.0/node_modules/svelte/internal/index.mjs:1878:22)
      at eval (/src/routes/+page.svelte:20:120) {
    input: '/api',
    code: 'ERR_INVALID_URL'
  }
}
 ELIFECYCLE  Command failed with exit code 1.
</code>```

I have no idea how to do this properly

Body:
In my svelte website, I want to consume an endpoint inside a store, to fetch a list of servers for me to display in html divs. I cannot seem to understand how to call the API for me to fetch the servers.

from the serverSection component
(https://github.com/maxijabase/electricservers.com.ar/blob/master/src/components/serverSection.svelte)

src/components/serverSection.svelte

I'm trying to fetch a list of servers from an endpoint I created in a +server.ts file
(https://github.com/maxijabase/electricservers.com.ar/blob/master/src/routes/api/%2Bserver.ts)

this is src/stores/servers.ts

import { writable, type Writable } from 'svelte/store'

export const serversStore: Writable<any> = writable()

export const fetchServers = async () => {
  const response = await fetch('/api', {
    method: 'GET',
    headers: {
      'content-type': 'application/json',
      accept: 'application/json',
    },
  })
  serversStore.set(response)
}

this is src/routes/api/+server.ts

import type { RequestHandler } from './$types'
import { Server } from '@fabricio-191/valve-server-query'
import { serverList } from 'src/servers/serversList'
import { json } from '@sveltejs/kit'

export const GET: RequestHandler = async () => {
  let infoList: Server.Info[] = []
  for await (const server of serverList) {
    const sv = await Server({ ip: server.ip, port: server.port, timeout: 3000 })
    const svInfo = await sv.getInfo()
    infoList.push(svInfo)
  }
  return json(infoList)
}

but I'm getting

Cannot read properties of undefined (reading 'length')
TypeError: Cannot read properties of undefined (reading 'length')
    at Module.each (/node_modules/.pnpm/svelte@3.55.0/node_modules/svelte/internal/index.mjs:1841:31)
    at eval (/src/components/serverSection.svelte:28:63)
    at Object.$$render (/node_modules/.pnpm/svelte@3.55.0/node_modules/svelte/internal/index.mjs:1876:22)
    at eval (/src/routes/+page.svelte:20:120)
    at Object.$$render (/node_modules/.pnpm/svelte@3.55.0/node_modules/svelte/internal/index.mjs:1876:22)
    at Object.default (root.svelte:41:38)
    at eval (/src/routes/+layout.svelte:11:41)
    at Object.$$render (/node_modules/.pnpm/svelte@3.55.0/node_modules/svelte/internal/index.mjs:1876:22)
    at root.svelte:40:37
    at $$render (/node_modules/.pnpm/svelte@3.55.0/node_modules/svelte/internal/index.mjs:1876:22)
C:\Users\Maxi\Documents\Programming\electricservers.com.ar\node_modules\.pnpm\undici@5.14.0\node_modules\undici\index.js:105
      Error.captureStackTrace(err, this)
            ^

TypeError: Failed to parse URL from /api
    at fetch (C:\Users\Maxi\Documents\Programming\electricservers.com.ar\node_modules\.pnpm\undici@5.14.0\node_modules\undici\index.js:105:13)
    at async Module.fetchServers (/src/stores/servers.ts:8:20) {
  [cause]: TypeError [ERR_INVALID_URL]: Invalid URL
      at new NodeError (node:internal/errors:372:5)
      at URL.onParseError (node:internal/url:553:9)
      at new URL (node:internal/url:629:5)
      at new Request (C:\Users\Maxi\Documents\Programming\electricservers.com.ar\node_modules\.pnpm\undici@5.14.0\node_modules\undici\lib\fetch\request.js:78:21)
      at fetch (C:\Users\Maxi\Documents\Programming\electricservers.com.ar\node_modules\.pnpm\undici@5.14.0\node_modules\undici\lib\fetch\index.js:136:21)
      at fetch (C:\Users\Maxi\Documents\Programming\electricservers.com.ar\node_modules\.pnpm\undici@5.14.0\node_modules\undici\index.js:103:20)
      at Module.fetchServers (/src/stores/servers.ts:8:26)
      at eval (/src/components/serverSection.svelte:19:24)
      at Object.$$render (/node_modules/.pnpm/svelte@3.55.0/node_modules/svelte/internal/index.mjs:1878:22)
      at eval (/src/routes/+page.svelte:20:120) {
    input: '/api',
    code: 'ERR_INVALID_URL'
  }
}
 ELIFECYCLE  Command failed with exit code 1.

I have no idea how to do this properly


问:
Retrieve a list of objects on a specific ID from linking table (JPA / MySQL) in springboot
i am trying to retrieve all objects on a specific 'pakketje_id' from a linking table in MySQL.

```<code>@Entity
public class Pakketje {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;
    private int code;
    private String status = "In magazijn";

    @ManyToMany
    @JoinTable(
            name = "paketjes_objecten",
            joinColumns = @JoinColumn(name = "pakketje_id"),
            inverseJoinColumns = @JoinColumn(name = "object_id")
    )
    private Set<Object> objecten = new HashSet<>();
</code>```

I have a linking table called "paketjes_objecten".

I have tried to do this in the JpaRepository:

```<code>@Repository
public interface PakketjeRepository extends JpaRepository<Pakketje, Integer> {
    public List<Object> findObjectenBypakketje_id(int pakketjeId);
}
</code>```

Unfortunately pakketje_id is not recognized.

The error:

```org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'objectController': Unsatisfied dependency expressed through field 'objectService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'objectServiceImplimentation': Unsatisfied dependency expressed through field 'pakketjeRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pakketjeRepository' defined in com.Code.Pakket.management.repository.PakketjeRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int); Reason: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.23.jar:5.3.23]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.23.jar:5.3.23]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.4.jar:2.7.4]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) ~[spring-boot-2.7.4.jar:2.7.4]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.4.jar:2.7.4]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-2.7.4.jar:2.7.4]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-2.7.4.jar:2.7.4]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[spring-boot-2.7.4.jar:2.7.4]
    at com.Code.Pakket.management.PakketManagementApplication.main(PakketManagementApplication.java:13) ~[classes/:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'objectServiceImplimentation': Unsatisfied dependency expressed through field 'pakketjeRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pakketjeRepository' defined in com.Code.Pakket.management.repository.PakketjeRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int); Reason: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656) ~[spring-beans-5.3.23.jar:5.3.23]
    ... 20 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pakketjeRepository' defined in com.Code.Pakket.management.repository.PakketjeRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int); Reason: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656) ~[spring-beans-5.3.23.jar:5.3.23]
    ... 34 common frames omitted
Caused by: org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int); Reason: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'
    at org.springframework.data.repository.query.QueryCreationException.create(QueryCreationException.java:101) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.lookupQuery(QueryExecutorMethodInterceptor.java:107) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.lambda$mapMethodsToQuery$1(QueryExecutorMethodInterceptor.java:95) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
    at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) ~[na:na]
    at java.base/java.util.Collections$UnmodifiableCollection$1.forEachRemaining(Collections.java:1061) ~[na:na]
    at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1921) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[na:na]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.mapMethodsToQuery(QueryExecutorMethodInterceptor.java:97) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.lambda$new$0(QueryExecutorMethodInterceptor.java:87) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at java.base/java.util.Optional.map(Optional.java:260) ~[na:na]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.<init>(QueryExecutorMethodInterceptor.java:87) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:365) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:323) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.util.Lazy.getNullable(Lazy.java:231) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.util.Lazy.get(Lazy.java:115) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:329) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:144) ~[spring-data-jpa-2.7.3.jar:2.7.3]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.23.jar:5.3.23]
    ... 44 common frames omitted
Caused by: java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'
    at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:96) ~[spring-data-jpa-2.7.3.jar:2.7.3]
    at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:119) ~[spring-data-jpa-2.7.3.jar:2.7.3]
    at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:259) ~[spring-data-jpa-2.7.3.jar:2.7.3]
    at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:93) ~[spring-data-jpa-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.lookupQuery(QueryExecutorMethodInterceptor.java:103) ~[spring-data-commons-2.7.3.jar:2.7.3]
    ... 66 common frames omitted
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property 'findpaketjes' found for type 'Pakketje'
    at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:91) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:438) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:414) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.mapping.PropertyPath.lambda$from$0(PropertyPath.java:367) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330) ~[na:na]
    at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:349) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:332) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.query.parser.Part.<init>(Part.java:81) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.query.parser.PartTree$OrPart.lambda$new$0(PartTree.java:250) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[na:na]
    at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1006) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[na:na]
    at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:251) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.query.parser.PartTree$Predicate.lambda$new$0(PartTree.java:384) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[na:na]
    at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1006) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[na:na]
    at org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:385) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:93) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:89) ~[spring-data-jpa-2.7.3.jar:2.7.3]
    ... 70 common frames omitted

Process finished with exit code 1

```

Any ideas how i retrieve object from a specific 'pakketje_id' ?

Body:
i am trying to retrieve all objects on a specific 'pakketje_id' from a linking table in MySQL.

@Entity
public class Pakketje {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;
    private int code;
    private String status = "In magazijn";

    @ManyToMany
    @JoinTable(
            name = "paketjes_objecten",
            joinColumns = @JoinColumn(name = "pakketje_id"),
            inverseJoinColumns = @JoinColumn(name = "object_id")
    )
    private Set<Object> objecten = new HashSet<>();

I have a linking table called "paketjes_objecten".

I have tried to do this in the JpaRepository:

@Repository
public interface PakketjeRepository extends JpaRepository<Pakketje, Integer> {
    public List<Object> findObjectenBypakketje_id(int pakketjeId);
}

Unfortunately pakketje_id is not recognized.

The error:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'objectController': Unsatisfied dependency expressed through field 'objectService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'objectServiceImplimentation': Unsatisfied dependency expressed through field 'pakketjeRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pakketjeRepository' defined in com.Code.Pakket.management.repository.PakketjeRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int); Reason: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.23.jar:5.3.23]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.23.jar:5.3.23]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.4.jar:2.7.4]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) ~[spring-boot-2.7.4.jar:2.7.4]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.4.jar:2.7.4]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-2.7.4.jar:2.7.4]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-2.7.4.jar:2.7.4]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[spring-boot-2.7.4.jar:2.7.4]
    at com.Code.Pakket.management.PakketManagementApplication.main(PakketManagementApplication.java:13) ~[classes/:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'objectServiceImplimentation': Unsatisfied dependency expressed through field 'pakketjeRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pakketjeRepository' defined in com.Code.Pakket.management.repository.PakketjeRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int); Reason: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656) ~[spring-beans-5.3.23.jar:5.3.23]
    ... 20 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pakketjeRepository' defined in com.Code.Pakket.management.repository.PakketjeRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int); Reason: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656) ~[spring-beans-5.3.23.jar:5.3.23]
    ... 34 common frames omitted
Caused by: org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int); Reason: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'
    at org.springframework.data.repository.query.QueryCreationException.create(QueryCreationException.java:101) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.lookupQuery(QueryExecutorMethodInterceptor.java:107) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.lambda$mapMethodsToQuery$1(QueryExecutorMethodInterceptor.java:95) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
    at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) ~[na:na]
    at java.base/java.util.Collections$UnmodifiableCollection$1.forEachRemaining(Collections.java:1061) ~[na:na]
    at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1921) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[na:na]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.mapMethodsToQuery(QueryExecutorMethodInterceptor.java:97) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.lambda$new$0(QueryExecutorMethodInterceptor.java:87) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at java.base/java.util.Optional.map(Optional.java:260) ~[na:na]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.<init>(QueryExecutorMethodInterceptor.java:87) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:365) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:323) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.util.Lazy.getNullable(Lazy.java:231) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.util.Lazy.get(Lazy.java:115) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:329) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:144) ~[spring-data-jpa-2.7.3.jar:2.7.3]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.23.jar:5.3.23]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.23.jar:5.3.23]
    ... 44 common frames omitted
Caused by: java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List com.Code.Pakket.management.repository.PakketjeRepository.findpaketjes_objectenBypakketje_id(int)! No property 'findpaketjes' found for type 'Pakketje'
    at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:96) ~[spring-data-jpa-2.7.3.jar:2.7.3]
    at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:119) ~[spring-data-jpa-2.7.3.jar:2.7.3]
    at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:259) ~[spring-data-jpa-2.7.3.jar:2.7.3]
    at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:93) ~[spring-data-jpa-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.lookupQuery(QueryExecutorMethodInterceptor.java:103) ~[spring-data-commons-2.7.3.jar:2.7.3]
    ... 66 common frames omitted
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property 'findpaketjes' found for type 'Pakketje'
    at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:91) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:438) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:414) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.mapping.PropertyPath.lambda$from$0(PropertyPath.java:367) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330) ~[na:na]
    at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:349) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:332) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.query.parser.Part.<init>(Part.java:81) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.query.parser.PartTree$OrPart.lambda$new$0(PartTree.java:250) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[na:na]
    at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1006) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[na:na]
    at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:251) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.query.parser.PartTree$Predicate.lambda$new$0(PartTree.java:384) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[na:na]
    at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1006) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[na:na]
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[na:na]
    at org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:385) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:93) ~[spring-data-commons-2.7.3.jar:2.7.3]
    at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:89) ~[spring-data-jpa-2.7.3.jar:2.7.3]
    ... 70 common frames omitted

Process finished with exit code 1

Any ideas how i retrieve object from a specific 'pakketje_id' ?


问:
get CPU and Memory usage on Linux with Flutter
I'm looking for some tips to retrieve cpu and memory usage in linux, using flutter framework. I tried system_resources and linux_system_info but no one seems working. I'm thinking to write in a file with a python script datas I need for but seems a bad solution, I hope exists something better.
Anyone can help me?
PS: Merry Christmas


问:
trying to create jira ticket with python
here below a piece of code I wrote that should create a jira ticket on my jira domain.
I created a personal token but for some reason it doesnt work...

```<code>from pprint import pprint
import requests
import json
from requests.auth import HTTPBasicAuth

TOKEN = "KAJSF21DKSAH1KJHFSAN912"

url = "https://cxscompany.jira.com/rest/api/2/"
headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer " + TOKEN
}
payload = json.dumps(
    {
    "fields": {
       "project":
       {
          "key": "AUT"
       },
       "summary": "summary mike",
       "description": "description mike",
       "issuetype": {
           "name": "Task"
       }
   }
}
)

response = requests.post(url, headers=headers, data=payload)

pprint(response)

</code>```

I expect a ticket to be created in my jira domain, but I get this error:

```<code>SSLError: HTTPSConnectionPool(host='cxscompany.jira.com', port=443): Max retries exceeded with url: /rest/api/latest/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1125)')))

</code>```

Body:
here below a piece of code I wrote that should create a jira ticket on my jira domain.
I created a personal token but for some reason it doesnt work...

from pprint import pprint
import requests
import json
from requests.auth import HTTPBasicAuth

TOKEN = "KAJSF21DKSAH1KJHFSAN912"

url = "https://cxscompany.jira.com/rest/api/2/"
headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer " + TOKEN
}
payload = json.dumps(
    {
    "fields": {
       "project":
       {
          "key": "AUT"
       },
       "summary": "summary mike",
       "description": "description mike",
       "issuetype": {
           "name": "Task"
       }
   }
}
)

response = requests.post(url, headers=headers, data=payload)

pprint(response)

I expect a ticket to be created in my jira domain, but I get this error:

SSLError: HTTPSConnectionPool(host='cxscompany.jira.com', port=443): Max retries exceeded with url: /rest/api/latest/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1125)')))


问:
How to fix perspective of an image using OpenCV
I have an input image which contains a letter inside a box, what I want to do is to fix the perspective of the image so I can easily use it with my letter recognition model.
This is the code that I use for pre-processing:

def preprocess(image):
    # Convert to grayscale
    image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

    # NOISE REMOVAL - START
    # Apply CLAHE (makes the image lightness more uniform)
    clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8))
    image = clahe.apply(image)

    cv2.imwrite("preprocess_stages/0_clahe.png", image)

    # Apply NlMeansDenoising (removes noise but loses some details)
    image = cv2.fastNlMeansDenoising(image, None, 10, 7, 21)

    cv2.imwrite("preprocess_stages/1_nl_means_denoising.png", image)

    # Apply GaussianBlur with a medium kernel (removes noise but loses some edges)
    image = cv2.GaussianBlur(image, (5, 5), 0)

    cv2.imwrite("preprocess_stages/2_gaussian_blur.png", image)
    # NOISE REMOVAL - END

    # Apply OTSU thresholding (we need the letter to be white)
    _, image = cv2.threshold(image, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)

    cv2.imwrite("preprocess_stages/3_otsu.png", image)

    # Morphological erosion (removes noise and small objects)
    kernel = np.ones((10, 10), np.uint8)
    image = cv2.erode(image, kernel, iterations=1)

    cv2.imwrite("preprocess_stages/4_morphological_erosion.png", image)

    return image
```
<p>I have seen many example on the internet and most of them require the 4 corner points to be provided as input too... there are few examples on how to calculate them and most of them don't work for my case, nonetheless I've tried writing something:</p>
<p>UPDATE: I successfully wrote a working code, even though I changed the Morphological Opening to a simple Erosion since it works better for me.</p>
<pre class="lang-py prettyprint-override"><code>def fix_perspective_convex_hull(preprocessed):
    # RETR_TREE retrieves all of the contours and reconstructs a full hierarchy of nested contours
    # used for maximum accuracy (my deduction)
    contours, _ = cv2.findContours(preprocessed, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)

    # Draw all contours to a new image
    image = cv2.cvtColor(preprocessed, cv2.COLOR_GRAY2BGR)
    cv2.drawContours(image, contours, -1, (0, 255, 0), 2)

    cv2.imwrite("perspective_stages/0_contours.png", image)

    for i, contour in enumerate(contours):
        hull = cv2.convexHull(contour)

        # Reduce to quadrilateral
        epsilon = 0.1 * cv2.arcLength(hull, True)
        approximated = cv2.approxPolyDP(hull, epsilon, True)

        # Draw approximated contour
        image = cv2.cvtColor(preprocessed, cv2.COLOR_GRAY2BGR)
        cv2.drawContours(image, [approximated], -1, (255, 0, 0), 1)

        cv2.imwrite("perspective_stages/1_approximated_contour_{}.png".format(i), image)

        if len(approximated) == 4:
            image = cv2.cvtColor(preprocessed, cv2.COLOR_GRAY2BGR)
            cv2.drawContours(image, [approximated], -1, (0, 0, 255), 2)

            cv2.imwrite("perspective_stages/2_final_contour.png", image)

            letter_hull = [a[0] for a in approximated] # Remove extra dimension [[x, y]] -> [x, y]
            break

    # Create placeholder for rectangle points
    rectangle = np.zeros((4, 2), dtype="float32")

    # Top-left point has smallest sum
    # Bottom-right point has largest sum
    # sum = x + y
    s = np.sum(letter_hull, axis=1)
    rectangle[0] = letter_hull[np.argmin(s)]
    rectangle[2] = letter_hull[np.argmax(s)]

    # Top-right point has smallest difference
    # Bottom-left point has largest difference
    # difference = x - y
    d = np.diff(letter_hull, axis=1)
    rectangle[1] = letter_hull[np.argmin(d)]
    rectangle[3] = letter_hull[np.argmax(d)]

    # Compute width and height of new image based on points
    (top_left, top_right, bottom_right, bottom_left) = rectangle

    # Width may be either top-right to top-left or bottom-right to bottom-left
    # TL;DR: Pythagorean theorem
    width_top = np.sqrt(((top_right[0] - top_left[0]) ** 2) + ((top_right[1] - top_left[1]) ** 2))
    width_bottom = np.sqrt(((bottom_right[0] - bottom_left[0]) ** 2) + ((bottom_right[1] - bottom_left[1]) ** 2))
    width = max(int(width_top), int(width_bottom))

    # Height may be either top-right to bottom-right or top-left to bottom-left
    # TL;DR: Pythagorean theorem
    height_right = np.sqrt(((top_right[0] - bottom_right[0]) ** 2) + ((top_right[1] - bottom_right[1]) ** 2))
    height_left = np.sqrt(((top_left[0] - bottom_left[0]) ** 2) + ((top_left[1] - bottom_left[1]) ** 2))
    height = max(int(height_right), int(height_left))

    # Create destination points
    destination = np.array([
        [0, 0],
        [width - 1, 0],
        [width - 1, height - 1],
        [0, height - 1]
    ], dtype="float32")

    # Compute perspective transform matrix
    matrix = cv2.getPerspectiveTransform(rectangle, destination)
    warped = cv2.warpPerspective(preprocessed, matrix, (width, height))

    # Add padding
    warped = cv2.copyMakeBorder(warped, 10, 10, 10, 10, cv2.BORDER_CONSTANT, value=(0, 0, 0))

    # Return warped image
    return warped
</code>```

Results:

Original

Preprocessed

Finding a quadrilateral

Warped

Inverted and resized for the neural network

UPDATE 2: My code only works for letters without curves, such as the H. When I try to run the code on curve letters (such as the S) I get the following results:

Body:
I have an input image which contains a letter inside a box, what I want to do is to fix the perspective of the image so I can easily use it with my letter recognition model.
This is the code that I use for pre-processing:

def preprocess(image):
    # Convert to grayscale
    image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

    # NOISE REMOVAL - START
    # Apply CLAHE (makes the image lightness more uniform)
    clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8))
    image = clahe.apply(image)

    cv2.imwrite("preprocess_stages/0_clahe.png", image)

    # Apply NlMeansDenoising (removes noise but loses some details)
    image = cv2.fastNlMeansDenoising(image, None, 10, 7, 21)

    cv2.imwrite("preprocess_stages/1_nl_means_denoising.png", image)

    # Apply GaussianBlur with a medium kernel (removes noise but loses some edges)
    image = cv2.GaussianBlur(image, (5, 5), 0)

    cv2.imwrite("preprocess_stages/2_gaussian_blur.png", image)
    # NOISE REMOVAL - END

    # Apply OTSU thresholding (we need the letter to be white)
    _, image = cv2.threshold(image, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)

    cv2.imwrite("preprocess_stages/3_otsu.png", image)

    # Morphological erosion (removes noise and small objects)
    kernel = np.ones((10, 10), np.uint8)
    image = cv2.erode(image, kernel, iterations=1)

    cv2.imwrite("preprocess_stages/4_morphological_erosion.png", image)

    return image

I have seen many example on the internet and most of them require the 4 corner points to be provided as input too... there are few examples on how to calculate them and most of them don't work for my case, nonetheless I've tried writing something:

UPDATE: I successfully wrote a working code, even though I changed the Morphological Opening to a simple Erosion since it works better for me.

def fix_perspective_convex_hull(preprocessed):
    # RETR_TREE retrieves all of the contours and reconstructs a full hierarchy of nested contours
    # used for maximum accuracy (my deduction)
    contours, _ = cv2.findContours(preprocessed, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)

    # Draw all contours to a new image
    image = cv2.cvtColor(preprocessed, cv2.COLOR_GRAY2BGR)
    cv2.drawContours(image, contours, -1, (0, 255, 0), 2)

    cv2.imwrite("perspective_stages/0_contours.png", image)

    for i, contour in enumerate(contours):
        hull = cv2.convexHull(contour)

        # Reduce to quadrilateral
        epsilon = 0.1 * cv2.arcLength(hull, True)
        approximated = cv2.approxPolyDP(hull, epsilon, True)

        # Draw approximated contour
        image = cv2.cvtColor(preprocessed, cv2.COLOR_GRAY2BGR)
        cv2.drawContours(image, [approximated], -1, (255, 0, 0), 1)

        cv2.imwrite("perspective_stages/1_approximated_contour_{}.png".format(i), image)

        if len(approximated) == 4:
            image = cv2.cvtColor(preprocessed, cv2.COLOR_GRAY2BGR)
            cv2.drawContours(image, [approximated], -1, (0, 0, 255), 2)

            cv2.imwrite("perspective_stages/2_final_contour.png", image)

            letter_hull = [a[0] for a in approximated] # Remove extra dimension [[x, y]] -> [x, y]
            break

    # Create placeholder for rectangle points
    rectangle = np.zeros((4, 2), dtype="float32")

    # Top-left point has smallest sum
    # Bottom-right point has largest sum
    # sum = x + y
    s = np.sum(letter_hull, axis=1)
    rectangle[0] = letter_hull[np.argmin(s)]
    rectangle[2] = letter_hull[np.argmax(s)]

    # Top-right point has smallest difference
    # Bottom-left point has largest difference
    # difference = x - y
    d = np.diff(letter_hull, axis=1)
    rectangle[1] = letter_hull[np.argmin(d)]
    rectangle[3] = letter_hull[np.argmax(d)]

    # Compute width and height of new image based on points
    (top_left, top_right, bottom_right, bottom_left) = rectangle

    # Width may be either top-right to top-left or bottom-right to bottom-left
    # TL;DR: Pythagorean theorem
    width_top = np.sqrt(((top_right[0] - top_left[0]) ** 2) + ((top_right[1] - top_left[1]) ** 2))
    width_bottom = np.sqrt(((bottom_right[0] - bottom_left[0]) ** 2) + ((bottom_right[1] - bottom_left[1]) ** 2))
    width = max(int(width_top), int(width_bottom))

    # Height may be either top-right to bottom-right or top-left to bottom-left
    # TL;DR: Pythagorean theorem
    height_right = np.sqrt(((top_right[0] - bottom_right[0]) ** 2) + ((top_right[1] - bottom_right[1]) ** 2))
    height_left = np.sqrt(((top_left[0] - bottom_left[0]) ** 2) + ((top_left[1] - bottom_left[1]) ** 2))
    height = max(int(height_right), int(height_left))

    # Create destination points
    destination = np.array([
        [0, 0],
        [width - 1, 0],
        [width - 1, height - 1],
        [0, height - 1]
    ], dtype="float32")

    # Compute perspective transform matrix
    matrix = cv2.getPerspectiveTransform(rectangle, destination)
    warped = cv2.warpPerspective(preprocessed, matrix, (width, height))

    # Add padding
    warped = cv2.copyMakeBorder(warped, 10, 10, 10, 10, cv2.BORDER_CONSTANT, value=(0, 0, 0))

    # Return warped image
    return warped

Results:

Original

Preprocessed

Finding a quadrilateral

Warped

Inverted and resized for the neural network

UPDATE 2: My code only works for letters without curves, such as the H. When I try to run the code on curve letters (such as the S) I get the following results:


问:
How do i generate 30 random numbers using standard deviation and mean
I need to generate 30 random numbers using standard deviation and mean.
I tried a few mathematical formulas and expressions but didn't get what I wanted.
Can you help me ?</p>
```<code>def create_yemek_list(x):

    mean= 120
    std = 1
    x = np.linspace(mean+ 3 * std, mean- 3 * std, 100)
    return x
</code>```

Body:
I need to generate 30 random numbers using standard deviation and mean.
I tried a few mathematical formulas and expressions but didn't get what I wanted.
Can you help me ?

def create_yemek_list(x):

    mean= 120
    std = 1
    x = np.linspace(mean+ 3 * std, mean- 3 * std, 100)
    return x


问:
Cannot persist via Hibernate ORM with Panache using rubenlagus/TelegramBots
I'm using Quarkus 2.15.1 and rubenlagus/TelegramBots 6.3.0

My pom.xml dependencies are:

```<code> <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-hibernate-validator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.telegram</groupId>
            <artifactId>telegrambots</artifactId>
            <version>6.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.24</version>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-hibernate-orm-panache</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-jdbc-postgresql</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</code>```

I've configured jdbc URL, username & password as well.

The problem is when I'm trying to persist an object (via Active Record or Repository pattern) there is an exception.

The code snippet is:

```<code>@ApplicationScoped
public class VoteBot extends TelegramLongPollingBot {
    @Override
    public void onUpdateReceived(Update update) {
        if (update.hasMessage() && update.getMessage().hasText()) {
            long chatId = update.getMessage().getChatId();
            String messageText = update.getMessage().getText();
            if (messageText.matches("^[A-Za-z\\s]+$")) {
                Participant participant = new Participant();
                participant.setChatId(chatId);
                participant.setName(messageText);

                // Some code
                Participant.persist(participant); // Here is the exceptional line goes
                // Some code
            }
        }
</code>```

Startup class looks like:

```<code>@ApplicationScoped
public class Application {
    void onStart(@Observes StartupEvent ev) {
        try {
            TelegramBotsApi telegramBotsApi = new TelegramBotsApi(DefaultBotSession.class);
            telegramBotsApi.registerBot(new VoteBot());
        } catch (TelegramApiException e) {
            e.printStackTrace();
        }
    }
}
</code>```

The exception message is:

```<code>2022-12-25 02:22:19,727 ERROR [org.tel.tel.upd.DefaultBotSession] (ckorovoda_vote_bot Telegram Executor) Cannot use the EntityManager/Session because neither a transaction nor a CDI request context is active. Consider adding @Transactional to your method to automatically activate a transaction, or @ActivateRequestContext if you have valid reasons not to use transactions.: javax.enterprise.context.ContextNotActiveException: Cannot use the EntityManager/Session because neither a transaction nor a CDI request context is active. Consider adding @Transactional to your method to automatically activate a transaction, or @ActivateRequestContext if you have valid reasons not to use transactions.
    at io.quarkus.hibernate.orm.runtime.session.TransactionScopedSession.acquireSession(TransactionScopedSession.java:106)
    at io.quarkus.hibernate.orm.runtime.session.TransactionScopedSession.contains(TransactionScopedSession.java:325)
    at org.hibernate.engine.spi.SessionLazyDelegator.contains(SessionLazyDelegator.java:710)
    at org.hibernate.Session_5b93bee577ae2f8d76647de04cfab36afbf52958_Synthetic_ClientProxy.contains(Unknown Source)
    at io.quarkus.hibernate.orm.panache.common.runtime.AbstractJpaOperations.persist(AbstractJpaOperations.java:100)
    at io.quarkus.hibernate.orm.panache.common.runtime.AbstractJpaOperations.persist(AbstractJpaOperations.java:96)
    at io.quarkus.hibernate.orm.panache.common.runtime.AbstractJpaOperations.persist(AbstractJpaOperations.java:112)
    at io.quarkus.hibernate.orm.panache.PanacheEntityBase.persist(PanacheEntityBase.java:756)
    at store.ckorovoda.Participant.persist(Participant.java)
    at store.ckorovoda.VoteBot.onUpdateReceived(VoteBot.java:74)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.telegram.telegrambots.meta.generics.LongPollingBot.onUpdatesReceived(LongPollingBot.java:27)
    at org.telegram.telegrambots.updatesreceivers.DefaultBotSession$HandlerThread.run(DefaultBotSession.java:317)
</code>```

I've tried adding @Transactional, @ActivateRequestContext and changing bean scopes. I've also tried to use EntityManager and quarkus-narayana-jta. However, I'm pretty sure it's all connected with this 3rd-party lib for Telegram.

I'm stuck with it and will appreciate any recommendation or hints for resolving that stuff.

Thank you!

Body:
I'm using Quarkus 2.15.1 and rubenlagus/TelegramBots 6.3.0

My pom.xml dependencies are:

 <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-hibernate-validator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.telegram</groupId>
            <artifactId>telegrambots</artifactId>
            <version>6.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.24</version>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-hibernate-orm-panache</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-jdbc-postgresql</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

I've configured jdbc URL, username & password as well.

The problem is when I'm trying to persist an object (via Active Record or Repository pattern) there is an exception.

The code snippet is:

@ApplicationScoped
public class VoteBot extends TelegramLongPollingBot {
    @Override
    public void onUpdateReceived(Update update) {
        if (update.hasMessage() && update.getMessage().hasText()) {
            long chatId = update.getMessage().getChatId();
            String messageText = update.getMessage().getText();
            if (messageText.matches("^[A-Za-z\\s]+$")) {
                Participant participant = new Participant();
                participant.setChatId(chatId);
                participant.setName(messageText);

                // Some code
                Participant.persist(participant); // Here is the exceptional line goes
                // Some code
            }
        }

Startup class looks like:

@ApplicationScoped
public class Application {
    void onStart(@Observes StartupEvent ev) {
        try {
            TelegramBotsApi telegramBotsApi = new TelegramBotsApi(DefaultBotSession.class);
            telegramBotsApi.registerBot(new VoteBot());
        } catch (TelegramApiException e) {
            e.printStackTrace();
        }
    }
}

The exception message is:

2022-12-25 02:22:19,727 ERROR [org.tel.tel.upd.DefaultBotSession] (ckorovoda_vote_bot Telegram Executor) Cannot use the EntityManager/Session because neither a transaction nor a CDI request context is active. Consider adding @Transactional to your method to automatically activate a transaction, or @ActivateRequestContext if you have valid reasons not to use transactions.: javax.enterprise.context.ContextNotActiveException: Cannot use the EntityManager/Session because neither a transaction nor a CDI request context is active. Consider adding @Transactional to your method to automatically activate a transaction, or @ActivateRequestContext if you have valid reasons not to use transactions.
    at io.quarkus.hibernate.orm.runtime.session.TransactionScopedSession.acquireSession(TransactionScopedSession.java:106)
    at io.quarkus.hibernate.orm.runtime.session.TransactionScopedSession.contains(TransactionScopedSession.java:325)
    at org.hibernate.engine.spi.SessionLazyDelegator.contains(SessionLazyDelegator.java:710)
    at org.hibernate.Session_5b93bee577ae2f8d76647de04cfab36afbf52958_Synthetic_ClientProxy.contains(Unknown Source)
    at io.quarkus.hibernate.orm.panache.common.runtime.AbstractJpaOperations.persist(AbstractJpaOperations.java:100)
    at io.quarkus.hibernate.orm.panache.common.runtime.AbstractJpaOperations.persist(AbstractJpaOperations.java:96)
    at io.quarkus.hibernate.orm.panache.common.runtime.AbstractJpaOperations.persist(AbstractJpaOperations.java:112)
    at io.quarkus.hibernate.orm.panache.PanacheEntityBase.persist(PanacheEntityBase.java:756)
    at store.ckorovoda.Participant.persist(Participant.java)
    at store.ckorovoda.VoteBot.onUpdateReceived(VoteBot.java:74)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.telegram.telegrambots.meta.generics.LongPollingBot.onUpdatesReceived(LongPollingBot.java:27)
    at org.telegram.telegrambots.updatesreceivers.DefaultBotSession$HandlerThread.run(DefaultBotSession.java:317)

I've tried adding @Transactional, @ActivateRequestContext and changing bean scopes. I've also tried to use EntityManager and quarkus-narayana-jta. However, I'm pretty sure it's all connected with this 3rd-party lib for Telegram.

I'm stuck with it and will appreciate any recommendation or hints for resolving that stuff.

Thank you!


问:
How can I use filtering by using Node.js and Mysql
I'm new at Node.js and trying to solve a routing problem. I need to paginate, search and filter some group of data from my database. Pagination part is done, filtering is done but routing part of it became a problem for me. I did not understand the logic of routing in Node.js. Here is my codes:

my controller :

```<code>exports.projects_filter = async(req,res)=>{

    try {

        let sql = "select * from proje_detaylari where proje_kategorisi='Üretim'";
        const allDB =  await projeler_db.query(sql) ;
        const kategori_üretim = allDB[0] ;

        res.render('proje_kütüphanesi',{

            kategoriler: kategori_üretim

        })

    } catch (error) {

    }

}
</code>```

my routing :

```<code>   router.get("/proje_kutuphanesi", projectController.project_paginator, function (req, res) {

    //all projects are displayed and paginated in the front-end

    });

router.get("/proje_kutuphanesi", projectController.projects_filter, function (req, res) {

//i want filtering in here

});
</code>```

My question is how can I implement filter routing something like

/proje_kutuphanesi/?category=something

I mostly understand the logic but routing at the above (pagination routing) is the one which prevents it.

Body:
I'm new at Node.js and trying to solve a routing problem. I need to paginate, search and filter some group of data from my database. Pagination part is done, filtering is done but routing part of it became a problem for me. I did not understand the logic of routing in Node.js. Here is my codes:

my controller :

exports.projects_filter = async(req,res)=>{

    try {

        let sql = "select * from proje_detaylari where proje_kategorisi='Üretim'";
        const allDB =  await projeler_db.query(sql) ;
        const kategori_üretim = allDB[0] ;

        res.render('proje_kütüphanesi',{

            kategoriler: kategori_üretim

        })

    } catch (error) {

    }

}

my routing :

   router.get("/proje_kutuphanesi", projectController.project_paginator, function (req, res) {

    //all projects are displayed and paginated in the front-end

    });

router.get("/proje_kutuphanesi", projectController.projects_filter, function (req, res) {

//i want filtering in here

});

My question is how can I implement filter routing something like

/proje_kutuphanesi/?category=something

I mostly understand the logic but routing at the above (pagination routing) is the one which prevents it.


问:
How to remove all Bundle Product information from orders; only Bundled Products information should be available in orders
I'm using Woocommerce Product Bundles plugin with 1 Bundled Product active with 2 bundled products inside.

Parent/child is setup to none, cart and checkout only Bundled Products are seen, that's perfect.

However, admin orders and export orders have information from the Bundle Product, which I don't want.

Admin order: https://www.screencast.com/t/IbDiu5ZoPh
Exported order to XLS: https://www.screencast.com/t/onkYbrAtY7

I tried some codes from other members, but all outdated.

Looking forward for help.
Thanks!


问:
Exclude "Status" from serialized output of Kubernetes objects
I would like to serialize a Subscription resource (from github.com/operator-framework/api/pkg/operators/v1alpha1) to YAML using code like this:

```<code>    subscription := operatorsv1alpha1.Subscription{
        TypeMeta: metav1.TypeMeta{
            APIVersion: operatorsv1alpha1.SubscriptionCRDAPIVersion,
            Kind:       operatorsv1alpha1.SubscriptionKind,
        },
        ObjectMeta: metav1.ObjectMeta{
            Namespace: namespaceName,
            Name:      pkg.Name,
        },
        Spec: &operatorsv1alpha1.SubscriptionSpec{
            Package:                pkg.Name,
            Channel:                channel.Name,
            InstallPlanApproval:    operatorsv1alpha1.Approval(subscribeFlags.Approval),
            CatalogSource:          pkg.Status.CatalogSource,
            CatalogSourceNamespace: pkg.Status.CatalogSourceNamespace,
        },
    }

    operatorsv1alpha1.AddToScheme(scheme.Scheme)
    corev1.AddToScheme(scheme.Scheme)

    serializer := json.NewSerializerWithOptions(
        json.DefaultMetaFactory, scheme.Scheme, scheme.Scheme,
        json.SerializerOptions{
            Pretty: true,
            Yaml:   true,
            Strict: true,
        })

    if err := serializer.Encode(&subscription, os.Stdout); err != nil {
        return err
    }
</code>```

This works, except that operator-framework/api defines a Subcription resource like this:

```<code>type Subscription struct {
    metav1.TypeMeta   `json:",inline"`
    metav1.ObjectMeta `json:"metadata"`

    Spec *SubscriptionSpec `json:"spec"`
    // +optional
    Status SubscriptionStatus `json:"status"`
}
</code>```

Which means that the serialized output always includes a status element with a null status.lastUpdated field:

```<code>apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  creationTimestamp: null
  name: argocd-operator
spec:
  channel: alpha
  installPlanApproval: Automatic
  name: argocd-operator
  source: operatorhubio-catalog
  sourceNamespace: olm
status:
  lastUpdated: null
</code>```

Submitting the serialized manifest fails with:

error: error validating "STDIN": error validating data: ValidationError(Subscription.status): missing required field "lastUpdated" in com.coreos.operators.v1alpha1.Subscription.status; if you choose to ignore these errors, turn validation off with --validate=false

Is there a canonical method for serializing these resources without including the status field?

Body:
I would like to serialize a Subscription resource (from github.com/operator-framework/api/pkg/operators/v1alpha1) to YAML using code like this:

    subscription := operatorsv1alpha1.Subscription{
        TypeMeta: metav1.TypeMeta{
            APIVersion: operatorsv1alpha1.SubscriptionCRDAPIVersion,
            Kind:       operatorsv1alpha1.SubscriptionKind,
        },
        ObjectMeta: metav1.ObjectMeta{
            Namespace: namespaceName,
            Name:      pkg.Name,
        },
        Spec: &operatorsv1alpha1.SubscriptionSpec{
            Package:                pkg.Name,
            Channel:                channel.Name,
            InstallPlanApproval:    operatorsv1alpha1.Approval(subscribeFlags.Approval),
            CatalogSource:          pkg.Status.CatalogSource,
            CatalogSourceNamespace: pkg.Status.CatalogSourceNamespace,
        },
    }

    operatorsv1alpha1.AddToScheme(scheme.Scheme)
    corev1.AddToScheme(scheme.Scheme)

    serializer := json.NewSerializerWithOptions(
        json.DefaultMetaFactory, scheme.Scheme, scheme.Scheme,
        json.SerializerOptions{
            Pretty: true,
            Yaml:   true,
            Strict: true,
        })

    if err := serializer.Encode(&subscription, os.Stdout); err != nil {
        return err
    }

This works, except that operator-framework/api defines a Subcription resource like this:

type Subscription struct {
    metav1.TypeMeta   `json:",inline"`
    metav1.ObjectMeta `json:"metadata"`

    Spec *SubscriptionSpec `json:"spec"`
    // +optional
    Status SubscriptionStatus `json:"status"`
}

Which means that the serialized output always includes a status element with a null status.lastUpdated field:

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  creationTimestamp: null
  name: argocd-operator
spec:
  channel: alpha
  installPlanApproval: Automatic
  name: argocd-operator
  source: operatorhubio-catalog
  sourceNamespace: olm
status:
  lastUpdated: null

Submitting the serialized manifest fails with:

error: error validating "STDIN": error validating data: ValidationError(Subscription.status): missing required field "lastUpdated" in com.coreos.operators.v1alpha1.Subscription.status; if you choose to ignore these errors, turn validation off with --validate=false

Is there a canonical method for serializing these resources without including the status field?


问:
3D Lidar Data Augmentation
Is there anyway to augment 3D lidar data. I want to run the code on colab. I tried some git repo but that did not work on colab. Code should be in python. Thank you.

I did try this repo https://github.com/xaviersantos/OpenPCDet and this code: https://github.com/xaviersantos/OpenPCDet/blob/dev/data_augmentation.ipynb but mayavi crashes on colab.

Title: 3D Lidar Data Augmentation


问:
Set Headers For Response From Webhook.Site
I'm setting up a Custom Action on webhook.site and I have a very simple script -

```<code>if (!string_contains(var('$subscriptions$'),"active")) {
    respond('{"message":"Please subscribe at website.com to use this service", "url":"website.com"}', 400);
    stop()
}
</code>```

I need to set the headers for the response, which their docs say should be structured like respond(string content, int status, array headers). Further down the page, they mention

headers should be an array of strings e.g. ["X-Example: Value", "X-Foo: Bar"]

but I'm not sure whether that applies to the respond() function that I'm using. When I try to set the header like this -

```<code>respond('{"message":"Please subscribe at website.com to use this service", "url":"website.com"}', 400, '["Content-Type: application/json")';
</code>```

I get an error -

Wrong type of argument passed to function @ line 2, position 12

and none of the other formats that I've tried have worked either. I'd appreciate any pointers!

Context - I'm using a WebhookScript action here because I need to include the logic in the if() statement. I don't want to use their Modify Response action.

Body:
I'm setting up a Custom Action on webhook.site and I have a very simple script -

if (!string_contains(var('$subscriptions$'),"active")) {
    respond('{"message":"Please subscribe at website.com to use this service", "url":"website.com"}', 400);
    stop()
}

I need to set the headers for the response, which their docs say should be structured like respond(string content, int status, array headers). Further down the page, they mention

headers should be an array of strings e.g. ["X-Example: Value", "X-Foo: Bar"]

but I'm not sure whether that applies to the respond() function that I'm using. When I try to set the header like this -

respond('{"message":"Please subscribe at website.com to use this service", "url":"website.com"}', 400, '["Content-Type: application/json")';

I get an error -

Wrong type of argument passed to function @ line 2, position 12

and none of the other formats that I've tried have worked either. I'd appreciate any pointers!

Context - I'm using a WebhookScript action here because I need to include the logic in the if() statement. I don't want to use their Modify Response action.


问:
Unity RTS - Backend technologies
Building a Mobile game in Unity. I cannot decide which middleware/backend (Unity services, PlayFab etc..)
It will be Real time. I expect 1000+ players on the same map. Map will have 1,000,000 objects with state (in mobile view, players will only see 3000 at a time and other load if they move).
I need real time, reliable and fast..
Please advise based on your experience</p>

Title: Unity RTS - Backend technologies