问:
How to upload image to graphql server in android studio?
I am new to graphql and I am trying to upload an image to the graphql server and I don't know how to start. I am using the images from the gallery. The document says to convert the file into an Upload scalar as such

If you're on Android/JVM, you can turn a File into an upload

 val upload = File.toUpload("application/json")

On multiplatform, you can use DefaultUpload

```<code>val upload = DefaultUpload.Builder()
              .fileName("filename.txt")
              .content { sink ->
                okioSource.use { sink.writeAll(it) }
              }
              .build()
</code>```

I tried creating the file from the uri as such

```<code>val file = uri.toFile()
</code>```

and creating the upload variable as

```<code>val upload = file.toUpload("application/json")
</code>```

But it is giving me
"open failed: ENOENT (No such file or directory)" error
I couldn't find related documents or examples.

Body:
I am new to graphql and I am trying to upload an image to the graphql server and I don't know how to start. I am using the images from the gallery. The document says to convert the file into an Upload scalar as such

If you're on Android/JVM, you can turn a File into an upload

 val upload = File.toUpload("application/json")

On multiplatform, you can use DefaultUpload

val upload = DefaultUpload.Builder()
              .fileName("filename.txt")
              .content { sink ->
                okioSource.use { sink.writeAll(it) }
              }
              .build()

I tried creating the file from the uri as such

val file = uri.toFile()

and creating the upload variable as

val upload = file.toUpload("application/json")

But it is giving me
"open failed: ENOENT (No such file or directory)" error
I couldn't find related documents or examples.


来源: stackexchange

问:
Ambiguous Page Load behavior while selecting filter after scrolling to the middle of the page
I am working on an issue related to ambiguous page load behavior where I apply filter to a table component in the middle of the page after scrolling down a bit, and in a special case where close to 1-3 rows are selected as part of the filter, instead of loading the same component, my entire page gets scrolled to the top.

Has anyone else faced this? Is this an expected behavior?

PS = we are using the less framework and some custom UI packages as well for the styling of our page.

ContentLicense: CC BY-SA 4.0


问:
How can I configure endpoints for RBAC in Spring Boot via Cloud Config Server?
I want to add the ability to microservices to allow configuring endpoints and permissions for RBAC via Cloud Config Server. So if there is a service called mordor, then if I add following properties in its application.yml at Cloud Config Server's repo

rbac:
  - endpoint: /v1/test1
    method: GET
    scopes: ["rest-write:all", "read-write:product"]
  - endpoint: /v1/test2
    method: POST
    scopes: ["read-write:product"]
```

the endpoints mentioned above should be configured for RBAC. As of now, I am passing the scopes and permissions via Auth0 JWT and using it for authentication. But with this, I will be able to add RBAC also based on the permissions I configure in Auth0's dashboard.

What is the best way to proceed with this?

I am able to get the rbac endpoints from Cloud Config Server but the problem is how to add them to Spring Security. I already have a class OAuth2SecurityConfiguerer where httpSecurity is configured but I haven't been able to add endpoints to Spring Security because it might require iterating over the endpoints obtained from Cloud Config Server

Body:
I want to add the ability to microservices to allow configuring endpoints and permissions for RBAC via Cloud Config Server. So if there is a service called mordor, then if I add following properties in its application.yml at Cloud Config Server's repo

rbac:
  - endpoint: /v1/test1
    method: GET
    scopes: ["rest-write:all", "read-write:product"]
  - endpoint: /v1/test2
    method: POST
    scopes: ["read-write:product"]

the endpoints mentioned above should be configured for RBAC. As of now, I am passing the scopes and permissions via Auth0 JWT and using it for authentication. But with this, I will be able to add RBAC also based on the permissions I configure in Auth0's dashboard.

What is the best way to proceed with this?

I am able to get the rbac endpoints from Cloud Config Server but the problem is how to add them to Spring Security. I already have a class OAuth2SecurityConfiguerer where httpSecurity is configured but I haven't been able to add endpoints to Spring Security because it might require iterating over the endpoints obtained from Cloud Config Server


问:
Deserializer result to null symfony
I discover the serializer and deserializer.

I have an index.json file and I'm trying to deserializer.

The json_decode works (I have many tables as a result) however with the deserializer I have everything at null and I don't understand why. (I begin)

index.json:

```<code>[
  {
    "label": "VILLA GALLO-ROMAINE DU GROSSWALD",
    "lastUpdateDatatourisme": "2022-09-24T04:00:46.397Z",
    "file": "0/00/10-000283ba-f94b-3bce-8f57-e5c10bec6cd4.json"
  },
  {
    "label": "ÉGLISE PAROISSIALE DE LA NATIVITÉ",
    "lastUpdateDatatourisme": "2022-08-07T04:02:23.588Z",
    "file": "0/00/10-0016e4ef-68b7-3e79-87c4-5a277e1a43ac.json"
  },
  {
    "label": "CHEZ LES P'TITS PAYSANS",
    "lastUpdateDatatourisme": "2022-11-20T06:05:43.206Z",
    "file": "0/00/10-001dc202-cf27-355f-8577-6ef3105bddec.json"
  },(...)
</code>```

my class:

```<code><?php

namespace App\Entity;

use App\Repository\IndexDataTourismeRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity(repositoryClass: IndexDataTourismeRepository::class)]
class IndexDataTourisme
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    #[ORM\Column(type: Types::TEXT)]
    private ?string $label = null;

    #[ORM\Column(length: 255)]
    private ?string $lastUpdateDatatourisme = null;

    #[ORM\Column(length: 255)]
    private ?string $file = null;
</code>```

my controller:

```<code>class HomeController extends AbstractController
{
    #[Route('/home', name: 'app_home')]
    public function index(): Response
    {
        $encoders = [new XmlEncoder(), new JsonEncoder()];
        $normalizers = [new ObjectNormalizer()];

        $serializer = new Serializer($normalizers, $encoders);
 $person = $serializer->deserialize($data, IndexDataTourisme::class, 'json', [AbstractObjectNormalizer::SKIP_UNINITIALIZED_VALUES => false]);
        dd($person);
        return $this->render('home/index.html.twig', [
            'controller_name' => 'HomeController',
        ]);
    }
</code>```

in my opinion it is a visible error for you, but I pass by without understanding...
and also, if ever a new field is added to my index.json, I want my application to continue to work with the dezerializer.

I use symfony 6.2

thank you

Title: Deserializer result to null symfony

Body:
I discover the serializer and deserializer.

I have an index.json file and I'm trying to deserializer.

The json_decode works (I have many tables as a result) however with the deserializer I have everything at null and I don't understand why. (I begin)

index.json:

[
  {
    "label": "VILLA GALLO-ROMAINE DU GROSSWALD",
    "lastUpdateDatatourisme": "2022-09-24T04:00:46.397Z",
    "file": "0/00/10-000283ba-f94b-3bce-8f57-e5c10bec6cd4.json"
  },
  {
    "label": "ÉGLISE PAROISSIALE DE LA NATIVITÉ",
    "lastUpdateDatatourisme": "2022-08-07T04:02:23.588Z",
    "file": "0/00/10-0016e4ef-68b7-3e79-87c4-5a277e1a43ac.json"
  },
  {
    "label": "CHEZ LES P'TITS PAYSANS",
    "lastUpdateDatatourisme": "2022-11-20T06:05:43.206Z",
    "file": "0/00/10-001dc202-cf27-355f-8577-6ef3105bddec.json"
  },(...)

my class:

<?php

namespace App\Entity;

use App\Repository\IndexDataTourismeRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity(repositoryClass: IndexDataTourismeRepository::class)]
class IndexDataTourisme
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    #[ORM\Column(type: Types::TEXT)]
    private ?string $label = null;

    #[ORM\Column(length: 255)]
    private ?string $lastUpdateDatatourisme = null;

    #[ORM\Column(length: 255)]
    private ?string $file = null;

my controller:

class HomeController extends AbstractController
{
    #[Route('/home', name: 'app_home')]
    public function index(): Response
    {
        $encoders = [new XmlEncoder(), new JsonEncoder()];
        $normalizers = [new ObjectNormalizer()];

        $serializer = new Serializer($normalizers, $encoders);
 $person = $serializer->deserialize($data, IndexDataTourisme::class, 'json', [AbstractObjectNormalizer::SKIP_UNINITIALIZED_VALUES => false]);
        dd($person);
        return $this->render('home/index.html.twig', [
            'controller_name' => 'HomeController',
        ]);
    }

in my opinion it is a visible error for you, but I pass by without understanding...
and also, if ever a new field is added to my index.json, I want my application to continue to work with the dezerializer.

I use symfony 6.2

thank you


问:
Is there a SEP token in google translate API?
Is there a SEP token in google translate API?
Or any other predefined tokens in the API?

I hope to know for advanced fine-tuning of google translation model.


问:
Non Linear MPC optimization of a 2 dimensional drone

I am trying to simulate a drone on a 2-dimensional lunar surface. The drone can apply thrust the z-axis of the body, and the drone can change the angle of its body from -90 degrees to +90 degrees.
The first planned acceleration in the y direction that the MPC function gives is a negative value that exceeds the the lunar accel_g, which I set to be 1.635 m/s^2; thus, the drone cancels out the initial velocity really quickly. This should not happen since I set the constraints of body angle in such that the thrust will never be able to reduce the vertical velocity: vertical velocity of the drone should be reduced only by the lunar gravity. I can not find what is wrong with the code.
** is there a way I can apply rotation to the marker of the plot? I want to change the cross marker so that it can represent the changes in attitude. **

```<code>function run_mpc(initial_position, initial_velocity, initial_angle)

model = Model(Ipopt.Optimizer)

Δt = 0.1
num_time_steps = 20 # Change this -> Affects Optimization
max_acceleration_Thr = 3 # Max Thrust / Mass
max_pitch_angle = 90
accel_g = 1.635 # 1/6 of Earth G
des_pos = [-1,0]

@variables model begin
    position[1:2, 1:num_time_steps]
    velocity[1:2, 1:num_time_steps]
    acceleration[1:2, 1:num_time_steps]
    -max_pitch_angle <= angle[1:num_time_steps] <= max_pitch_angle
    0 <= accel_Thr[1:num_time_steps] <= max_acceleration_Thr
end

# Dynamics constraints
@NLconstraint(model, [i=2:num_time_steps, j=[1]], acceleration[j, i] == accel_Thr[i-1]*sind(angle[i-1]))

@NLconstraint(model, [i=2:num_time_steps, j=[2]], acceleration[j, i] == (accel_Thr[i-1]*cosd(angle[i-1]))-accel_g)

@NLconstraint(model, [i=2:num_time_steps, j=1:2],
            velocity[j, i] == velocity[j, i - 1] + (acceleration[j, i - 1]) * Δt)
@NLconstraint(model, [i=2:num_time_steps, j=1:2],
            position[j, i] == position[j, i - 1] + velocity[j, i - 1] * Δt)

# Cost function: minimize final position and final velocity
# For Moving to [-2,0] with min. vertical velocity,
# sum(([-2,0]-position[:, end]).^2)+ sum(velocity[[2], end].^2)
@NLobjective(model, Min,
    100 * sum((des_pos[i]-position[i, num_time_steps])^2 for i in 1:2)+ sum(velocity[i, num_time_steps]^2 for i in 1:2))

# Initial conditions:
@NLconstraint(model, [i=1:2], position[i, 1] == initial_position[i])
@NLconstraint(model, [i=1:2], velocity[i, 1] == initial_velocity[i])
@NLconstraint(model, angle[1] == initial_angle)

optimize!(model)
return value.(position), value.(velocity), value.(acceleration), value.(angle[2:end])
</code>```

end;

```<code>begin
# The robot's starting position and velocity
q = [1.0, 0.0]
v = [-2.0, 2.0]
ang = 45
Δt = 0.1

# Recording Position, Acceleration, Attitude, Planned Positions
qs_x = []
qs_y = []
as_x = []
as_y = []
angs = []
q_plans = []
u_plans = []

anim = @animate for i in 1:90 # This determies the number of MPC to be run
    # Plot the current position & Attitude
    plot(label = "Drone",[q[1]], [q[2]], marker=(:rect, 10), xlim=(-2, 2), ylim=(-2, 2))
    plot!(label = "Body Axis",[q[1]], [q[2]], marker=(:cross, 18, :grey))
    push!(qs_x,q[1])
    push!(qs_y,q[2])

    # Run the MPC control optimization
    q_plan, v_plan, u_plan, ang_plan = run_mpc(q, v, ang)

    # Draw the planned future states from the MPC optimization
    plot!(label = "Opt. Path", q_plan[1, :], q_plan[2, :], linewidth=5, arrow=true, c=:orange)
    # Draw the planned acceleration
    plot!(label = "Opt. Accel",u_plan[1, 1:2], u_plan[2, 1:2], linewidth=3, arrow=true, c=:red)

    # Save Acceleration & Angle Data to csv
    u = u_plan[:, 1]
    push!(as_x, u[1])
    push!(as_y, u[2])
    push!(angs, ang)
    push!(u_plans, u_plan)

    # Apply the planned acceleration&Attitude and simulate one step in time
    global ang = ang_plan[1]
    global v += u * Δt
    global q += v * Δt
end
gif(anim, "~/Downloads/NLmpc_angle.gif", fps=60)
</code>```

end

Body:
I am trying to simulate a drone on a 2-dimensional lunar surface. The drone can apply thrust the z-axis of the body, and the drone can change the angle of its body from -90 degrees to +90 degrees.
The first planned acceleration in the y direction that the MPC function gives is a negative value that exceeds the the lunar accel_g, which I set to be 1.635 m/s^2; thus, the drone cancels out the initial velocity really quickly. This should not happen since I set the constraints of body angle in such that the thrust will never be able to reduce the vertical velocity: vertical velocity of the drone should be reduced only by the lunar gravity. I can not find what is wrong with the code.
** is there a way I can apply rotation to the marker of the plot? I want to change the cross marker so that it can represent the changes in attitude. **

function run_mpc(initial_position, initial_velocity, initial_angle)

model = Model(Ipopt.Optimizer)

Δt = 0.1
num_time_steps = 20 # Change this -> Affects Optimization
max_acceleration_Thr = 3 # Max Thrust / Mass
max_pitch_angle = 90
accel_g = 1.635 # 1/6 of Earth G
des_pos = [-1,0]

@variables model begin
    position[1:2, 1:num_time_steps]
    velocity[1:2, 1:num_time_steps]
    acceleration[1:2, 1:num_time_steps]
    -max_pitch_angle <= angle[1:num_time_steps] <= max_pitch_angle
    0 <= accel_Thr[1:num_time_steps] <= max_acceleration_Thr
end

# Dynamics constraints
@NLconstraint(model, [i=2:num_time_steps, j=[1]], acceleration[j, i] == accel_Thr[i-1]*sind(angle[i-1]))

@NLconstraint(model, [i=2:num_time_steps, j=[2]], acceleration[j, i] == (accel_Thr[i-1]*cosd(angle[i-1]))-accel_g)

@NLconstraint(model, [i=2:num_time_steps, j=1:2],
            velocity[j, i] == velocity[j, i - 1] + (acceleration[j, i - 1]) * Δt)
@NLconstraint(model, [i=2:num_time_steps, j=1:2],
            position[j, i] == position[j, i - 1] + velocity[j, i - 1] * Δt)

# Cost function: minimize final position and final velocity
# For Moving to [-2,0] with min. vertical velocity,
# sum(([-2,0]-position[:, end]).^2)+ sum(velocity[[2], end].^2)
@NLobjective(model, Min,
    100 * sum((des_pos[i]-position[i, num_time_steps])^2 for i in 1:2)+ sum(velocity[i, num_time_steps]^2 for i in 1:2))

# Initial conditions:
@NLconstraint(model, [i=1:2], position[i, 1] == initial_position[i])
@NLconstraint(model, [i=1:2], velocity[i, 1] == initial_velocity[i])
@NLconstraint(model, angle[1] == initial_angle)

optimize!(model)
return value.(position), value.(velocity), value.(acceleration), value.(angle[2:end])

end;

begin
# The robot's starting position and velocity
q = [1.0, 0.0]
v = [-2.0, 2.0]
ang = 45
Δt = 0.1

# Recording Position, Acceleration, Attitude, Planned Positions
qs_x = []
qs_y = []
as_x = []
as_y = []
angs = []
q_plans = []
u_plans = []

anim = @animate for i in 1:90 # This determies the number of MPC to be run
    # Plot the current position & Attitude
    plot(label = "Drone",[q[1]], [q[2]], marker=(:rect, 10), xlim=(-2, 2), ylim=(-2, 2))
    plot!(label = "Body Axis",[q[1]], [q[2]], marker=(:cross, 18, :grey))
    push!(qs_x,q[1])
    push!(qs_y,q[2])

    # Run the MPC control optimization
    q_plan, v_plan, u_plan, ang_plan = run_mpc(q, v, ang)

    # Draw the planned future states from the MPC optimization
    plot!(label = "Opt. Path", q_plan[1, :], q_plan[2, :], linewidth=5, arrow=true, c=:orange)
    # Draw the planned acceleration
    plot!(label = "Opt. Accel",u_plan[1, 1:2], u_plan[2, 1:2], linewidth=3, arrow=true, c=:red)

    # Save Acceleration & Angle Data to csv
    u = u_plan[:, 1]
    push!(as_x, u[1])
    push!(as_y, u[2])
    push!(angs, ang)
    push!(u_plans, u_plan)

    # Apply the planned acceleration&Attitude and simulate one step in time
    global ang = ang_plan[1]
    global v += u * Δt
    global q += v * Δt
end
gif(anim, "~/Downloads/NLmpc_angle.gif", fps=60)

end


问:
PathStrategy with Angular and Nginx not working
I have an angular app that is built inside the dist folder as dist/register. I am using docker and NGINX to deploy the application, now I have a docker file that looks like this.

```<code># Stage 1

FROM node:18-alpine as build-step

RUN mkdir -p /app-ui

WORKDIR /app-ui

COPY package.*json /app-ui

RUN npm install

COPY . /app-ui

RUN npm run build

# Stage 2

FROM nginx:alpine

#!/bin/sh

COPY ./.nginx/nginx.conf /etc/nginx/nginx.conf

## Remove default nginx index page
RUN rm -rf /usr/share/nginx/html/*

# Copy from the stahg 1
COPY --from=build-step /app-ui/dist /usr/share/nginx/html

EXPOSE 4200 80

ENTRYPOINT ["nginx", "-g", "daemon off;"]

</code>```

and my nginx conf looks like this.

```<code>worker_processes 4;

events { worker_connections 1024; }

http {
    server {
        listen 80;
        root  /usr/share/nginx/html;
        include /etc/nginx/mime.types;

        location /appui {
            try_files $uri $uri/ /register/index.html;
        }
    }
}
</code>```

Now, when I build the docker image, my subroutes are not working, i.e the localhost/ URL works and servers the index page of my app but as soon as I go to something like localhost/users, it fails and gives me 404.

Now, upon research I found that I can also use HashLocationStrategy and it worked as well but it changes the URL and appends a #, is there a way to make pathStrategy work?

Any help is appreciated.

Body:
I have an angular app that is built inside the dist folder as dist/register. I am using docker and NGINX to deploy the application, now I have a docker file that looks like this.

# Stage 1

FROM node:18-alpine as build-step

RUN mkdir -p /app-ui

WORKDIR /app-ui

COPY package.*json /app-ui

RUN npm install

COPY . /app-ui

RUN npm run build

# Stage 2

FROM nginx:alpine

#!/bin/sh

COPY ./.nginx/nginx.conf /etc/nginx/nginx.conf

## Remove default nginx index page
RUN rm -rf /usr/share/nginx/html/*

# Copy from the stahg 1
COPY --from=build-step /app-ui/dist /usr/share/nginx/html

EXPOSE 4200 80

ENTRYPOINT ["nginx", "-g", "daemon off;"]

and my nginx conf looks like this.

worker_processes 4;

events { worker_connections 1024; }

http {
    server {
        listen 80;
        root  /usr/share/nginx/html;
        include /etc/nginx/mime.types;

        location /appui {
            try_files $uri $uri/ /register/index.html;
        }
    }
}

Now, when I build the docker image, my subroutes are not working, i.e the localhost/ URL works and servers the index page of my app but as soon as I go to something like localhost/users, it fails and gives me 404.

Now, upon research I found that I can also use HashLocationStrategy and it worked as well but it changes the URL and appends a #, is there a way to make pathStrategy work?

Any help is appreciated.


问:
Flutter Exclude file path not working while getting files
i am getting all pdf from device storage and working fine but in Android 12 permission denied errno 13 and asking to exclude Android/data folder im trying but the exclude is not working
code to get files and exclude path

```<code>void getFiles() async {
if (await Permission.storage.request().isGranted) {
  // Either the permission was already granted before or the user just granted it.
}
//asyn function to get list of files
List<StorageInfo> storageInfo = await PathProviderEx.getStorageInfo();
var root = storageInfo[0]
    .rootDir; //storageInfo[1] for SD card, geting the root directory
var fm = FileManager(root: Directory(root)); //
files = await fm.filesTree(
    excludedPaths: ["/storage/emulated/0/Android/data"],
    extensions: ["pdf"] //optional, to filter files, list only pdf files
);
setState(() {}); //update the UI
</code>```

}

Body:
i am getting all pdf from device storage and working fine but in Android 12 permission denied errno 13 and asking to exclude Android/data folder im trying but the exclude is not working
code to get files and exclude path

void getFiles() async {
if (await Permission.storage.request().isGranted) {
  // Either the permission was already granted before or the user just granted it.
}
//asyn function to get list of files
List<StorageInfo> storageInfo = await PathProviderEx.getStorageInfo();
var root = storageInfo[0]
    .rootDir; //storageInfo[1] for SD card, geting the root directory
var fm = FileManager(root: Directory(root)); //
files = await fm.filesTree(
    excludedPaths: ["/storage/emulated/0/Android/data"],
    extensions: ["pdf"] //optional, to filter files, list only pdf files
);
setState(() {}); //update the UI

}


问:
pkgdown and R Markdown templates
For a package containing multiple R Markdown templates, is it possible to include the rendered versions of these templates (skeleton.Rmd) as vignettes / articles in the package documentation website (set up using pkgdown). I'd like to get a a nice overview of all the templates which are available in the package.

I want to avoid creating new vignettes which copy/paste the code from the R Markdown templates to vignettes/articles. Ideally, I'd just like to link them to the templates (skeleton.Rmd in the inst/rmarkdown/templates directory).

Any suggestions on how I can achieve this?

Thanks!

Originally posted on 2020-08-19 on Posit Community but without response.

Title: pkgdown and R Markdown templates


问:
How to add Categories in the SendGrid Email in using postman?
How to add Categories in the SendGrid Email in postman?
It's sendgrid web API.

First, add a category and retrieve email information based on the category we defined.


问:
How can I store logs to local database in android application?
I want to store my logs information in a local database in an android application with my custom function like writeLog(TAG, "msg");

How Should I create that function which can write data to local database?


问:
How to update bitly destination URL in Javascript
I have paid bitly version and I can update a destination URL by its dashboard link settings. As the same can we update by javascript? I tried with this example but had No luck. It's only updating Title and Tag. Please share the solution if anyone knows.


问:
Can I log into Passport.js by sending post requests from a python application?
I made a REST api with Node/express and I added a login feature using Passport.js, I want to be able to login to this from a CLI im making with python.

Im able to send a post request to my login url from my python app and get authorized by passport and send the info i want back to the python program, but once the python program has ended the express app doesn't cache me as logged in and in order to get back any info from the express app i have to send a Post request to the login url every time. The reason I thought this would work is because I can send Post requests from the REST-client extension and the app functions how I want. I have express-session etc set up, like i said it functions how I want with REST-client.


问:
ODBC Driver 18 for SQL Server SSL Provider
Recently upgraded PHP7 to PHP8 and updated Apache version. All PHP scripts connecting to SQL Server now throwing following error:

Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] =>
-2146893019 [code] => -2146893019 [2] => [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: The certificate chain was issued by an
authority that is not trusted. [message] => [Microsoft][ODBC Driver 18
for SQL Server]SSL Provider: The certificate chain was issued by an
authority that is not trusted. ) [1] => Array ( [0] => 08001
[SQLSTATE] => 08001 [1] => -2146893019 [code] => -2146893019 [2] =>
[Microsoft][ODBC Driver 18 for SQL Server]Client unable to establish
connection [message] => [Microsoft][ODBC Driver 18 for SQL
Server]Client unable to establish connection ) )

ODBC driver is already installed. Any suggestion will be appreciated.

I tried to reinstall ODBC driver to latest version, but no results so far.


问:
Trying to solve 2D truss structure, error: Warning: Solution does not exist because the system is inconsistent
Trying to make a systems of equations to solve the internal forces of a truss in the x and y plane, and get the error that my system is inconsistent. I have double checked multiple times and I'm not quite sure what I'm missing, any tips?

Here is code:

clc, clear all;

syms FAB FBC FCD FDE FEF FFG FGH FAI FCI FHI FBI FCG FCF FDF FGI Ay Ex Ey;

theta1 = atand(4/10); %theta for all members

%creating vectors for all internal member directions

VecFAB = FAB*[1 0];

VecFBC = FBC*[1 0];

VecFCD = FCD*[1 0];

VecFDE = FDE*[1 0];

VecFEF= FEF*[cosd(theta1) sind(theta1)];

VecFFG = FFG*[cosd(theta1) sind(theta1)];

VecFGH = FGH*[cosd(theta1) sind(theta1)];

VecFAI = FAI*[cosd(theta1) sind(theta1)];

VecFCI = FCI*[cosd(theta1) sind(theta1)];

VecFCF = FCF*[cosd(theta1) sind(theta1)];

VecFGI = FGI*[cosd(theta1) sind(theta1)];

VecFHI = FHI*[0 1];

VecFBI = FBI*[0 1];

VecFCG = FCG*[0 1];

VecFDF = FDF*[0 1];

RA = Ay*[0 1];

RE = Ey*[0 1] + Ex*[1 0];

F1 = 2000*[1 0];

F2 = 1500*[1 0];

F3 = 3000*[0 -1];

F4 = 3000*[0 -1];

%create equations at given points

FA = VecFAB + VecFAI + RA + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FB = VecFAB + VecFBI + VecFBC + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FC = VecFBC + VecFCI + VecFCD + VecFCF + VecFCG + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FD = VecFDF + VecFCD + VecFDE + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FE = RE + VecFEF + VecFDE + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FF = F4 + VecFEF + VecFFG + VecFDF + VecFCF + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FG = F3 + VecFFG + VecFGH + VecFGI + VecFCG + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FH = F1 + VecFHI + VecFGH + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FI = F2 + VecFBI + VecFHI + VecFAI + VecFCI + VecFGI + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

%break into x and y components

EQNFAX = FA(1)==0;
EQNFAY = FA(2)==0;

EQNFBX = FB(1)==0;
EQNFBY = FB(2)==0;

EQNFCX = FC(1)==0;
EQNFCY = FC(2)==0;

EQNFDX = FD(1)==0;
EQNFDY = FD(2)==0;

EQNFEX = FE(1)==0;
EQNFEY = FE(2)==0;

EQNFFX = FF(1)==0;
EQNFFY = FF(2)==0;

EQNFGX = FG(1)==0;
EQNFGY = FG(2)==0;

EQNFHX = FH(1)==0;
EQNFHY = FH(2)==0;

EQNFIX = FI(1)==0;
EQNFIY = FI(2)==0;

[A,B] = equationsToMatrix([EQNFAX,EQNFAY,EQNFBX,EQNFBY,EQNFCX,EQNFCY,EQNFDX,EQNFDY,EQNFEX,EQNFEY,EQNFFX,EQNFFY,EQNFGX,EQNFGY,EQNFHX,EQNFHY,EQNFIX,EQNFIY],[FAB,FBC,FCD,FDE,FEF,FFG,FGH,FAI,FCI,FHI,FBI,FCG,FCF,FDF,FGI,Ay,Ex,Ey]);

solution = linsolve(A,B)
```
<p>I have tried double checking all my equations, as well as the vectors that represent them, and still no dice. I have done this before on a problem to solve force and reaction forces in 3 dimensions and had less trouble, the code is below if it might help.</p>
```clear all, clc

syms Ax Ay Bx Bz Cz F2 %Cy is not present because the problem states that Cy = 0

F1 = 300; %given F1 value

rF2 = [cos(45*pi/180)*sin(30*pi/180) cos(45*pi/180)*cos(30*pi/180) -sin(45*pi/180)]; %using given angles, break F1 and F2 down into x, y, and z direction

rF1 = [0 -cos(45*pi/180) -sin(45*pi/180)];

uF1 = rF1/norm(rF1); %create unit vectors for F1 and F2 so that they can be broken down into x, y, and z components

uF2 = rF2/norm(rF2);

vecF1 = F1*uF1; %create the vector forms of F1 and F2 by multiplying the unit vector by F1 and F2 respectively

vecF2 = F2*uF2;

vecAx = Ax*[1 0 0]; %multiply Ax, Ay, Bx, Bz, and Cz by their respective unit in matrix form, to create correct syntax for code

vecAy = Ay*[0 1 0];

vecBx = Bx*[1 0 0];

vecBz = Bz*[0 0 1];

vecCz = Cz*[0 0 1];

sumF = vecF1 + vecF2 + vecAx + vecAy + vecBx + vecBz + vecCz; %create main sum of forces equation to be broken down into x, y, z components

eqn1=sumF(1)==0; %create equations equivalent to sum of forces in x, y, and z using matrix made by sumF
eqn2=sumF(2)==0;
eqn3=sumF(3)==0;

rF1_D = [0 -5 5]; %find distance from created point 'D' (where F2 lies) to use for moment calculation

rF2_D = [0 0 0];

rA_D = [0 -5 4];

rB_D = [0 -3 0];

rC_D = [-5 0 0];

sumM = (cross(vecF1, rF1_D) + cross(vecF2, rF2_D))  ...
+ (cross(vecAx, rA_D) + cross(vecAy, rA_D) + cross(vecBx, rB_D) + cross(vecBz, rB_D) ...
+ cross(vecCz, rC_D)); %create the sum of moments main equation in matrix form to be broken down into x, y, and z components using the cross product of each vector with the distance from point D

eqn4=sumM(1)==0; %create equations equivalent to the sum of moments at x, y, and z
eqn5=sumM(2)==0;
eqn6=sumM(3)==0;

[A,B] = equationsToMatrix([eqn1 eqn2 eqn3 eqn4 eqn5 eqn6], [Ax Ay Bx Bz Cz F2]); %creating a matrix based on the sum of forces and sum of moment equations, solving for reaction forces and F2

solution = linsolve(A,B); %solving matrix for reaction forces and f2

F2=round(solution(6),3) %printed F2; solution was a very long fraction, simplified to 3 decimals
```

Body:
Trying to make a systems of equations to solve the internal forces of a truss in the x and y plane, and get the error that my system is inconsistent. I have double checked multiple times and I'm not quite sure what I'm missing, any tips?

Here is code:

clc, clear all;

syms FAB FBC FCD FDE FEF FFG FGH FAI FCI FHI FBI FCG FCF FDF FGI Ay Ex Ey;

theta1 = atand(4/10); %theta for all members

%creating vectors for all internal member directions

VecFAB = FAB*[1 0];

VecFBC = FBC*[1 0];

VecFCD = FCD*[1 0];

VecFDE = FDE*[1 0];

VecFEF= FEF*[cosd(theta1) sind(theta1)];

VecFFG = FFG*[cosd(theta1) sind(theta1)];

VecFGH = FGH*[cosd(theta1) sind(theta1)];

VecFAI = FAI*[cosd(theta1) sind(theta1)];

VecFCI = FCI*[cosd(theta1) sind(theta1)];

VecFCF = FCF*[cosd(theta1) sind(theta1)];

VecFGI = FGI*[cosd(theta1) sind(theta1)];

VecFHI = FHI*[0 1];

VecFBI = FBI*[0 1];

VecFCG = FCG*[0 1];

VecFDF = FDF*[0 1];

RA = Ay*[0 1];

RE = Ey*[0 1] + Ex*[1 0];

F1 = 2000*[1 0];

F2 = 1500*[1 0];

F3 = 3000*[0 -1];

F4 = 3000*[0 -1];

%create equations at given points

FA = VecFAB + VecFAI + RA + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FB = VecFAB + VecFBI + VecFBC + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FC = VecFBC + VecFCI + VecFCD + VecFCF + VecFCG + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FD = VecFDF + VecFCD + VecFDE + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FE = RE + VecFEF + VecFDE + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FF = F4 + VecFEF + VecFFG + VecFDF + VecFCF + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FG = F3 + VecFFG + VecFGH + VecFGI + VecFCG + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FH = F1 + VecFHI + VecFGH + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

FI = F2 + VecFBI + VecFHI + VecFAI + VecFCI + VecFGI + 0*(VecFAB+VecFBC+VecFCD+VecFDE+VecFEF+VecFFG+VecFGH+VecFAI+VecFCI+VecFCF+VecFGI+VecFDF+VecFCG+VecFBI+VecFHI+RA+RE);

%break into x and y components

EQNFAX = FA(1)==0;
EQNFAY = FA(2)==0;

EQNFBX = FB(1)==0;
EQNFBY = FB(2)==0;

EQNFCX = FC(1)==0;
EQNFCY = FC(2)==0;

EQNFDX = FD(1)==0;
EQNFDY = FD(2)==0;

EQNFEX = FE(1)==0;
EQNFEY = FE(2)==0;

EQNFFX = FF(1)==0;
EQNFFY = FF(2)==0;

EQNFGX = FG(1)==0;
EQNFGY = FG(2)==0;

EQNFHX = FH(1)==0;
EQNFHY = FH(2)==0;

EQNFIX = FI(1)==0;
EQNFIY = FI(2)==0;

[A,B] = equationsToMatrix([EQNFAX,EQNFAY,EQNFBX,EQNFBY,EQNFCX,EQNFCY,EQNFDX,EQNFDY,EQNFEX,EQNFEY,EQNFFX,EQNFFY,EQNFGX,EQNFGY,EQNFHX,EQNFHY,EQNFIX,EQNFIY],[FAB,FBC,FCD,FDE,FEF,FFG,FGH,FAI,FCI,FHI,FBI,FCG,FCF,FDF,FGI,Ay,Ex,Ey]);

solution = linsolve(A,B)

I have tried double checking all my equations, as well as the vectors that represent them, and still no dice. I have done this before on a problem to solve force and reaction forces in 3 dimensions and had less trouble, the code is below if it might help.

clear all, clc

syms Ax Ay Bx Bz Cz F2 %Cy is not present because the problem states that Cy = 0

F1 = 300; %given F1 value

rF2 = [cos(45*pi/180)*sin(30*pi/180) cos(45*pi/180)*cos(30*pi/180) -sin(45*pi/180)]; %using given angles, break F1 and F2 down into x, y, and z direction

rF1 = [0 -cos(45*pi/180) -sin(45*pi/180)];

uF1 = rF1/norm(rF1); %create unit vectors for F1 and F2 so that they can be broken down into x, y, and z components

uF2 = rF2/norm(rF2);

vecF1 = F1*uF1; %create the vector forms of F1 and F2 by multiplying the unit vector by F1 and F2 respectively

vecF2 = F2*uF2;

vecAx = Ax*[1 0 0]; %multiply Ax, Ay, Bx, Bz, and Cz by their respective unit in matrix form, to create correct syntax for code

vecAy = Ay*[0 1 0];

vecBx = Bx*[1 0 0];

vecBz = Bz*[0 0 1];

vecCz = Cz*[0 0 1];

sumF = vecF1 + vecF2 + vecAx + vecAy + vecBx + vecBz + vecCz; %create main sum of forces equation to be broken down into x, y, z components

eqn1=sumF(1)==0; %create equations equivalent to sum of forces in x, y, and z using matrix made by sumF
eqn2=sumF(2)==0;
eqn3=sumF(3)==0;

rF1_D = [0 -5 5]; %find distance from created point 'D' (where F2 lies) to use for moment calculation

rF2_D = [0 0 0];

rA_D = [0 -5 4];

rB_D = [0 -3 0];

rC_D = [-5 0 0];

sumM = (cross(vecF1, rF1_D) + cross(vecF2, rF2_D))  ...
+ (cross(vecAx, rA_D) + cross(vecAy, rA_D) + cross(vecBx, rB_D) + cross(vecBz, rB_D) ...
+ cross(vecCz, rC_D)); %create the sum of moments main equation in matrix form to be broken down into x, y, and z components using the cross product of each vector with the distance from point D

eqn4=sumM(1)==0; %create equations equivalent to the sum of moments at x, y, and z
eqn5=sumM(2)==0;
eqn6=sumM(3)==0;

[A,B] = equationsToMatrix([eqn1 eqn2 eqn3 eqn4 eqn5 eqn6], [Ax Ay Bx Bz Cz F2]); %creating a matrix based on the sum of forces and sum of moment equations, solving for reaction forces and F2

solution = linsolve(A,B); %solving matrix for reaction forces and f2

F2=round(solution(6),3) %printed F2; solution was a very long fraction, simplified to 3 decimals


问:
Netsuitescript 2.x how to load custome record in map/reduce
There are two custom record c1 and c2
me need to be fetch data from c2 based on record c1 item and subsidiaries internal id, after that if get the response the update record c1.

i have tried the search.create for this but its not working ( to load the all record in c1 )


问:
Flutter PageView inside NestedScrollview requires fixed height
I use PageView inside NestedScrollView. On page in PageView I fetch data from server. But content inside pageview don't scrolling because I should wrap pageview with SizedBox with fixed height. How can I expand page for content?

on page #1:

```<code>NestedScrollView(
      key: _homeNestedKey,
      headerSliverBuilder: (context, innerBoxIsScrolled) {
        return <Widget>[
          SliverAppBar(
            ...
            bottom: CustomTabBar(
              items: tabItems,
              onChangedIndex: _onTabChanged,
              chosenIndex: _chosenTabIndex,
            ),
          ),
        ];
      },
      body: SmartRefresher(
        ...
        onRefresh: _onRefresh,
        onLoading: _onLoading,
        child: PageView(
          onPageChanged: _onPageChanged,
          controller: _pageController,
          children: const [
            FeedContent(),
            PromotionsContent(),
            ShopContent(),
          ],
        ),
      ),
    ),
</code>```

inside FeedContent:

```<code>ListView(
  shrinkWrap: true,
  physics: const NeverScrollableScrollPhysics(),
  children: [
    ...feed.map((f) => FeedItemCard(feedItem: f)),
    const SizedBox(height: 36),
    if (isLoading) const CustomLoader(),
    const SizedBox(height: 100),
  ],
);
</code>```

Body:
I use PageView inside NestedScrollView. On page in PageView I fetch data from server. But content inside pageview don't scrolling because I should wrap pageview with SizedBox with fixed height. How can I expand page for content?

on page #1:

NestedScrollView(
      key: _homeNestedKey,
      headerSliverBuilder: (context, innerBoxIsScrolled) {
        return <Widget>[
          SliverAppBar(
            ...
            bottom: CustomTabBar(
              items: tabItems,
              onChangedIndex: _onTabChanged,
              chosenIndex: _chosenTabIndex,
            ),
          ),
        ];
      },
      body: SmartRefresher(
        ...
        onRefresh: _onRefresh,
        onLoading: _onLoading,
        child: PageView(
          onPageChanged: _onPageChanged,
          controller: _pageController,
          children: const [
            FeedContent(),
            PromotionsContent(),
            ShopContent(),
          ],
        ),
      ),
    ),

inside FeedContent:

ListView(
  shrinkWrap: true,
  physics: const NeverScrollableScrollPhysics(),
  children: [
    ...feed.map((f) => FeedItemCard(feedItem: f)),
    const SizedBox(height: 36),
    if (isLoading) const CustomLoader(),
    const SizedBox(height: 100),
  ],
);


问:
How to drag a object with the snap points in react native?
I am using https://github.com/tongyy/react-native-draggable to drag my element but my issue is that i want to drag the object at snap points.

for example:- if i drag my element for 0 to 100 the if should move from 1 to 10 then 20 then 30 and so on but current i am getting like 1 to 1.0023 to 1.045 to 2.23 and so on.

i want dont want to drag smoothly i want to drag at certain snap points.


问:
Why pymysql cursor changes during iteration where MySQLdb cursor doesn't?
Switching from MySQLdb to pymysql because of MySQLdb having issues while installing while moving my app to other systems

I have to iterate over large tables, in MySQLdb I used to for row in cursor instead of for row in cursor.fetchall()

```<code>for row in cursor:
    #some work
    cursor.execute("UPDATE table")
    cursor.execute("SELECT * FROM table")
</code>```

This used to work perfectly

After switching to pymysql I noticed the for row in cursor does not work and cursor changes if I execute another query

This issue has been mentioned in github issues and there is a PULL request too which is rejected

Using for row in cursor.fetchall() is not recommended because it loads all data at once, causing my app KILLED

some comments say use a new cursor for each query, it it good when I have thousands of queries?

Or there is any way that I can modify my pymysql cursors code according to this https://github.com/PyMySQL/PyMySQL/pull/166/commits/94082775506aedc787eed96444b7fe297f9ae1a7

Body:
Switching from MySQLdb to pymysql because of MySQLdb having issues while installing while moving my app to other systems

I have to iterate over large tables, in MySQLdb I used to for row in cursor instead of for row in cursor.fetchall()

for row in cursor:
    #some work
    cursor.execute("UPDATE table")
    cursor.execute("SELECT * FROM table")

This used to work perfectly

After switching to pymysql I noticed the for row in cursor does not work and cursor changes if I execute another query

This issue has been mentioned in github issues and there is a PULL request too which is rejected

Using for row in cursor.fetchall() is not recommended because it loads all data at once, causing my app KILLED

some comments say use a new cursor for each query, it it good when I have thousands of queries?

Or there is any way that I can modify my pymysql cursors code according to this https://github.com/PyMySQL/PyMySQL/pull/166/commits/94082775506aedc787eed96444b7fe297f9ae1a7


问:
Unsupported class file major version 61 error with jobrunr
I am trying to use jobrunr with java 17. However, I am getting Unsupported class file major version 61 error while doing the same with the line
JobId jobId = BackgroundJob.schedule(runAt, () -> helper.excuteTaskAction();
Does jobrunr not support java 17? If it does can anyone help me figure out why a conflict is arising here? I am using the package jobrunr-spring-boot-starter:5.3.1.

I tried downgrading to java 8, which scheduled jobs without errors. However, I would very much like to keep working with java 17. Can somebody please help me with this?


问:
I want to shuffle the data coming from firebase
I am getting data from the firebase from starting to end by sequence and I want to show the data randomly but I am having issue to shuffle the data coming from the firebase. I am getting data from the firebase from starting to end by sequence and I want to show the data randomly but I am having issue to shuffle the data coming from the firebase.
Here is my code to understand it better.

Main Activity:

```<code>class MainActivity : AppCompatActivity() {

    lateinit var viewPager2:ViewPager2
    lateinit var adapter:VideoAdapter

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        /**set fullscreen*/
        window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN)

        /**set find id*/
        viewPager2 = findViewById(R.id.vpager)

        /**set database*/
        val mDataBase = Firebase.database.getReference("videos")

        val options = FirebaseRecyclerOptions.Builder<VideoModel>()
            .setQuery(mDataBase,VideoModel::class.java)
            .build()

        /**set adapter*/
        adapter = VideoAdapter(options)
        viewPager2.adapter = adapter

    }

    override fun onStart() {
        super.onStart()
        adapter.startListening()
    }

    override fun onStop() {
        super.onStop()
        adapter.stopListening()
    }

}
</code>```

VideoAdapter

```<code>class VideoAdapter(options: FirebaseRecyclerOptions<VideoModel?>) :
    FirebaseRecyclerAdapter<VideoModel?, VideoAdapter.MyViewHolder?>(options) {

    override fun onBindViewHolder(holder: MyViewHolder, position: Int, model: VideoModel) {
        holder.setdata(model)
    }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {
        val view: View = LayoutInflater.from(parent.context).inflate(R.layout.single_video_row, parent, false)
        return MyViewHolder(view)
    }

    inner class MyViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
        var videoView: VideoView
        var title: TextView
        var desc: TextView
        var pbar: ProgressBar
        var fav :ImageView
        var isFav = false

        fun setdata(obj: VideoModel) {
            videoView.setVideoPath(obj.url)
            title.setText(obj.title)
            desc.setText(obj.desc)

            videoView.setOnPreparedListener { mediaPlayer ->
                pbar.visibility = View.GONE
                mediaPlayer.start()
            }
            videoView.setOnCompletionListener { mediaPlayer -> mediaPlayer.start() }
            fav.setOnClickListener {
                if (!isFav){
                    fav.setImageResource(R.drawable.ic_fill_favorite)
                    isFav = true

                }
                else{
                    fav.setImageResource(R.drawable.ic_favorite)
                    isFav = false
                }

            }
        }

        init {
            videoView = itemView.findViewById<View>(R.id.videoView) as VideoView
            title = itemView.findViewById<View>(R.id.textVideoTitle) as TextView
            desc = itemView.findViewById<View>(R.id.textVideoDescription) as TextView
            pbar = itemView.findViewById<View>(R.id.videoProgressBar) as ProgressBar
            fav = itemView.findViewById(R.id.favorites) as ImageView
            count = itemView.findViewById(R.id.count) as TextView
        }

    }
}

</code>```

VideoModel

```<code>data class VideoModel(
    var title:String?=null,
    var desc:String?=null,
    var url:String?=null
)
</code>```

Here are the data which i want to get randomly

Body:
I am getting data from the firebase from starting to end by sequence and I want to show the data randomly but I am having issue to shuffle the data coming from the firebase. I am getting data from the firebase from starting to end by sequence and I want to show the data randomly but I am having issue to shuffle the data coming from the firebase.
Here is my code to understand it better.

Main Activity:

class MainActivity : AppCompatActivity() {

    lateinit var viewPager2:ViewPager2
    lateinit var adapter:VideoAdapter

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        /**set fullscreen*/
        window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN)

        /**set find id*/
        viewPager2 = findViewById(R.id.vpager)

        /**set database*/
        val mDataBase = Firebase.database.getReference("videos")

        val options = FirebaseRecyclerOptions.Builder<VideoModel>()
            .setQuery(mDataBase,VideoModel::class.java)
            .build()

        /**set adapter*/
        adapter = VideoAdapter(options)
        viewPager2.adapter = adapter

    }

    override fun onStart() {
        super.onStart()
        adapter.startListening()
    }

    override fun onStop() {
        super.onStop()
        adapter.stopListening()
    }

}

VideoAdapter

class VideoAdapter(options: FirebaseRecyclerOptions<VideoModel?>) :
    FirebaseRecyclerAdapter<VideoModel?, VideoAdapter.MyViewHolder?>(options) {

    override fun onBindViewHolder(holder: MyViewHolder, position: Int, model: VideoModel) {
        holder.setdata(model)
    }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {
        val view: View = LayoutInflater.from(parent.context).inflate(R.layout.single_video_row, parent, false)
        return MyViewHolder(view)
    }

    inner class MyViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
        var videoView: VideoView
        var title: TextView
        var desc: TextView
        var pbar: ProgressBar
        var fav :ImageView
        var isFav = false

        fun setdata(obj: VideoModel) {
            videoView.setVideoPath(obj.url)
            title.setText(obj.title)
            desc.setText(obj.desc)

            videoView.setOnPreparedListener { mediaPlayer ->
                pbar.visibility = View.GONE
                mediaPlayer.start()
            }
            videoView.setOnCompletionListener { mediaPlayer -> mediaPlayer.start() }
            fav.setOnClickListener {
                if (!isFav){
                    fav.setImageResource(R.drawable.ic_fill_favorite)
                    isFav = true

                }
                else{
                    fav.setImageResource(R.drawable.ic_favorite)
                    isFav = false
                }

            }
        }

        init {
            videoView = itemView.findViewById<View>(R.id.videoView) as VideoView
            title = itemView.findViewById<View>(R.id.textVideoTitle) as TextView
            desc = itemView.findViewById<View>(R.id.textVideoDescription) as TextView
            pbar = itemView.findViewById<View>(R.id.videoProgressBar) as ProgressBar
            fav = itemView.findViewById(R.id.favorites) as ImageView
            count = itemView.findViewById(R.id.count) as TextView
        }

    }
}

VideoModel

data class VideoModel(
    var title:String?=null,
    var desc:String?=null,
    var url:String?=null
)

Here are the data which i want to get randomly


问:
Unable to ping IPv6 from docker container
I am using rancher desktop to run a docker container (OS - Oracle Linux 7) locally. ifconfig output of my docker container:

```<code>eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.17.0.2  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:ac:11:00:02  txqueuelen 0  (Ethernet)
        RX packets 2310  bytes 331965 (324.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2302  bytes 427593 (417.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
</code>```

When I use ping6 or ping -6 commands e.g. ping6 ipv6.google.com, I get the error:

ping: ipv6.google.com: Name or service not known

What am I missing?

EDIT :  I already tried Docker ping ipv6 endpoint . Actually , there was no existing /etc/docker/daemon.json in my container / MAC. So I tried by creating and adding content as explained in the post on both my local machine (MAC) as well as inside container. But it did not work for me.

Body:
I am using rancher desktop to run a docker container (OS - Oracle Linux 7) locally. ifconfig output of my docker container:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.17.0.2  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:ac:11:00:02  txqueuelen 0  (Ethernet)
        RX packets 2310  bytes 331965 (324.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2302  bytes 427593 (417.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

When I use ping6 or ping -6 commands e.g. ping6 ipv6.google.com, I get the error:

ping: ipv6.google.com: Name or service not known

What am I missing?

EDIT :  I already tried Docker ping ipv6 endpoint . Actually , there was no existing /etc/docker/daemon.json in my container / MAC. So I tried by creating and adding content as explained in the post on both my local machine (MAC) as well as inside container. But it did not work for me.


问:
Prevent a Zoomable IFrame from Scrolling Parent Page when Mouse Over
I have an embedded MC Map (Bluemap) that I have access to, embedded in my main site using an IFrame. Scrolling to zoom when mouse is over the map zooms the map, but ALSO scrolls the parent page simultaneously, which I obviously want to prevent. I have used Dynmap (another MC map plugin) from an external site which worked and only zoomed on mouse over.

Here is my Iframe:

```<code><iframe src="https://bluemap.aternix.com/" title="Bluemap" id="bluemapframe"></iframe>
</code>```

Here is my live site to demonstrate the current Bluemap Iframe:
https://aternix.com/mc-server

I have tried overflow-behavior: contain and numerous JS scroll and focus targeting scripts to prevent parent document from scrolling when mouse is over the frame but neither of these have worked. I was hoping some simple CSS targeting of the Iframe or even elements within the Iframe (which I have access to as its self hosted) would do the trick but nothing has worked thus far. I currently run vanilla JS.

Body:
I have an embedded MC Map (Bluemap) that I have access to, embedded in my main site using an IFrame. Scrolling to zoom when mouse is over the map zooms the map, but ALSO scrolls the parent page simultaneously, which I obviously want to prevent. I have used Dynmap (another MC map plugin) from an external site which worked and only zoomed on mouse over.

Here is my Iframe:

Here is my live site to demonstrate the current Bluemap Iframe:
https://aternix.com/mc-server

I have tried overflow-behavior: contain and numerous JS scroll and focus targeting scripts to prevent parent document from scrolling when mouse is over the frame but neither of these have worked. I was hoping some simple CSS targeting of the Iframe or even elements within the Iframe (which I have access to as its self hosted) would do the trick but nothing has worked thus far. I currently run vanilla JS.


问:
Can't install lxml on pip
I can't install lxml on pip or pip3

I tried run the code on python3.11

```<code>import pandas as pd
data = pd.read_html("https://zh.wikipedia.org/zh-hans/%E6%81%92%E7%94%9F%E6%8C%87%E6%95%B8")
</code>```

It occurred a Import Error.
"ImportError: lxml not found, please install it"

So I tried to install the lxml. "pip install lxml"

However, it cannot be install.
** note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> lxml

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.**

And then, I had download the lxml-4.9.9-pp38-....whl
and entered "pip install c:/......." and it said whl is not a supported wheel on this platform.

Could someone do me a favor?

Title: Can't install lxml on pip

Body:
I can't install lxml on pip or pip3

I tried run the code on python3.11

import pandas as pd
data = pd.read_html("https://zh.wikipedia.org/zh-hans/%E6%81%92%E7%94%9F%E6%8C%87%E6%95%B8")

It occurred a Import Error.
"ImportError: lxml not found, please install it"

So I tried to install the lxml. "pip install lxml"

However, it cannot be install.
** note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> lxml

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.**

And then, I had download the lxml-4.9.9-pp38-....whl
and entered "pip install c:/......." and it said whl is not a supported wheel on this platform.

Could someone do me a favor?


问:
How to iterate through the response of this API request in Laravel 9
I've got this thing which I don't know what it is, an object, a collection... that I am trying to parse. It's the output of below code (response of an Uploadcare PHP API request):

```<code>$fileListResponse = $api->file()->listFiles();
$fileCollection = $fileListResponse->getResults();
</code>```

As you can see in the screenshot below the children are -inner, -api and #elements. The children of the nodes of #elements also have -api and -inner.

When I try the following:

```<code>foreach ($fileCollection->elements as $thing) {
    ...
}
</code>```

I get the error:

```<code>Cannot access protected property Uploadcare\FileCollection::$elements
</code>```

How can I iterate through the elements?

Body:
I've got this thing which I don't know what it is, an object, a collection... that I am trying to parse. It's the output of below code (response of an Uploadcare PHP API request):

$fileListResponse = $api->file()->listFiles();
$fileCollection = $fileListResponse->getResults();

As you can see in the screenshot below the children are -inner, -api and #elements. The children of the nodes of #elements also have -api and -inner.

When I try the following:

foreach ($fileCollection->elements as $thing) {
    ...
}

I get the error:

Cannot access protected property Uploadcare\FileCollection::$elements

How can I iterate through the elements?


问:
config.Check does not recognize context.Context as context.Context interface
I am trying to execute types.Config.Check on github.com/OrlovEvgeny/go-mcache/mcache.go in order to extract the definitions and types in the Go file.

The problem is that the Check() method fails with:

```<code>cannot use ctx (variable of type context.Context) as context.Context value in argument to gcmap.NewGC: context.Context does not implement context.Context (wrong type for method Deadline)
                        have Deadline() (deadline time.Time, ok bool)
                        want Deadline() (deadline time. Time, ok bool)
</code>```

The Context used in mcache library is quite standard, and is passed to NewGC():

```<code>func (mc *CacheDriver) initStore() (context.Context, context.CancelFunc) {
    ctx, finish := context.WithCancel(context. Background())
    mc.storage = safeMap.NewStorage()
    mc.gc = gcmap.NewGC(ctx, mc.storage) // <-- The problem is here
    return ctx, finish
}
</code>```

I should also point out the library compiles successfully and works.

I have debugged the issue it ultimately the following line returns false (types/predicates. go:416):

```<code>return x.obj == y.obj
</code>```

I have compared the two object, but they seem similar besides their token.Pos, which I guess it is the reason why it returns false.

Does anyone has any idea what am I missing here?

Thanks!

Body:
I am trying to execute types.Config.Check on github.com/OrlovEvgeny/go-mcache/mcache.go in order to extract the definitions and types in the Go file.

The problem is that the Check() method fails with:

cannot use ctx (variable of type context.Context) as context.Context value in argument to gcmap.NewGC: context.Context does not implement context.Context (wrong type for method Deadline)
                        have Deadline() (deadline time.Time, ok bool)
                        want Deadline() (deadline time. Time, ok bool)

The Context used in mcache library is quite standard, and is passed to NewGC():

func (mc *CacheDriver) initStore() (context.Context, context.CancelFunc) {
    ctx, finish := context.WithCancel(context. Background())
    mc.storage = safeMap.NewStorage()
    mc.gc = gcmap.NewGC(ctx, mc.storage) // <-- The problem is here
    return ctx, finish
}

I should also point out the library compiles successfully and works.

I have debugged the issue it ultimately the following line returns false (types/predicates. go:416):

return x.obj == y.obj

I have compared the two object, but they seem similar besides their token.Pos, which I guess it is the reason why it returns false.

Does anyone has any idea what am I missing here?

Thanks!


问:
How can I download a file from an S3 bucket with wget by Object owner?
I am a beginner in aws and I have a problem.
Problem is:
Is it possible to download an object from S3 bucket via the object owner using the wget command from Elastic container service?

I have defined the policies, but it seems that these policies have no effect and aws considers the download request from outside and does not find the object and issues a 403 message.

Is there any other solution?

Thank you in advance for the answer.


问:
How to render selected component in same page
Is it possible to do when i clicked the components and the components what i click render at below?

```<code><ion-card>
<img src="https://i.ibb.co/Gkj6T8b/cat.jpg" alt="cat" border="0">
<ion-card-content id="test">
   component 1
</ion-card-content>
</ion-card>
</code>```

Body:
Is it possible to do when i clicked the components and the components what i click render at below?

<ion-card>

<ion-card-content id="test">
   component 1
</ion-card-content>
</ion-card>


问:
Combine two Praat textgrid file
We have multiple people working on the same textgrid file and would like to combine it into a larger one. The textgird file has eight tiers. I would like to combine the textgrids files without messing up the tiers. I would like to do something like |x|- + -|x| into |x|x| for each of the eight tiers. Is it possible to do that? Thanks.</p>

Title: Combine two Praat textgrid file


问:
Rabin Karp implementation the precomputed hash values and Hash function values don't match
I have Rabin Karp implementation in C++ (Rabin Karp is a string pattern matching algorithm that uses hashing technique to match substrings [Wiki link to the algorithm] (https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm)), A trivial test case fails, I suspect precomputation of substring hashes routine is doing something wrong, because I tried replacing the precomputed value with the PolynomialHash function call ie. computing the hash of the substring in flight. I get the correct result with PolynomialHash function call but precomputed doesn't. What might have I done wrong here?

Algorithm pseudo code

```<code>1) Choose a large Prime p.
2) Let x be a random value in range [1, p-1].
3) Get the hash value for the pattern (p and x are used here).
4) For each substring which has length equal to the pattern compute the hash value of this substring.
5) If the hash values of pattern and the substring match then this substring could be a potential match, to ensure, check whether they are in fact the same.
</code>```

The reason a good implementation should avoid using PolynomialHash is because the time complexity goes high, instead precomputing the Hash values for each substring is more efficient. So, my problem is the precomputed hashes, and the function call hash values don't match. Below is the relevant code and the failing testcase. Note the large prime I used is 1e9 + 7. ll is typedef for long long int.

```<code>bool AreEqual(const string &text,const string &pattern,int si,int ei){
    for(int i =0;i<pattern.size();i++){
        if(pattern[i]!=text[si+i]) return false;
    }
    return true;
}

ll PolynomialHash(const string &str,ll prime,ll x,int si,int ei){
    ll hash_val = 0;
    for(int i = ei;i>=si;i--) hash_val = (hash_val*x+str[i])%prime;
    return hash_val;
}

ll GetInt(const char &x){
    return x-'a';
}

void PrecomputeSubstringHashes(vector<ll> &substring_hashes,const string &text,const string &pattern,ll prime,ll x){
    int text_len = text.length();
    int pattern_len = pattern.length();
    substring_hashes[text_len-pattern_len] = PolynomialHash(text,prime,x,text_len-pattern_len,text_len-1);
    ll y = 1;
    for(int i =0;i<pattern_len;i++) y = (y*x)%prime; // can still be optimized to O(log(|P|))
    for(int i = text_len-pattern_len-1;i>=0;i--){
        substring_hashes[i] = (prime + substring_hashes[i+1]*x + GetInt(text[i]) - y*GetInt(text[i+pattern_len]))%prime;
    }
}

void RabinKarpSubstringSearch(const string &text,const string &pattern){
    vector<int>positions;
    ll prime = Mod; // This large prime used is 1e9 + 7
    ll x = 1 + rand()%prime;
    ll pattern_hash = PolynomialHash(pattern,prime,x,0,pattern.length()-1);
    assert(text.length()>=pattern.length());
    vector<ll>substring_hashes(text.length()-pattern.length()+1,0);
    PrecomputeSubstringHashes(substring_hashes,text,pattern,prime,x);
    for(int i =0;i<=text.length()-pattern.length();i++){
        ll substr_hash = substring_hashes[i]; // Try with PolynomialHash it gives correct results
        if(substr_hash!=pattern_hash) continue;
       // cout<<"Hitting at "<<i<<' '; // checking if expected and more indices [the wrong ones] hit this line.
        if(AreEqual(text,pattern,i,i+pattern.length()-1)) positions.push_back(i); /// The probablity of this condition being hit is too less thanks to a large prime number.
    }
    cout<<'\n';
    for(const int &x : positions) cout<<x<<' ';
}
</code>```
```<code>// Test case

aab
abxaabbbaaab

PolynomialHash gives [3,9] as expected
substring_hashes[i] gives only [9]
</code>```

I Did some further analysis I was right to suspect the Hash returned by Function and the precomputed values don't match. Here are both of them with input same as in the testcase. The Pattern Hash value is 850147133 seen at index 3 and 9 in Function hash.

```<code>// Function computed Hashes [index,HashValue]
0 45760133
1 921924329
2 423268806
3 **850147133**
4 654436503
5 654436504
6 227558154
7 423268784
8 423268783
9 **850147133**
</code>```
```<code>// Precomputed Hashes [index,HashValue]
0 317287043
1 159209231
2 90628189
3 807191256
4 327387316
5 934623271
6 740231484
7 428758105
8 399604110
9 **850147133**
</code>```

Body:
I have Rabin Karp implementation in C++ (Rabin Karp is a string pattern matching algorithm that uses hashing technique to match substrings [Wiki link to the algorithm] (https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm)), A trivial test case fails, I suspect precomputation of substring hashes routine is doing something wrong, because I tried replacing the precomputed value with the PolynomialHash function call ie. computing the hash of the substring in flight. I get the correct result with PolynomialHash function call but precomputed doesn't. What might have I done wrong here?

Algorithm pseudo code

1) Choose a large Prime p.
2) Let x be a random value in range [1, p-1].
3) Get the hash value for the pattern (p and x are used here).
4) For each substring which has length equal to the pattern compute the hash value of this substring.
5) If the hash values of pattern and the substring match then this substring could be a potential match, to ensure, check whether they are in fact the same.

The reason a good implementation should avoid using PolynomialHash is because the time complexity goes high, instead precomputing the Hash values for each substring is more efficient. So, my problem is the precomputed hashes, and the function call hash values don't match. Below is the relevant code and the failing testcase. Note the large prime I used is 1e9 + 7. ll is typedef for long long int.

bool AreEqual(const string &text,const string &pattern,int si,int ei){
    for(int i =0;i<pattern.size();i++){
        if(pattern[i]!=text[si+i]) return false;
    }
    return true;
}

ll PolynomialHash(const string &str,ll prime,ll x,int si,int ei){
    ll hash_val = 0;
    for(int i = ei;i>=si;i--) hash_val = (hash_val*x+str[i])%prime;
    return hash_val;
}

ll GetInt(const char &x){
    return x-'a';
}

void PrecomputeSubstringHashes(vector<ll> &substring_hashes,const string &text,const string &pattern,ll prime,ll x){
    int text_len = text.length();
    int pattern_len = pattern.length();
    substring_hashes[text_len-pattern_len] = PolynomialHash(text,prime,x,text_len-pattern_len,text_len-1);
    ll y = 1;
    for(int i =0;i<pattern_len;i++) y = (y*x)%prime; // can still be optimized to O(log(|P|))
    for(int i = text_len-pattern_len-1;i>=0;i--){
        substring_hashes[i] = (prime + substring_hashes[i+1]*x + GetInt(text[i]) - y*GetInt(text[i+pattern_len]))%prime;
    }
}

void RabinKarpSubstringSearch(const string &text,const string &pattern){
    vector<int>positions;
    ll prime = Mod; // This large prime used is 1e9 + 7
    ll x = 1 + rand()%prime;
    ll pattern_hash = PolynomialHash(pattern,prime,x,0,pattern.length()-1);
    assert(text.length()>=pattern.length());
    vector<ll>substring_hashes(text.length()-pattern.length()+1,0);
    PrecomputeSubstringHashes(substring_hashes,text,pattern,prime,x);
    for(int i =0;i<=text.length()-pattern.length();i++){
        ll substr_hash = substring_hashes[i]; // Try with PolynomialHash it gives correct results
        if(substr_hash!=pattern_hash) continue;
       // cout<<"Hitting at "<<i<<' '; // checking if expected and more indices [the wrong ones] hit this line.
        if(AreEqual(text,pattern,i,i+pattern.length()-1)) positions.push_back(i); /// The probablity of this condition being hit is too less thanks to a large prime number.
    }
    cout<<'\n';
    for(const int &x : positions) cout<<x<<' ';
}

// Test case

aab
abxaabbbaaab

PolynomialHash gives [3,9] as expected
substring_hashes[i] gives only [9]

I Did some further analysis I was right to suspect the Hash returned by Function and the precomputed values don't match. Here are both of them with input same as in the testcase. The Pattern Hash value is 850147133 seen at index 3 and 9 in Function hash.

// Function computed Hashes [index,HashValue]
0 45760133
1 921924329
2 423268806
3 **850147133**
4 654436503
5 654436504
6 227558154
7 423268784
8 423268783
9 **850147133**

// Precomputed Hashes [index,HashValue]
0 317287043
1 159209231
2 90628189
3 807191256
4 327387316
5 934623271
6 740231484
7 428758105
8 399604110
9 **850147133**


问:
PDF Print for HTML Page Text Ovelap Afte Recent Chrome Upgrade

A few of our customers have recently raised the issue that the pdfs that we are generating have overlapping text. This started happening after the latest chrome Version 108.0.5359.95 (Official Build) (64-bit) update.

Is there anyone facing the same issue? I am not very good at CSS so I am looking for any help.


问:
count nested array inside documen using updateOne() function
```<code>const reset_qr_list_and_update_count = await stock_read_log.updateOne(
    {
      payload: {$ne:req.body.payload},
      "qr_list.payload": req.body.new_qr_list[indexx].payload,
      company_id:req.body.company_id
    },
    {
      "$pull": {
            "qr_list": {
              payload: req.body.new_qr_list[indexx].payload
            }
          },
      $set:{
        qty: xx
      },
    }
    );
</code>```
```<code>  $set:{
        qty: model.aggreation({
//the query
}).count()
      },
</code>```

after pulling one of the list above,i want to re-count list left ,how can i achieve that within this function?

Body:
const reset_qr_list_and_update_count = await stock_read_log.updateOne(
    {
      payload: {$ne:req.body.payload},
      "qr_list.payload": req.body.new_qr_list[indexx].payload,
      company_id:req.body.company_id
    },
    {
      "$pull": {
            "qr_list": {
              payload: req.body.new_qr_list[indexx].payload
            }
          },
      $set:{
        qty: xx
      },
    }
    );

  $set:{
        qty: model.aggreation({
//the query
}).count()
      },

after pulling one of the list above,i want to re-count list left ,how can i achieve that within this function?


问:
How to get x-cache from header response in getServerSideProps in next.js
res.setHeaders is used to set cache in headers but how to get x-cache and other from headers?</p>


问:
How to enable TLSv1.3 in jdk 8 by default?
How to configure TLSv1.3 in java spring application?
Jdk 8 support 1.3 version of TLS and also has the backward compatibility.
Can anyone please help?</p>


问:
₹ symbol is getting stored as ? in mysql when trying to save it using orm
I want to save the text like this "₹300" in mysql. But when saving it using objects it is getting replaced with ?. Normal update works fine. I'm using java to do these operations.

The column is also configured as utf8mb4_unicode_ci. Is there any way to save exactly how the data is sent?


问:
django core exceptions ImproperlyConfigured:
I had my django up and running last night at around midnight, everything was kawa when i closed but in the morning when i open my pc i get django.core.exceptions.ImproperlyConfigured: error

!error

Note that only Django core commands are listed as settings are not properly configured (error: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.).

I tried closing the VScode and Terminal, reopened them, started virtualenvironment again but the error persists

\env\Scripts\python.exe: No module named django

I have django installed on the virtudal env as well as set as a global environment variable
thanks in advance

I expected python to get django installed on the virtual environment