问:
Different transitive dependency is imported using same dependency in different projects
I am importing google-maps-services dependency [version:2.0.0] in different projects, okhttp is the transitive dependency of google maps dependency.

Project-A

[INFO] com.webproject:google-map-spring-boot-starter:jar:0.0.1-SNAPSHOT
[INFO] \- com.google.maps:google-maps-services:jar:2.0.0:compile
[INFO]    +- com.squareup.okhttp3:okhttp:jar:4.9.3:compile
[INFO]    |  +- com.squareup.okio:okio:jar:2.8.0:compile
[INFO]    |  |  \- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.4.0:compile
[INFO]    |  \- org.jetbrains.kotlin:kotlin-stdlib:jar:1.4.10:compile
[INFO]    |     \- org.jetbrains:annotations:jar:13.0:compile
[INFO]    +- com.google.code.gson:gson:jar:2.8.9:compile
[INFO]    +- io.opencensus:opencensus-api:jar:0.30.0:compile
[INFO]    |  \- io.grpc:grpc-context:jar:1.27.2:compile
[INFO]    \- org.slf4j:slf4j-api:jar:1.7.33:runtime
```
<p>Project-B</p>
<pre class="lang-bash prettyprint-override"><code>[INFO] org.example:Dependency:jar:1.0-SNAPSHOT
[INFO] \- com.google.maps:google-maps-services:jar:2.0.0:compile
[INFO]    +- com.squareup.okhttp3:okhttp:jar:3.14.9:compile
[INFO]    |  \- com.squareup.okio:okio:jar:1.17.2:compile
[INFO]    +- com.google.code.gson:gson:jar:2.8.7:compile
[INFO]    +- io.opencensus:opencensus-api:jar:0.30.0:compile
[INFO]    |  \- io.grpc:grpc-context:jar:1.27.2:compile
[INFO]    \- org.slf4j:slf4j-api:jar:1.7.32:runtime
</code>```

As you can see different version of okhttp is there with the same version of google maps dependency in different projects.

How is this possible? I even removed the local repository multiple times, still its downloading different version of okhttp.

Project-A pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.webproject</groupId>
    <artifactId>google-map-spring-boot-starter</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>google-map-spring-boot-starter</name>
    <description>Starter</description>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.maps</groupId>
            <artifactId>google-maps-services</artifactId>
            <version>2.0.0</version>
        </dependency>

    </dependencies>
</project>
```
<p>Project-B pom.xml</p>
<pre class="lang-xml prettyprint-override"><code><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>Dependency</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>Dependency</name>
    <url>http://maven.apache.org</url>

    <properties>

    </properties>

        <dependency>
            <groupId>com.google.maps</groupId>
            <artifactId>google-maps-services</artifactId>
            <version>2.0.0</version>
        </dependency>
    </dependencies>
</project>
</code>```

Body:
I am importing google-maps-services dependency [version:2.0.0] in different projects, okhttp is the transitive dependency of google maps dependency.

Project-A

[INFO] com.webproject:google-map-spring-boot-starter:jar:0.0.1-SNAPSHOT
[INFO] \- com.google.maps:google-maps-services:jar:2.0.0:compile
[INFO]    +- com.squareup.okhttp3:okhttp:jar:4.9.3:compile
[INFO]    |  +- com.squareup.okio:okio:jar:2.8.0:compile
[INFO]    |  |  \- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.4.0:compile
[INFO]    |  \- org.jetbrains.kotlin:kotlin-stdlib:jar:1.4.10:compile
[INFO]    |     \- org.jetbrains:annotations:jar:13.0:compile
[INFO]    +- com.google.code.gson:gson:jar:2.8.9:compile
[INFO]    +- io.opencensus:opencensus-api:jar:0.30.0:compile
[INFO]    |  \- io.grpc:grpc-context:jar:1.27.2:compile
[INFO]    \- org.slf4j:slf4j-api:jar:1.7.33:runtime

Project-B

[INFO] org.example:Dependency:jar:1.0-SNAPSHOT
[INFO] \- com.google.maps:google-maps-services:jar:2.0.0:compile
[INFO]    +- com.squareup.okhttp3:okhttp:jar:3.14.9:compile
[INFO]    |  \- com.squareup.okio:okio:jar:1.17.2:compile
[INFO]    +- com.google.code.gson:gson:jar:2.8.7:compile
[INFO]    +- io.opencensus:opencensus-api:jar:0.30.0:compile
[INFO]    |  \- io.grpc:grpc-context:jar:1.27.2:compile
[INFO]    \- org.slf4j:slf4j-api:jar:1.7.32:runtime

As you can see different version of okhttp is there with the same version of google maps dependency in different projects.

How is this possible? I even removed the local repository multiple times, still its downloading different version of okhttp.

Project-A pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.webproject</groupId>
    <artifactId>google-map-spring-boot-starter</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>google-map-spring-boot-starter</name>
    <description>Starter</description>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.maps</groupId>
            <artifactId>google-maps-services</artifactId>
            <version>2.0.0</version>
        </dependency>

    </dependencies>
</project>

Project-B pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>Dependency</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>Dependency</name>
    <url>http://maven.apache.org</url>

    <properties>

    </properties>

        <dependency>
            <groupId>com.google.maps</groupId>
            <artifactId>google-maps-services</artifactId>
            <version>2.0.0</version>
        </dependency>
    </dependencies>
</project>


来源: stackexchange

问:
vscode on mac click the method show declaration in header instead of definition
when I use cmd+click about a method, it only shows its declaration instead of its definition. I suspect it is because my vscode did not detect Makefile? not sure. any ideas?

I expect the cmd + click to show the function's definition ( or definition and declaration

ContentLicense: CC BY-SA 4.0


问:
Golang - Socket server do not accept multiple client
I'm experimenting with creating a server socket that can accept multiple clients at the same time. But I have a problem handling the clients.
I checked and found that, after the server accepted 1 socket connection, it was not ready to accept further connections, even though I used Goroutines.
The incoming connection seems to hang, until it drops the connection. Only then can other client sockets connect

This is my socket server code

```<code>l, err := net.Listen("tcp", ":8081")
if err != nil {
   log.Fatal(err)
}
defer l.Close()
for {
   conn, err := l.Accept()
   if err != nil {
      log.Fatal(err)
   }

   go func(c net.Conn) {
      for {
         message, err := bufio.NewReader(conn).ReadString('\n')
         if err != nil {
            log.Printf("Error: %+v", err.Error())
            return
         }

         log.Println("Message:", string(message))
      }
   }(conn)
}
</code>```

Body:
I'm experimenting with creating a server socket that can accept multiple clients at the same time. But I have a problem handling the clients.
I checked and found that, after the server accepted 1 socket connection, it was not ready to accept further connections, even though I used Goroutines.
The incoming connection seems to hang, until it drops the connection. Only then can other client sockets connect

This is my socket server code

l, err := net.Listen("tcp", ":8081")
if err != nil {
   log.Fatal(err)
}
defer l.Close()
for {
   conn, err := l.Accept()
   if err != nil {
      log.Fatal(err)
   }

   go func(c net.Conn) {
      for {
         message, err := bufio.NewReader(conn).ReadString('\n')
         if err != nil {
            log.Printf("Error: %+v", err.Error())
            return
         }

         log.Println("Message:", string(message))
      }
   }(conn)
}


问:
riverplot on singlecell data gives the Error in edge_list[[nodes1[i]]]
I'm trying to create riverplot from two single-cell datasets, when I run the tutorial dataset it works but when I run my data I get the next error:

here is my code:

```<code>
library(riverplot)
library(Seurat)
library(rliger)

output_path = ".../Adipose/adipocytes/"
input_path= "..../Adipose/adipocytes/"

# pbmc.10x <- read.table(paste0(input_path,'vis_Gene_Count_per_Cell.tsv'),
#                        stringsAsFactors=F,header=T,row.names = 1)
# pbmc.seqwell <- read.table(paste0(input_path,'sub_Gene_Count_per_Cell.tsv'),
#                           stringsAsFactors=F,header=T,row.names = 1)

sub <- readRDS(paste0(input_path,'sub5_Asses_nodes.rds'))
sub <- RenameCells(sub, add.cell.id="subcutan")
# sub <- RunTSNE(sub)
vis <- readRDS(paste0(input_path,'vis_adipo10.rds'))
vis <- RenameCells(vis, add.cell.id="vis")

#pbmc.data = list(tenx=pbmc.10x, seqwell=pbmc.seqwell)
pbmc.data = list(tenx=sub@assays[["RNA"]]@counts, seqwell=vis@assays[["RNA"]]@counts)

a.pbmc <- createLiger(pbmc.data)
a.pbmc <- normalize(a.pbmc)
a.pbmc <- selectGenes(a.pbmc, var.thresh = c(0.3, 0.875), do.plot = F)
#
#s.var.genes <- readRDS('/Users/mayaziv/Downloads/pbmc_alignment/var_genes.RDS')
#a.pbmc@var.genes <- s.var.genes
a.pbmc <- scaleNotCenter(a.pbmc)
#k.suggest <- suggestK(a.pbmc, num.cores = 5, gen.new = T, plot.log2 = F,
#                     nrep = 5)
a.pbmc <- optimizeALS(a.pbmc, k=22, thresh = 5e-5, nrep = 3)
a.pbmc <- runTSNE(a.pbmc, use.raw = T)
p1 <- plotByDatasetAndCluster(a.pbmc, return.plots = T)
# Plot by dataset
print(p1[[1]])
a.pbmc <- quantileAlignSNF(a.pbmc, resolution = 0.4, small.clust.thresh = 20)

clusters_prior <- readRDS(paste0(input_path,'com_cluster.RDS'))
tenx_c <- droplevels(clusters_prior[rownames(a.pbmc@H[[1]])])
seqwell_c <- droplevels(clusters_prior[rownames(a.pbmc@H[[2]])])
# Set specific node order for cleaner visualization (can also leave to default value for
# automatic ordering)

makeRiverplot(a.pbmc, tenx_c, seqwell_c, min.frac = 0.05,
              river.usr = c(0, 1, -0.6, 1.6))
</code>```

and the error is:

```<code>Error in edge_list[[nodes1[i]]] <- temp :
  attempt to select less than one element in OneIndex
</code>```

does anyone have an idea why this error is occurring?

Thanks!

I wanted to get a riverplot that matches between the clusters from the two single cell datasets.

I keep getting this error://

Body:
I'm trying to create riverplot from two single-cell datasets, when I run the tutorial dataset it works but when I run my data I get the next error:

here is my code:

library(riverplot)
library(Seurat)
library(rliger)

output_path = ".../Adipose/adipocytes/"
input_path= "..../Adipose/adipocytes/"

# pbmc.10x <- read.table(paste0(input_path,'vis_Gene_Count_per_Cell.tsv'),
#                        stringsAsFactors=F,header=T,row.names = 1)
# pbmc.seqwell <- read.table(paste0(input_path,'sub_Gene_Count_per_Cell.tsv'),
#                           stringsAsFactors=F,header=T,row.names = 1)

sub <- readRDS(paste0(input_path,'sub5_Asses_nodes.rds'))
sub <- RenameCells(sub, add.cell.id="subcutan")
# sub <- RunTSNE(sub)
vis <- readRDS(paste0(input_path,'vis_adipo10.rds'))
vis <- RenameCells(vis, add.cell.id="vis")

#pbmc.data = list(tenx=pbmc.10x, seqwell=pbmc.seqwell)
pbmc.data = list(tenx=sub@assays[["RNA"]]@counts, seqwell=vis@assays[["RNA"]]@counts)

a.pbmc <- createLiger(pbmc.data)
a.pbmc <- normalize(a.pbmc)
a.pbmc <- selectGenes(a.pbmc, var.thresh = c(0.3, 0.875), do.plot = F)
#
#s.var.genes <- readRDS('/Users/mayaziv/Downloads/pbmc_alignment/var_genes.RDS')
#a.pbmc@var.genes <- s.var.genes
a.pbmc <- scaleNotCenter(a.pbmc)
#k.suggest <- suggestK(a.pbmc, num.cores = 5, gen.new = T, plot.log2 = F,
#                     nrep = 5)
a.pbmc <- optimizeALS(a.pbmc, k=22, thresh = 5e-5, nrep = 3)
a.pbmc <- runTSNE(a.pbmc, use.raw = T)
p1 <- plotByDatasetAndCluster(a.pbmc, return.plots = T)
# Plot by dataset
print(p1[[1]])
a.pbmc <- quantileAlignSNF(a.pbmc, resolution = 0.4, small.clust.thresh = 20)

clusters_prior <- readRDS(paste0(input_path,'com_cluster.RDS'))
tenx_c <- droplevels(clusters_prior[rownames(a.pbmc@H[[1]])])
seqwell_c <- droplevels(clusters_prior[rownames(a.pbmc@H[[2]])])
# Set specific node order for cleaner visualization (can also leave to default value for
# automatic ordering)

makeRiverplot(a.pbmc, tenx_c, seqwell_c, min.frac = 0.05,
              river.usr = c(0, 1, -0.6, 1.6))

and the error is:

Error in edge_list[[nodes1[i]]] <- temp :
  attempt to select less than one element in OneIndex

does anyone have an idea why this error is occurring?

Thanks!

I wanted to get a riverplot that matches between the clusters from the two single cell datasets.

I keep getting this error://


问:
AWS ECR Scanner finds no vulnerability in alpine image
I'm using ECR Image Scanning to scan docker image. When I select python:3.10.9-slim as base image I find the following result:

```<code>Vulnerabilities found:
  1 Critical
  7 High
 25 Medium
 12 Low
145 Informational
 56 Undefined
=================
246 Total
</code>```

It seems normal(to me atleast). As some of issues came from the linux kernel, which I'm assuming because of the host server.(As described here)

But when I select 3.10.4-alpine3.14 as base image, the scanner gives the following output:

```<code>Findings
Vulnerabilities found:
  0 Critical
  0 High
  0 Medium
  0 Low
  0 Informational
  0 Undefined
=================
  0 Total
</code>```

Is it normal not finding any vulnerability? At least I was expecting some vulnerability from the host server's kernel(as with python:3.10.9-slim). I also tried with some other version of python-alpine image, but got the same result. Is there any issue with the alpine image?

Thanks.

Body:
I'm using ECR Image Scanning to scan docker image. When I select python:3.10.9-slim as base image I find the following result:

Vulnerabilities found:
  1 Critical
  7 High
 25 Medium
 12 Low
145 Informational
 56 Undefined
=================
246 Total

It seems normal(to me atleast). As some of issues came from the linux kernel, which I'm assuming because of the host server.(As described here)

But when I select 3.10.4-alpine3.14 as base image, the scanner gives the following output:

Findings
Vulnerabilities found:
  0 Critical
  0 High
  0 Medium
  0 Low
  0 Informational
  0 Undefined
=================
  0 Total

Is it normal not finding any vulnerability? At least I was expecting some vulnerability from the host server's kernel(as with python:3.10.9-slim). I also tried with some other version of python-alpine image, but got the same result. Is there any issue with the alpine image?

Thanks.


问:
Razor page [CRUD] (Field is not creating in 3rd model) 2 foreign model field is present in the third model
I have 3 models

1.Doctor
2.Patient
3.Appointment

In Doctor Model

```<code>using System.ComponentModel.DataAnnotations;
namespace DoctorAppointmentSystem.Models
{
    public class Doctor
    {
        public int DoctorId { get; set; }
        public string? DoctorName { get; set; }
        public string? Consultant { get; set; }
    }
}

</code>```

In Patient Model

```<code>
using System.ComponentModel.DataAnnotations;
namespace DoctorAppointmentSystem.Models
{
    public class Patient
    {
        public int PatientId { get; set; }
        public string? PatientName { get; set; }
        public string? PatientAddress { get; set; }
        public string? PatientPhone { get; set; }
    }
}

</code>```

In Appointment Model

```<code>using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using DoctorAppointmentSystem.Models;
namespace DoctorAppointmentSystem.Models
{
    public class Appointment
    {
        [Key]
        [Required]
        public int Id { get; set; }
        [DataType(DataType.Date)]
        public DateTime ReleaseDate { get; set; }

        public int DoctorId { get; set; }
        public int PatientId { get; set; }

        [ForeignKey(nameof(PatientId))]
        public Patient patient { get; set; }

        [ForeignKey(nameof(DoctorId))]

        public Doctor doctor { get; set;}
    }
}

</code>```

I wanted to create 2 dropdown in Appointment model 1 from doctor another from patient
Everything is created but the field is not creating in Appointment model

Appointment/Create

When I hit create all the fields go blank and it's not creating

I tried to create the third model with the fields of 1st and 2nd model. Everything is created fine but the field is not generating. NOTE: ITS NOT in MVC Format only using models and views

Body:
I have 3 models

1.Doctor
2.Patient
3.Appointment

In Doctor Model

using System.ComponentModel.DataAnnotations;
namespace DoctorAppointmentSystem.Models
{
    public class Doctor
    {
        public int DoctorId { get; set; }
        public string? DoctorName { get; set; }
        public string? Consultant { get; set; }
    }
}

In Patient Model

using System.ComponentModel.DataAnnotations;
namespace DoctorAppointmentSystem.Models
{
    public class Patient
    {
        public int PatientId { get; set; }
        public string? PatientName { get; set; }
        public string? PatientAddress { get; set; }
        public string? PatientPhone { get; set; }
    }
}

In Appointment Model

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using DoctorAppointmentSystem.Models;
namespace DoctorAppointmentSystem.Models
{
    public class Appointment
    {
        [Key]
        [Required]
        public int Id { get; set; }
        [DataType(DataType.Date)]
        public DateTime ReleaseDate { get; set; }

        public int DoctorId { get; set; }
        public int PatientId { get; set; }

        [ForeignKey(nameof(PatientId))]
        public Patient patient { get; set; }

        [ForeignKey(nameof(DoctorId))]

        public Doctor doctor { get; set;}
    }
}

I wanted to create 2 dropdown in Appointment model 1 from doctor another from patient
Everything is created but the field is not creating in Appointment model

Appointment/Create

When I hit create all the fields go blank and it's not creating

I tried to create the third model with the fields of 1st and 2nd model. Everything is created fine but the field is not generating. NOTE: ITS NOT in MVC Format only using models and views


问:
No Attribute Called GroupDMChannel
I’m trying to get messages from a discord GroupDM on a user account I’ve used the module discord.DMChannel and have gotten the instances in normal one on one dm’s but I can’t seem to find the attribute for group dms

```<code>async def on_message(self, message):
        if isinstance(message.channel, discord.DMChannel, discord.GROUPDMChannel):
          if message.author.id != self.user.id and message.author.id == UserID:
            await message.reply(replyMessage)
            print('Replied to %s.' % message.author.name)
</code>```

I’ve tried GroupDMChannel, discord.abc.GroupDMChannel and a few other things if anyone can help that would be appreciated!

Title: No Attribute Called GroupDMChannel

Body:
I’m trying to get messages from a discord GroupDM on a user account I’ve used the module discord.DMChannel and have gotten the instances in normal one on one dm’s but I can’t seem to find the attribute for group dms

async def on_message(self, message):
        if isinstance(message.channel, discord.DMChannel, discord.GROUPDMChannel):
          if message.author.id != self.user.id and message.author.id == UserID:
            await message.reply(replyMessage)
            print('Replied to %s.' % message.author.name)

I’ve tried GroupDMChannel, discord.abc.GroupDMChannel and a few other things if anyone can help that would be appreciated!


问:
Unable to login to AWS EC2 instance
My AWS EC2 instance (20.04 LTS) created using laravel suddenly got down and I am unable to login with ssh. I stop the instance and started again several times, but still it is showing the error attached. So I cannot use the server. For time being I have recreated a new instance, but I like to know what could be the possible issue. Please let me know how can reuse the instance

Also, as my AWS plan does not support for "Technical Support", I don't know how to contact to AWS. Pleas let me know if anyone knows how can I contact for such issue.

Attached screenshot for your reference:

Title: Unable to login to AWS EC2 instance


问:
data-popup: lightbox cant popup with error (Not allowed to navigate top frame to data URL: data:image/jpeg;base64)
my table with the picture
.. I have a problem, my image won't appear in the popup, i use data-popup:lightbox.
My code:

```<code><td>
  <a href="${data.trRadFoto}" data-popup="lightbox">
     <img src="${data.trRadFoto}" width="50px" alt="" class="img-preview rounded">
  </a>
</td>
</code>```

i got an error:

Not allowed to navigate top frame to data URL: data:image/jpeg;base64,

Body:
my table with the picture
.. I have a problem, my image won't appear in the popup, i use data-popup:lightbox.
My code:

i got an error:

Not allowed to navigate top frame to data URL: data:image/jpeg;base64,


问:
Heroku Premature Termination Of My Free Dynos
I was using Heroku for free to demo some of my applications which didn't have many users. I received the notice that the free dynos are going to be terminated on April 30th, 2023. I recently made a new deployment for one of my applications and found that the free dynos are terminated for this app with the option to only subscribe for paid dynos.

Has anybody faced the same issue? Can I return to free dyno usage just till the end of the notice period?


问:
How can I add Google Drive video embed/ iframe in CMB2
I am using wordpress theme. Here I can upload video, add youtube link but I can not add google drive link. I ask theme developer, they tell me I can upload here only mp4 extension video.

He Add this function with CMB2 meta box. Here is the code:

```<code>$video->add_field( array(
        'name'    => 'Video File',
        'desc'    => 'Upload a video or enter an URL.',
        'id'      => 'video_file',
        'type'    => 'file',
        'options' => array(
            'url' => true,
        ),
        'text'    => array(
            'add_upload_file_text' => 'Add Video'
        ),

        'query_args' => array(
            'type' => array(
                'video/mp4',
                'video/mpeg',
                'video/H264',
            ),
        ),
        'preview_size' => 'large',
    ) );
</code>```

Can I add google drive link with add any option here?

I try with

```<code>'type'    => 'wysiwyg',
</code>```

Here I can add google drive embed link and it's play perfactly. But I can't add m3u8 and server video here. I can not upload video in this file type:
Here is the code: `

```<code>$video->add_field( array(
        'name'    => 'Video File',
        'desc'    => 'Upload a video or enter an URL.',
        'id'      => 'video_file',
        'type'    => 'wysiwyg',
        'sanitization_cb' => false,
        'options' => array(
            'wpautop' => true,
            'textarea_rows' => get_option('default_post_edit_rows', 5),
        ),

        'text'    => array(
            'add_upload_file_text' => 'Add Video'
        ),
        'preview_size' => 'large',
    ) );
</code>```

`

Body:
I am using wordpress theme. Here I can upload video, add youtube link but I can not add google drive link. I ask theme developer, they tell me I can upload here only mp4 extension video.

He Add this function with CMB2 meta box. Here is the code:

$video->add_field( array(
        'name'    => 'Video File',
        'desc'    => 'Upload a video or enter an URL.',
        'id'      => 'video_file',
        'type'    => 'file',
        'options' => array(
            'url' => true,
        ),
        'text'    => array(
            'add_upload_file_text' => 'Add Video'
        ),

        'query_args' => array(
            'type' => array(
                'video/mp4',
                'video/mpeg',
                'video/H264',
            ),
        ),
        'preview_size' => 'large',
    ) );

Can I add google drive link with add any option here?

I try with

'type'    => 'wysiwyg',

Here I can add google drive embed link and it's play perfactly. But I can't add m3u8 and server video here. I can not upload video in this file type:
Here is the code: `

$video->add_field( array(
        'name'    => 'Video File',
        'desc'    => 'Upload a video or enter an URL.',
        'id'      => 'video_file',
        'type'    => 'wysiwyg',
        'sanitization_cb' => false,
        'options' => array(
            'wpautop' => true,
            'textarea_rows' => get_option('default_post_edit_rows', 5),
        ),

        'text'    => array(
            'add_upload_file_text' => 'Add Video'
        ),
        'preview_size' => 'large',
    ) );

`


问:
elastic_transport.ConnectionError: Connection error caused by: ConnectionError(Connection error) error code=61
In my python script, first I connected with elasticsearch through elasticSearch class, and I'm fetching data using search in es object;

it is throwing errors like:

```<code>elastic_transport.ConnectionError: Connection error caused by: ConnectionError(Connection error caused by: NewConnectionError(<urllib3.connection.HTTPSConnection object at 0x10654d420>: Failed to establish a new connection: [Errno 61] Connection refused))
</code>```

I have tried:

```<code>from elasticsearch import Elasticsearch
import json
with open("cred.txt","r") as f:
    user,passw=f.readline().split("-")

es = Elasticsearch(['<hostname>:9200'], basic_auth=(user, passw))
doc1 = {
  "aggs": {
    "keys": {
      "terms": {
        "field": "kubernetes.container_name"
        , "size": 600
      }
    }
  },
  "size": 0
}
print(es.info)
res1 = es.search(index="<index-name>", body=doc1)
print(res1)
</code>```

print(es.info) working fine but on line es.search throws error:

```<code>File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elasticsearch/_sync/client/utils.py", line 414, in wrapped
    return api(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elasticsearch/_sync/client/__init__.py", line 3770, in search
    return self.perform_request(  # type: ignore[return-value]
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elasticsearch/_sync/client/_base.py", line 286, in perform_request
    meta, resp_body = self.transport.perform_request(
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elastic_transport/_transport.py", line 329, in perform_request
    meta, raw_data = node.perform_request(
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elastic_transport/_node/_http_urllib3.py", line 199, in perform_request
    raise err from None
elastic_transport.ConnectionError: Connection error caused by: ConnectionError(Connection error caused by: NewConnectionError(<urllib3.connection.HTTPSConnection object at 0x10654d420>: Failed to establish a new connection: [Errno 61] Connection refused))
</code>```

Body:
In my python script, first I connected with elasticsearch through elasticSearch class, and I'm fetching data using search in es object;

it is throwing errors like:

elastic_transport.ConnectionError: Connection error caused by: ConnectionError(Connection error caused by: NewConnectionError(<urllib3.connection.HTTPSConnection object at 0x10654d420>: Failed to establish a new connection: [Errno 61] Connection refused))

I have tried:

from elasticsearch import Elasticsearch
import json
with open("cred.txt","r") as f:
    user,passw=f.readline().split("-")

es = Elasticsearch(['<hostname>:9200'], basic_auth=(user, passw))
doc1 = {
  "aggs": {
    "keys": {
      "terms": {
        "field": "kubernetes.container_name"
        , "size": 600
      }
    }
  },
  "size": 0
}
print(es.info)
res1 = es.search(index="<index-name>", body=doc1)
print(res1)

print(es.info) working fine but on line es.search throws error:

File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elasticsearch/_sync/client/utils.py", line 414, in wrapped
    return api(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elasticsearch/_sync/client/__init__.py", line 3770, in search
    return self.perform_request(  # type: ignore[return-value]
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elasticsearch/_sync/client/_base.py", line 286, in perform_request
    meta, resp_body = self.transport.perform_request(
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elastic_transport/_transport.py", line 329, in perform_request
    meta, raw_data = node.perform_request(
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elastic_transport/_node/_http_urllib3.py", line 199, in perform_request
    raise err from None
elastic_transport.ConnectionError: Connection error caused by: ConnectionError(Connection error caused by: NewConnectionError(<urllib3.connection.HTTPSConnection object at 0x10654d420>: Failed to establish a new connection: [Errno 61] Connection refused))


问:
How to implement Search API for XML
Scenario: I'm working on creating Search API in .NET6 will search XML data. This XML data exists in the table's specific column named ExtensionData only.

Initially, I thought to use ODATA as it seem the best choice for it. But while working discovered that the EnableQuery works well only with IQueryable as it comes into play before the response is about to be sent to the user. I even thought of using ODataQueryOptions but it also requires a model with fixed properties. Since for varying XML I can't have the model, it doesn't seem possible.

Later I thought to use GraphQL for the requirement. But the core requirement for it is schema which means it also needs a fixed data structure. Hence, I cannot use GraphQL.

My Efforts: I have written POC for implementing like this

In SearchController, the ActionResult is

```<code>[EnableQuery]
    [HttpGet("applications/FirstName")]
    [HttpGet("applications/LastName")]
    public IActionResult GetApplications()
    {
        var propertyToGet = new Uri(HttpContext.Request.GetEncodedUrl()).Segments.Last();

        var propertyExist = _extAppService.IsPropertyExist(propertyToGet);
        if (!propertyExist)
            return NotFound();

        var dataTable = _extAppService.SearchProperty(propertyToGet);
        if (dataTable.Rows.Count <= 0)
            return NoContent();

        return Ok(dataTable);
    }
</code>```

And the methods in Service class is like:

```<code>public DataTable SearchProperty(string propName)
    {
        // TODO: Find way of creating IQueryable and then applying ODATA filter to same

        var rootNodes = _repository.GetRootNodes();
        var searchResults = new DataTable();
        var columnsSet = false;

        foreach (var rootNode in rootNodes)
        {
            var dataTable = SearchPropertyInNode(propName, rootNode);

            if (!columnsSet)
            {
                searchResults = dataTable.Clone();
                columnsSet = true;
            }

            CopyRowsToTable(dataTable, searchResults);
        }

        return searchResults;
    }

    private DataTable SearchPropertyInNode(string propName, string node)
    {
        var sql = $"SELECT X.Y.value('(//{propName})[1]', 'VARCHAR(MAX)') AS {propName}" +
                  " FROM application a" +
                  $" OUTER APPLY a.ExtensionData.nodes('{node}') as X(Y)"+
                  $" WHERE X.Y.value('(//{propName})[1]', 'VARCHAR(MAX)') <> ''";

        return _repository.ExecuteSql(CommandType.Text, sql);
    }

    private static void CopyRowsToTable(DataTable source, DataTable destination)
    {
        for (var i = 0; i < source.Rows.Count; i++)
        {
            destination.Rows.Add(source.Rows[i].ItemArray);
        }
    }
</code>```

But this way, I'll require to create a lot of routes for each properties or nodes. To me, it doesn't seem a good way. And still, I can't control more than one property.

Question: Now, I'm not sure how else to implement the Search API. Or it might be that I'm not thinking clearly. Do you have any suggestions for me?

Title: How to implement Search API for XML

Body:
Scenario: I'm working on creating Search API in .NET6 will search XML data. This XML data exists in the table's specific column named ExtensionData only.

Initially, I thought to use ODATA as it seem the best choice for it. But while working discovered that the EnableQuery works well only with IQueryable as it comes into play before the response is about to be sent to the user. I even thought of using ODataQueryOptions but it also requires a model with fixed properties. Since for varying XML I can't have the model, it doesn't seem possible.

Later I thought to use GraphQL for the requirement. But the core requirement for it is schema which means it also needs a fixed data structure. Hence, I cannot use GraphQL.

My Efforts: I have written POC for implementing like this

In SearchController, the ActionResult is

[EnableQuery]
    [HttpGet("applications/FirstName")]
    [HttpGet("applications/LastName")]
    public IActionResult GetApplications()
    {
        var propertyToGet = new Uri(HttpContext.Request.GetEncodedUrl()).Segments.Last();

        var propertyExist = _extAppService.IsPropertyExist(propertyToGet);
        if (!propertyExist)
            return NotFound();

        var dataTable = _extAppService.SearchProperty(propertyToGet);
        if (dataTable.Rows.Count <= 0)
            return NoContent();

        return Ok(dataTable);
    }

And the methods in Service class is like:

public DataTable SearchProperty(string propName)
    {
        // TODO: Find way of creating IQueryable and then applying ODATA filter to same

        var rootNodes = _repository.GetRootNodes();
        var searchResults = new DataTable();
        var columnsSet = false;

        foreach (var rootNode in rootNodes)
        {
            var dataTable = SearchPropertyInNode(propName, rootNode);

            if (!columnsSet)
            {
                searchResults = dataTable.Clone();
                columnsSet = true;
            }

            CopyRowsToTable(dataTable, searchResults);
        }

        return searchResults;
    }

    private DataTable SearchPropertyInNode(string propName, string node)
    {
        var sql = $"SELECT X.Y.value('(//{propName})[1]', 'VARCHAR(MAX)') AS {propName}" +
                  " FROM application a" +
                  $" OUTER APPLY a.ExtensionData.nodes('{node}') as X(Y)"+
                  $" WHERE X.Y.value('(//{propName})[1]', 'VARCHAR(MAX)') <> ''";

        return _repository.ExecuteSql(CommandType.Text, sql);
    }

    private static void CopyRowsToTable(DataTable source, DataTable destination)
    {
        for (var i = 0; i < source.Rows.Count; i++)
        {
            destination.Rows.Add(source.Rows[i].ItemArray);
        }
    }

But this way, I'll require to create a lot of routes for each properties or nodes. To me, it doesn't seem a good way. And still, I can't control more than one property.

Question: Now, I'm not sure how else to implement the Search API. Or it might be that I'm not thinking clearly. Do you have any suggestions for me?


问:
How to redirect from domain to local server?
Here is what I want to implement on DigitalOcean. It uses Apache2 server.
enter image description here
As result, it means https://api.server.com/webhook → http://localhost:3002/webhook on Node server.
Please guide me how to implement.
Thank you in advance.

I made a domain conf file in etc/apache2/sites-available, and then I enabled it.

```<code><VirtualHost *:443>
    ProxyPreserveHost On

        # Servers to proxy the connection, or;
        # List of application servers:
        # Usage:
        # ProxyPass / http://[IP Addr.]:[port]/
        # ProxyPassReverse / http://[IP Addr.]:[port]/
        # Example:
    ProxyPass / http://localhost:3002/
    ProxyPassReverse / http://localhost:3002/

    ServerName astechbot.com.tr
</VirtualHost>
</code>```

And I sent the request to domain, but it's not redirected to localhost:3002 (node server).
What is the solution?

Body:
Here is what I want to implement on DigitalOcean. It uses Apache2 server.
enter image description here
As result, it means https://api.server.com/webhook → http://localhost:3002/webhook on Node server.
Please guide me how to implement.
Thank you in advance.

I made a domain conf file in etc/apache2/sites-available, and then I enabled it.

<VirtualHost *:443>
    ProxyPreserveHost On

        # Servers to proxy the connection, or;
        # List of application servers:
        # Usage:
        # ProxyPass / http://[IP Addr.]:[port]/
        # ProxyPassReverse / http://[IP Addr.]:[port]/
        # Example:
    ProxyPass / http://localhost:3002/
    ProxyPassReverse / http://localhost:3002/

    ServerName astechbot.com.tr
</VirtualHost>

And I sent the request to domain, but it's not redirected to localhost:3002 (node server).
What is the solution?


问:
Kotlin Jetpack Compose Unidirectional flow for Location Service
It's not really a problem but a question, the question is about the flow of getting the location of users, in all respect for MVVM design

I have 4 files

Location Repository

Location Repository Implementation

Location View Model

Location Composable

My current flow right now is:

Composable will ask for permission

If that is granted, trigger a function in view model then calls and listen to the repository

Location Repository Implementation will implement the Repository function and get the data from a location callback.

view model will listen and update the state every time the location repository sends data.

Composable will reflect the state.

Right now it's working but configuration changes are not yet handled as the composable permission I'm using is from Accompanist Package rememberMultiplePermissionsState which won't survive, recomposing the view which leads to relaunching the tracker, but that's outside of the matter.

What I expect is the correct way of handling location track. I handled it the same way as I'm dealing with collecting JSON data from the web, so it might be wrong.


问:
Why react application has extra render in chrome browser and I avoided <StrictMode> also but render extra
I have developed small react application and run in different browsers.

NOTE: I never used StrictMode

Chrome browser render 3 times

firefox browser render 2 times

Brave browser render 2 times

Code,

```<code>import { useEffect, useReducer, useRef } from "react";

function TestComponent() {
const [renderId, forceUpdate] = useReducer((x) => x + 1, 0);

let renderCount = useRef(0);
renderCount.current = renderCount.current + 1;
console.info("*** Rnder Called ***  " + renderCount.current);

useEffect(() => {
setTimeout(() => {
  forceUpdate();
 }, 2000);
}, [forceUpdate]);

return (
 <>
  <p>Welcome</p>
 </>
 );
}

export default TestComponent;
</code>```

App.tsx file,

```<code>import "./App.css";
import TestComponent from "./UseReducerComponent/test";

export default function App() {
  console.log("APP CALLED @@@@");

return (
 <div className="parent_div">
   <h1>React Project</h1>
   <TestComponent />
 </div>
 );
}
</code>```

index.tsx file,

```<code>import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";

const root = ReactDOM.createRoot(
  document.getElementById("root") as HTMLElement
 );
root.render(<App />);

reportWebVitals();
</code>```

In Chrome browser,

In Firefox and Brave browser respectively

Anyone explain why it's happen

Thank you.

Body:
I have developed small react application and run in different browsers.

NOTE: I never used StrictMode

Chrome browser render 3 times

firefox browser render 2 times

Brave browser render 2 times

Code,

import { useEffect, useReducer, useRef } from "react";

function TestComponent() {
const [renderId, forceUpdate] = useReducer((x) => x + 1, 0);

let renderCount = useRef(0);
renderCount.current = renderCount.current + 1;
console.info("*** Rnder Called ***  " + renderCount.current);

useEffect(() => {
setTimeout(() => {
  forceUpdate();
 }, 2000);
}, [forceUpdate]);

return (
 <>

Welcome

 </>
 );
}

export default TestComponent;

App.tsx file,

import "./App.css";
import TestComponent from "./UseReducerComponent/test";

export default function App() {
  console.log("APP CALLED @@@@");

return (

React Project

   <TestComponent />

 );
}

index.tsx file,

import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";

const root = ReactDOM.createRoot(
  document.getElementById("root") as HTMLElement
 );
root.render(<App />);

reportWebVitals();

In Chrome browser,

In Firefox and Brave browser respectively

Anyone explain why it's happen

Thank you.


问:
How to run Jenkins pipeline with Jenkinsfile script?
```<code>node('Docker3') {
    try {
        cleanWs()
        wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
            git branch: "${params.branch}", url: "${params.scmUrl}"
            gitCommitHash = sh(script: "git log -n 1 --pretty=format:'%H'", returnStdout: true)
            load("jenkins_modules/moduleMain.groovy")
        }
    } catch (all) {
        print(all)
    }
}
</code>```

I have this code which I am using in jenkinsfile. But I want to schedule jenkins job from script. Can anyone please help me to tell how can I use that above code with,this following code.

```<code>pipeline {
    agent any
    triggers {
        cron('H * * * *')
    }
    stages {
        stage('Example') {
            steps {
                echo 'Hello World'
            }
        }
    }
}
</code>```

I tried above code like this following way,

```<code>**pipeline {
    agent any
    triggers {
        cron('H */4 * * 1-5')
    }
    stages {
        stage('Example') {
            steps {
                echo 'Hello World'
            }
        }
   }
}
node('Docker3') {
    try {
        cleanWs()
        wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
            git branch: "${params.branch}", url: "${params.scmUrl}"
            gitCommitHash = sh(script: "git log -n 1 --pretty=format:'%H'", returnStdout: true)
            load("jenkins_modules/moduleMain.groovy")
        }
    } catch (all) {
        print(all)
    }
}**
</code>```

it is working, but i dont think so it is correct way.

Body:
node('Docker3') {
    try {
        cleanWs()
        wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
            git branch: "${params.branch}", url: "${params.scmUrl}"
            gitCommitHash = sh(script: "git log -n 1 --pretty=format:'%H'", returnStdout: true)
            load("jenkins_modules/moduleMain.groovy")
        }
    } catch (all) {
        print(all)
    }
}

I have this code which I am using in jenkinsfile. But I want to schedule jenkins job from script. Can anyone please help me to tell how can I use that above code with,this following code.

pipeline {
    agent any
    triggers {
        cron('H * * * *')
    }
    stages {
        stage('Example') {
            steps {
                echo 'Hello World'
            }
        }
    }
}

I tried above code like this following way,

**pipeline {
    agent any
    triggers {
        cron('H */4 * * 1-5')
    }
    stages {
        stage('Example') {
            steps {
                echo 'Hello World'
            }
        }
   }
}
node('Docker3') {
    try {
        cleanWs()
        wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
            git branch: "${params.branch}", url: "${params.scmUrl}"
            gitCommitHash = sh(script: "git log -n 1 --pretty=format:'%H'", returnStdout: true)
            load("jenkins_modules/moduleMain.groovy")
        }
    } catch (all) {
        print(all)
    }
}**

it is working, but i dont think so it is correct way.


问:
Remove controller and method from URL Path in .Net Core 6.0
Could any one please help me out with situation.

I have project whereby I want to remove each Controller and Method from my url path every time i request.
example right now my every time url looks like below

www.mywebsite.com/Account/View

but i want to remove /Account/View from url


问:
How to get the mesh(vertex and index buffers) from the object I obtained from the method `getRenderProxy` in Node.js?
I want to obtain the mesh from the object I obtain from calling getRenderProxy method in node.js. This is my implementation, where I pass an ObjectID from the model tree:

```<code>function getMeshByDbID(dbID) {
var instanceTree = getInstanceTree();

var meshes = [];
let fragIds = [];
instanceTree.enumNodeFragments(
  dbID,
  function (fragId) {
    fragIds.push(fragId);

  },
  true
);
console.log(fragIds);
fragIds.forEach(function(fragId){
    var mesh = window.NOP_VIEWER.impl.getRenderProxy(
        window.NOP_VIEWER.model,
        fragId);
    meshes.push(mesh);

})

return meshes;
</code>```

}

I get an object, as shown below.

But whenever I try to extract geometry(by calling mesh.geometry) from this object, I get undefined. The structure of geometry object within the above object is as follows:

I want to get the mesh, specifically, the ib and vb arrays in the figure above for performing calculations. Any help is appreciated.

Outputs of console.log of RenderProxy.geometry.vb for three different runs, This should not be possible:

Body:
I want to obtain the mesh from the object I obtain from calling getRenderProxy method in node.js. This is my implementation, where I pass an ObjectID from the model tree:

function getMeshByDbID(dbID) {
var instanceTree = getInstanceTree();

var meshes = [];
let fragIds = [];
instanceTree.enumNodeFragments(
  dbID,
  function (fragId) {
    fragIds.push(fragId);

  },
  true
);
console.log(fragIds);
fragIds.forEach(function(fragId){
    var mesh = window.NOP_VIEWER.impl.getRenderProxy(
        window.NOP_VIEWER.model,
        fragId);
    meshes.push(mesh);

})

return meshes;

}

I get an object, as shown below.

But whenever I try to extract geometry(by calling mesh.geometry) from this object, I get undefined. The structure of geometry object within the above object is as follows:

I want to get the mesh, specifically, the ib and vb arrays in the figure above for performing calculations. Any help is appreciated.

Outputs of console.log of RenderProxy.geometry.vb for three different runs, This should not be possible:


问:
How to update `flutter_pdfview` package pdf
I'm using the flutter_pdfview package to display a pdf in my app.

But when I change the pdf it doesn't change. So I succeeded in updating using the key value.

But this only works in debug mode and not in release mode.

```<code>Consumer<PDFProvider>(
            builder: (context, pdf, child){
              return PDFView(
                key: ValueKey(pdf.keyCount),
                pdfData: pdf.uinPdfData!,
                enableSwipe: true,
                swipeHorizontal: true,
                autoSpacing: false,
                pageFling: false,
                defaultPage: 0,
                onRender: (_pages) {
                  setState(() {
                    isReady = true;
                  });
                },
                onError: (error) {
                  print(error.toString());
                },
                onPageError: (page, error) {
                  print('$page: ${error.toString()}');
                },
                // onViewCreated: (PDFViewController pdfViewController) {
                //   _controller.complete(pdfViewController);
                // },
                onPageChanged: (int? page, int? total) {
                  setState(() {
                    nPageIndex = page! + 1;
                  });
                },
              );
            },
          ),
</code>```

pdfData is changed when updating, and the key value is increased by 1 whenever pdf is changed.

In debug mode, if the pdf is changed, the key value increases and the pdf is immediately changed. In release mode, the key value increases and the pdf data is changed, but the UI is not rebuilt. When the page is changed, it is rebuilt while triggering setState due to onPageChanged. Any idea how to fix it?

Body:
I'm using the flutter_pdfview package to display a pdf in my app.

But when I change the pdf it doesn't change. So I succeeded in updating using the key value.

But this only works in debug mode and not in release mode.

Consumer<PDFProvider>(
            builder: (context, pdf, child){
              return PDFView(
                key: ValueKey(pdf.keyCount),
                pdfData: pdf.uinPdfData!,
                enableSwipe: true,
                swipeHorizontal: true,
                autoSpacing: false,
                pageFling: false,
                defaultPage: 0,
                onRender: (_pages) {
                  setState(() {
                    isReady = true;
                  });
                },
                onError: (error) {
                  print(error.toString());
                },
                onPageError: (page, error) {
                  print('$page: ${error.toString()}');
                },
                // onViewCreated: (PDFViewController pdfViewController) {
                //   _controller.complete(pdfViewController);
                // },
                onPageChanged: (int? page, int? total) {
                  setState(() {
                    nPageIndex = page! + 1;
                  });
                },
              );
            },
          ),

pdfData is changed when updating, and the key value is increased by 1 whenever pdf is changed.

In debug mode, if the pdf is changed, the key value increases and the pdf is immediately changed. In release mode, the key value increases and the pdf data is changed, but the UI is not rebuilt. When the page is changed, it is rebuilt while triggering setState due to onPageChanged. Any idea how to fix it?


问:
Monaco Editor React UI duplicates on reloading
Monaco Editor React UI duplicates on reloading.

Here is my code for it

```<code>                <DiffEditor
                    height='80vh'
                    className='simple-editor'
                    language={fileDataOriginal?.fileExtention || fileDataModified?.fileExtention}
                    original={fileDataOriginal.value}
                    modified={fileDataModified.value}
                    theme={isThemeLoaded ? 'Blackboard' : selectedTheme}
                    onMount={handleEditorDidMount}
                    loading={<Loading isLoading loadingType={SCALE_LOADER} />}
                    keepCurrentOriginalModel={isDisposed}
                    keepCurrentModifiedModel={isDisposed}
                    options={{
                        readOnly,
                        renderWhitespace: 'none',
                        ignoreTrimWhitespace: false,
                    }}
                />
</code>```

There is another editor shown below original editor sometimes on reloading.

Tried disposing editor by keepCurrentOriginalModel and keepCurrentModifiedModel property but it didn't worked.

Body:
Monaco Editor React UI duplicates on reloading.

Here is my code for it

                <DiffEditor
                    height='80vh'
                    className='simple-editor'
                    language={fileDataOriginal?.fileExtention || fileDataModified?.fileExtention}
                    original={fileDataOriginal.value}
                    modified={fileDataModified.value}
                    theme={isThemeLoaded ? 'Blackboard' : selectedTheme}
                    onMount={handleEditorDidMount}
                    loading={<Loading isLoading loadingType={SCALE_LOADER} />}
                    keepCurrentOriginalModel={isDisposed}
                    keepCurrentModifiedModel={isDisposed}
                    options={{
                        readOnly,
                        renderWhitespace: 'none',
                        ignoreTrimWhitespace: false,
                    }}
                />

There is another editor shown below original editor sometimes on reloading.

Tried disposing editor by keepCurrentOriginalModel and keepCurrentModifiedModel property but it didn't worked.


问:
What is best practises to managed Jmeter script with csv file with usere id and password?
I am bit new to Jmeter and in performance testing world.
I am bit strugling with best practises with test data where user id and password is saved in .csv file.

I know it is not good parcise to have user id and password in srouce code respository.
But how to manage test data if I want to used 10 use id and passowrd for logins in my Jmeter script.
I have plan to run these test in pipeline?

Any sugestion?


问:
MySQL error - incompatible with sql_mode=only_full_group_by
I had the following error:  Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'II.quantity' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

I've tried with the following code (sorry the uppercase) to group all the money spent by city, and product:

```<code>SELECT CI.CITY_NAME, P.PRODUCT_NAME, (II.QUANTITY * II.PRICE) AS AMOUNT_SPENT
FROM CITY AS CI
INNER JOIN CUSTOMER AS CU
ON CI.ID = CU.CITY_ID
INNER JOIN INVOICE AS I
ON I.CUSTOMER_ID = CU.ID
INNER JOIN INVOICE_ITEM AS II
ON II.INVOICE_ID = I.ID
INNER JOIN PRODUCT AS P
ON P.ID = II.PRODUCT_ID
GROUP BY CI.CITY_NAME, P.PRODUCT_NAME
ORDER BY AMOUNT_SPENT DESC, CI.CITY_NAME ASC, P.PRODUCT_NAME;
</code>```

Body:
I had the following error:  Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'II.quantity' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

I've tried with the following code (sorry the uppercase) to group all the money spent by city, and product:

SELECT CI.CITY_NAME, P.PRODUCT_NAME, (II.QUANTITY * II.PRICE) AS AMOUNT_SPENT
FROM CITY AS CI
INNER JOIN CUSTOMER AS CU
ON CI.ID = CU.CITY_ID
INNER JOIN INVOICE AS I
ON I.CUSTOMER_ID = CU.ID
INNER JOIN INVOICE_ITEM AS II
ON II.INVOICE_ID = I.ID
INNER JOIN PRODUCT AS P
ON P.ID = II.PRODUCT_ID
GROUP BY CI.CITY_NAME, P.PRODUCT_NAME
ORDER BY AMOUNT_SPENT DESC, CI.CITY_NAME ASC, P.PRODUCT_NAME;


问:
Why Enum classes can't be extended?
Please, help me understand why enum classes can't be extended.
This code:
`

```<code>public class Main
{
    public static void main(String[] args) {
        System.out.println(B.C);
    }

    public enum A {
        A, B, C
    }

    public enum B extends A {
        C, D, E
    }
}
</code>```

`
Will produce compile exception:

```<code>error: '{' expected
    public enum B extends A {
                 ^
</code>```

But why? Is enum class isn't regular class?

But enum can implement interfaces... In my mind the only option why this code don't compile is that emun classes are final, is it true?

Title: Why Enum classes can't be extended?

Body:
Please, help me understand why enum classes can't be extended.
This code:
`

public class Main
{
    public static void main(String[] args) {
        System.out.println(B.C);
    }

    public enum A {
        A, B, C
    }

    public enum B extends A {
        C, D, E
    }
}

`
Will produce compile exception:

error: '{' expected
    public enum B extends A {
                 ^

But why? Is enum class isn't regular class?

But enum can implement interfaces... In my mind the only option why this code don't compile is that emun classes are final, is it true?


问:
How is TOPS metric calculated with any AI model.?
As per the https://developer.nvidia.com/embedded/jetson-modules,the Jetson Xavier NX supports 21 TOPS in AI Performance

For example if the use case is people detection, tracking and counting, how many TOPS will be utilized?

Is the calculation based on any AI model Architecture? if so , please share the calculation steps.


问:
Java for loop skipping a scanner and duplicating my printline
This bug was driving me nuts for the last two hours and I can't seem to figure it out, so here's the code:

```<code>int num_of_reservations = scanner.nextInt();
                Reservations[] business = new Buisness[num_of_reservations];
                for (int i = 0; i < business.length; i++) {
                    business[i] = new Buisness();
                }
                for (Reservations reservations : business) {
                    System.out.println("Write business member name: ");
                    String name_business = scanner.nextLine();
                    reservations.setName(name_business);
                }
</code>```

the code was much more complicated but I tried to simplify it for easier understanding, this sample code produces the same unwanted output which you can see is skipping a scanner and going to the next println:

what could be causing this I can't seem to figure it out help me please.

Body:
This bug was driving me nuts for the last two hours and I can't seem to figure it out, so here's the code:

int num_of_reservations = scanner.nextInt();
                Reservations[] business = new Buisness[num_of_reservations];
                for (int i = 0; i < business.length; i++) {
                    business[i] = new Buisness();
                }
                for (Reservations reservations : business) {
                    System.out.println("Write business member name: ");
                    String name_business = scanner.nextLine();
                    reservations.setName(name_business);
                }

the code was much more complicated but I tried to simplify it for easier understanding, this sample code produces the same unwanted output which you can see is skipping a scanner and going to the next println:

what could be causing this I can't seem to figure it out help me please.


问:
Plot both map and elevation profile views from .shp and .tif?
Say we have a route.shp from ESRI/ArcGIS origin representing the path or route of a hike or a stream, and a corresponding topographic raster file in a dem.tif with matching spatial coordinate system and projection info.

How can we quickly print both the map view and elevation profile in one static or ideally dynamic image? This is a classic view in navigation/outdoor/fitness apps (eg, Strava, or simplified below static image and more detailed below), of say a trip a user went on.

Ideal products would be both a ggplot2-like style w/ 1 column by 2 row plot.png (like below), and a plot.html with an interactive slider tool that scrolls simultaneously through map location and elevation (and ignore the red/green gradient in the profile).  I'm looking more for convenience of plotly R than doing aShiny page, so more "off the shelf" than highly customizable, but I understand it seems a tall order to do concisely in open source environment?

```<code>library(rgdal)
library(raster)
library(tiff)
#other libraries?

route <- readOGR(".", "route")
topofile <- "dem.tif"
</code>```

Body:
Say we have a route.shp from ESRI/ArcGIS origin representing the path or route of a hike or a stream, and a corresponding topographic raster file in a dem.tif with matching spatial coordinate system and projection info.

How can we quickly print both the map view and elevation profile in one static or ideally dynamic image? This is a classic view in navigation/outdoor/fitness apps (eg, Strava, or simplified below static image and more detailed below), of say a trip a user went on.

Ideal products would be both a ggplot2-like style w/ 1 column by 2 row plot.png (like below), and a plot.html with an interactive slider tool that scrolls simultaneously through map location and elevation (and ignore the red/green gradient in the profile).  I'm looking more for convenience of plotly R than doing aShiny page, so more "off the shelf" than highly customizable, but I understand it seems a tall order to do concisely in open source environment?

library(rgdal)
library(raster)
library(tiff)
#other libraries?

route <- readOGR(".", "route")
topofile <- "dem.tif"


问:
Exponential conversion to number is wrong in SQL Server
I am inserting some data from python to sql server. In the dataframe, the data looks ok. However after inserting into sql table, the number converts to some exponential expression. I tried to convert it into a number but the output is not correct. Below is the screenshot of the data in the table:

The first row number should be: 9013513. However, when I convert the exponential number to real number using the code below, it comes out as 9013510. Below is my code:

```<code>declare @stproduct nvarchar(255)
set @stproduct = '9.01351e+006'
SELECT CONVERT(numeric(16,0), CAST(@stproduct AS FLOAT))
</code>```

Body:
I am inserting some data from python to sql server. In the dataframe, the data looks ok. However after inserting into sql table, the number converts to some exponential expression. I tried to convert it into a number but the output is not correct. Below is the screenshot of the data in the table:

The first row number should be: 9013513. However, when I convert the exponential number to real number using the code below, it comes out as 9013510. Below is my code:

declare @stproduct nvarchar(255)
set @stproduct = '9.01351e+006'
SELECT CONVERT(numeric(16,0), CAST(@stproduct AS FLOAT))


问:
Readable HTML getting Truncated
I am trying to extract the Readability version of this site - [https://app.termly.io/document/privacy-policy/93a0d7a9-a628-44b5-9748-4f853bed4112][1]

However, I noticed the readable content gets truncated. I am using Mozilla Readability.

Is there any specific reason it is getting truncated?

Can DOMPURIFY do this job?

Code below

```<code>const Readability = require("@mozilla/readability").Readability;
const { JSDOM } = require("jsdom");
const { chromium } = require("playwright");
const fs = require('fs');
(async function() {
    try {
        const chromeBrowser = await chromium.launch({ headless: true });
        const context = await chromeBrowser.newContext({
                        ignoreHTTPSErrors: true,
                        userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36",
        });
        const URL = "https://app.termly.io/document/privacy-policy/93a0d7a9-a628-44b5-9748-4f853bed4112"
        const page = await context.newPage();
       await page.goto(URL, { waitUntil: 'networkidle', timeout: 60000 });
       const content = await page.content();
       console.log(content)
        let dom = new JSDOM(content,{url: URL});
        const article = new Readability(dom.window.document).parse();
        console.log(article)
        fs.writeFileSync('./index.html', article.content);
    } catch (error) {
        console.log(error);
    }
})();
</code>```

Title: Readable HTML getting Truncated

Body:
I am trying to extract the Readability version of this site - [https://app.termly.io/document/privacy-policy/93a0d7a9-a628-44b5-9748-4f853bed4112][1]

However, I noticed the readable content gets truncated. I am using Mozilla Readability.

Is there any specific reason it is getting truncated?

Can DOMPURIFY do this job?

Code below

const Readability = require("@mozilla/readability").Readability;
const { JSDOM } = require("jsdom");
const { chromium } = require("playwright");
const fs = require('fs');
(async function() {
    try {
        const chromeBrowser = await chromium.launch({ headless: true });
        const context = await chromeBrowser.newContext({
                        ignoreHTTPSErrors: true,
                        userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36",
        });
        const URL = "https://app.termly.io/document/privacy-policy/93a0d7a9-a628-44b5-9748-4f853bed4112"
        const page = await context.newPage();
       await page.goto(URL, { waitUntil: 'networkidle', timeout: 60000 });
       const content = await page.content();
       console.log(content)
        let dom = new JSDOM(content,{url: URL});
        const article = new Readability(dom.window.document).parse();
        console.log(article)
        fs.writeFileSync('./index.html', article.content);
    } catch (error) {
        console.log(error);
    }
})();


问:
How to load bitmap Images in a List faster, Using jetpack compose Android
I am trying to load a list of object in a column using jetpack compose.

The problem is the image is making screen lag.

Here's my code - single list item composable function.

```<code>fun SoulProfilePreviewSingleItem(
    soul: Souls,
    soulWinningViewModel: SoulWinningViewModel,
    onClick: () -> Unit
) {
    val lazyListState = rememberLazyListState()
    /* val localImage = if (soul.localImage.isNotBlank())
         rememberImagePainter(getBase64StringToImage(soul.localImage)) else null*/
    LaunchedEffect(key1 = soulWinningViewModel.nurtureVsFollowUpTabIndex.value) {
        lazyListState.animateScrollToItem(0)
//        if (soul.localImage.isNotBlank()){

//        }
    }
    val isManaging = soulWinningViewModel.isManagingList.value
    var isDeleted by remember {
        mutableStateOf(false)
    }

    val setVisibility: (Boolean) -> Unit = {
        isDeleted = it
    }

    AnimatedVisibility(
        visible = isDeleted.not() &&
                if (soulWinningViewModel.userIsSearchingFor.value.isNotEmpty() && isManaging.not())
                    soul.name.contains(soulWinningViewModel.userIsSearchingFor.value, true) ||
                            soul.followUpActions.toString()
                                .contains(soulWinningViewModel.userIsSearchingFor.value, true) else
                    true
    ) {

        with(soul) {
            Column {
                Box(
                    modifier = Modifier
                        .height(60.dp)
                        .background(MaterialTheme.colorScheme.background)
                        .fillMaxWidth(),
                    contentAlignment = Alignment.BottomEnd
                ) {
                    Row(
                        Modifier
                            .fillMaxSize(),//.clickable { onClick() },
                        verticalAlignment = Alignment.CenterVertically
                    ) {
                        Row(
                            verticalAlignment = Alignment.Top,
                            modifier = Modifier
                                .padding(start = brc_DP_small)
                                .padding(bottom = 6.dp, top = 6.dp)
                        ) {
                            /*if (soul.localImage.isNotBlank()) {
                                GlideImage(
                                    model = ,
                                    // Crop, Fit, Inside, FillHeight, FillWidth, None
                                    contentScale = ContentScale.Crop,
                                    // shows an image with a circular revealed animation.

                                )
                                Log.e("BITMAP","onResourceReady test")
                                val image = loadPicture(url = soul.localImage, defaultImage = R.drawable.ic_brc_logo).value
                                image?.let { img->
                                    Image(
                                        // Can crash this
                                        bitmap =img.asImageBitmap(),
                                        contentDescription = null,
                                        modifier = Modifier
                                            .clip(RoundedCornerShape(50))
                                            .size(30.dp),
                                        contentScale = ContentScale.Crop
                                    )
                                }
                            }*/

                            if (soul.localImage.isNotBlank()) {
//                                val imageLoader = rememberImagePainter(getBase64StringToImage(soul.localImage))
                                Image(
//                                    painter = imageLoader
                                    // Can crash this
                                    bitmap = (
                                            getBase64StringToImage(soul.localImage).asImageBitmap()
                                            ),
                                    contentDescription = null,
                                    modifier = Modifier
                                        .clip(RoundedCornerShape(50))
                                        .size(30.dp),
                                    contentScale = ContentScale.Crop
                                )
                            } else {
                                Image(
                                    // Can crash this
                                    painterResource(id = R.drawable.ic_brc_logo),
                                    contentDescription = null,
                                    modifier = Modifier
                                        .clip(RoundedCornerShape(50))
                                        .size(30.dp),
                                    contentScale = ContentScale.Crop
                                )
                            }
                        }

                        Column(
                            modifier = Modifier
                                .padding(top = brc_DP_small)
                                .weight(1f)
                                .fillMaxWidth()
                                .fillMaxHeight()
                                .padding(start = brc_DP_smaller),
                            verticalArrangement = Arrangement.SpaceBetween
                        ) {
                            Column(
                                modifier = Modifier
                                    .weight(1f)
                                    .fillMaxSize()
                            ) {
                                // This is the place where signle soul is getting showed......
                                Text(
                                    text = name,
                                    style = if (isManaging.not()) MaterialTheme.typography.labelSmall.copy(
                                        fontWeight = FontWeight(500),
                                        letterSpacing = 0.7.sp
                                    )
                                    else MaterialTheme.typography.labelSmall
                                        .copy(
                                            fontSize = 10.sp
                                        ),
                                    modifier = Modifier,
                                    maxLines = 1,
                                )

                                if (isManaging.not()) {
                                    Text(
                                        text = SimpleDateFormat(
                                            "dd-MMM-yyyy",
                                            Locale.UK
                                        ).format(
                                            createdOn
                                        ),
                                        style = MaterialTheme.typography.bodySmall.copy(fontSize = 9.sp),
                                        color = Color.Gray,
                                        modifier = Modifier
                                    )
                                }

                            }

                            if (isBrcMember) {
                                Text(
                                    text = "BRC Member",
                                    style = MaterialTheme.typography.labelSmall.copy(
                                        fontSize = 7.sp,
                                        fontStyle = FontStyle.Italic
                                    ),
                                    color = brc_blue_color,
                                    modifier = Modifier.padding(bottom = brc_DP_smallest)
                                )
                            }
                        }
                    }

                    var externClick by remember {
                        mutableStateOf(false)
                    }

                    Column(modifier = Modifier.padding(brc_DP_small)) {
                        AddSoulFollowUpActionButton(
                            soul = soul,
                            soulWinningViewModel = soulWinningViewModel,
                            visible = soulWinningViewModel.nurtureVsFollowUpTabIndex.value == 1,
                            externClick = externClick,
                            onFinished = { externClick = false }
                        ) {
                            setVisibility(it)
                        }
                    }

                    //TODO:Check Click area ...
                    Row(modifier = Modifier.fillMaxSize()) {
                        Spacer(
                            modifier = Modifier
                                .fillMaxSize()
                                .weight(1.4f)
                                .clickable(
                                    interactionSource = MutableInteractionSource(),
                                    indication = null
                                ) { onClick() })
                        if (soulWinningViewModel.nurtureVsFollowUpTabIndex.value == 1 || isManaging) {
                            Spacer(
                                modifier = Modifier
                                    .fillMaxSize()
                                    .weight(0.6f)
                                    .clickable(
                                        interactionSource = MutableInteractionSource(),
                                        indication = null
                                    ) { externClick = !externClick })
                        }
                    }
                }

                Spacer(
                    modifier = Modifier
                        .padding(start = 28.dp)
                        .fillMaxWidth() //.then(if (isManaging.not()) Modifier.width(150.dp) else Modifier.fillMaxWidth())
                        .height(0.3.dp)
                        .background(Color.LightGray)
                )
            }
        }
    }
}
</code>```

caller of list composable function.

```<code>forEach {
                            SoulProfilePreviewSingleItem(
                                soul = it,
                                soulWinningViewModel
                            ) {
                                soulWinningViewModel.currentSoul.value = it
                                navController.navigate(route = SoulWinningRoutes.PROFILE)
                            }
                        }
</code>```

Whenever I am trying to show Image() of my soul object I am getting glitches and my screens takes more time to load itself.

I am storing image as string in local room database and trying to retrieve it back converting it to bitmapImage.

Code for conversation.

```<code>fun getBase64StringToImage(base64String: String): Bitmap {
    val decodedString: ByteArray = Base64.decode(base64String, Base64.DEFAULT)
    val decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.size)
    return decodedByte
    // this is taking a lot of time and making my Ui performance dull.
}
</code>```

Is there any way I can achieve this functionality with good performance. Like loading Image in separate scope or anything else.

I have already tried using rememberImagePainter and Glide Coil. rememberImagePainter making my performance worst.

Please feel free to give me suggestions, I am still in learning stage.

Thanks in advance.

Body:
I am trying to load a list of object in a column using jetpack compose.

The problem is the image is making screen lag.

Here's my code - single list item composable function.

fun SoulProfilePreviewSingleItem(
    soul: Souls,
    soulWinningViewModel: SoulWinningViewModel,
    onClick: () -> Unit
) {
    val lazyListState = rememberLazyListState()
    /* val localImage = if (soul.localImage.isNotBlank())
         rememberImagePainter(getBase64StringToImage(soul.localImage)) else null*/
    LaunchedEffect(key1 = soulWinningViewModel.nurtureVsFollowUpTabIndex.value) {
        lazyListState.animateScrollToItem(0)
//        if (soul.localImage.isNotBlank()){

//        }
    }
    val isManaging = soulWinningViewModel.isManagingList.value
    var isDeleted by remember {
        mutableStateOf(false)
    }

    val setVisibility: (Boolean) -> Unit = {
        isDeleted = it
    }

    AnimatedVisibility(
        visible = isDeleted.not() &&
                if (soulWinningViewModel.userIsSearchingFor.value.isNotEmpty() && isManaging.not())
                    soul.name.contains(soulWinningViewModel.userIsSearchingFor.value, true) ||
                            soul.followUpActions.toString()
                                .contains(soulWinningViewModel.userIsSearchingFor.value, true) else
                    true
    ) {

        with(soul) {
            Column {
                Box(
                    modifier = Modifier
                        .height(60.dp)
                        .background(MaterialTheme.colorScheme.background)
                        .fillMaxWidth(),
                    contentAlignment = Alignment.BottomEnd
                ) {
                    Row(
                        Modifier
                            .fillMaxSize(),//.clickable { onClick() },
                        verticalAlignment = Alignment.CenterVertically
                    ) {
                        Row(
                            verticalAlignment = Alignment.Top,
                            modifier = Modifier
                                .padding(start = brc_DP_small)
                                .padding(bottom = 6.dp, top = 6.dp)
                        ) {
                            /*if (soul.localImage.isNotBlank()) {
                                GlideImage(
                                    model = ,
                                    // Crop, Fit, Inside, FillHeight, FillWidth, None
                                    contentScale = ContentScale.Crop,
                                    // shows an image with a circular revealed animation.

                                )
                                Log.e("BITMAP","onResourceReady test")
                                val image = loadPicture(url = soul.localImage, defaultImage = R.drawable.ic_brc_logo).value
                                image?.let { img->
                                    Image(
                                        // Can crash this
                                        bitmap =img.asImageBitmap(),
                                        contentDescription = null,
                                        modifier = Modifier
                                            .clip(RoundedCornerShape(50))
                                            .size(30.dp),
                                        contentScale = ContentScale.Crop
                                    )
                                }
                            }*/

                            if (soul.localImage.isNotBlank()) {
//                                val imageLoader = rememberImagePainter(getBase64StringToImage(soul.localImage))
                                Image(
//                                    painter = imageLoader
                                    // Can crash this
                                    bitmap = (
                                            getBase64StringToImage(soul.localImage).asImageBitmap()
                                            ),
                                    contentDescription = null,
                                    modifier = Modifier
                                        .clip(RoundedCornerShape(50))
                                        .size(30.dp),
                                    contentScale = ContentScale.Crop
                                )
                            } else {
                                Image(
                                    // Can crash this
                                    painterResource(id = R.drawable.ic_brc_logo),
                                    contentDescription = null,
                                    modifier = Modifier
                                        .clip(RoundedCornerShape(50))
                                        .size(30.dp),
                                    contentScale = ContentScale.Crop
                                )
                            }
                        }

                        Column(
                            modifier = Modifier
                                .padding(top = brc_DP_small)
                                .weight(1f)
                                .fillMaxWidth()
                                .fillMaxHeight()
                                .padding(start = brc_DP_smaller),
                            verticalArrangement = Arrangement.SpaceBetween
                        ) {
                            Column(
                                modifier = Modifier
                                    .weight(1f)
                                    .fillMaxSize()
                            ) {
                                // This is the place where signle soul is getting showed......
                                Text(
                                    text = name,
                                    style = if (isManaging.not()) MaterialTheme.typography.labelSmall.copy(
                                        fontWeight = FontWeight(500),
                                        letterSpacing = 0.7.sp
                                    )
                                    else MaterialTheme.typography.labelSmall
                                        .copy(
                                            fontSize = 10.sp
                                        ),
                                    modifier = Modifier,
                                    maxLines = 1,
                                )

                                if (isManaging.not()) {
                                    Text(
                                        text = SimpleDateFormat(
                                            "dd-MMM-yyyy",
                                            Locale.UK
                                        ).format(
                                            createdOn
                                        ),
                                        style = MaterialTheme.typography.bodySmall.copy(fontSize = 9.sp),
                                        color = Color.Gray,
                                        modifier = Modifier
                                    )
                                }

                            }

                            if (isBrcMember) {
                                Text(
                                    text = "BRC Member",
                                    style = MaterialTheme.typography.labelSmall.copy(
                                        fontSize = 7.sp,
                                        fontStyle = FontStyle.Italic
                                    ),
                                    color = brc_blue_color,
                                    modifier = Modifier.padding(bottom = brc_DP_smallest)
                                )
                            }
                        }
                    }

                    var externClick by remember {
                        mutableStateOf(false)
                    }

                    Column(modifier = Modifier.padding(brc_DP_small)) {
                        AddSoulFollowUpActionButton(
                            soul = soul,
                            soulWinningViewModel = soulWinningViewModel,
                            visible = soulWinningViewModel.nurtureVsFollowUpTabIndex.value == 1,
                            externClick = externClick,
                            onFinished = { externClick = false }
                        ) {
                            setVisibility(it)
                        }
                    }

                    //TODO:Check Click area ...
                    Row(modifier = Modifier.fillMaxSize()) {
                        Spacer(
                            modifier = Modifier
                                .fillMaxSize()
                                .weight(1.4f)
                                .clickable(
                                    interactionSource = MutableInteractionSource(),
                                    indication = null
                                ) { onClick() })
                        if (soulWinningViewModel.nurtureVsFollowUpTabIndex.value == 1 || isManaging) {
                            Spacer(
                                modifier = Modifier
                                    .fillMaxSize()
                                    .weight(0.6f)
                                    .clickable(
                                        interactionSource = MutableInteractionSource(),
                                        indication = null
                                    ) { externClick = !externClick })
                        }
                    }
                }

                Spacer(
                    modifier = Modifier
                        .padding(start = 28.dp)
                        .fillMaxWidth() //.then(if (isManaging.not()) Modifier.width(150.dp) else Modifier.fillMaxWidth())
                        .height(0.3.dp)
                        .background(Color.LightGray)
                )
            }
        }
    }
}

caller of list composable function.

forEach {
                            SoulProfilePreviewSingleItem(
                                soul = it,
                                soulWinningViewModel
                            ) {
                                soulWinningViewModel.currentSoul.value = it
                                navController.navigate(route = SoulWinningRoutes.PROFILE)
                            }
                        }

Whenever I am trying to show Image() of my soul object I am getting glitches and my screens takes more time to load itself.

I am storing image as string in local room database and trying to retrieve it back converting it to bitmapImage.

Code for conversation.

fun getBase64StringToImage(base64String: String): Bitmap {
    val decodedString: ByteArray = Base64.decode(base64String, Base64.DEFAULT)
    val decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.size)
    return decodedByte
    // this is taking a lot of time and making my Ui performance dull.
}

Is there any way I can achieve this functionality with good performance. Like loading Image in separate scope or anything else.

I have already tried using rememberImagePainter and Glide Coil. rememberImagePainter making my performance worst.

Please feel free to give me suggestions, I am still in learning stage.

Thanks in advance.


问:
How to compile and run a TypeScript project with circular dependencies?
I read somewhere about how to organize your code in a TypeScript project, and it recommended circular dependencies, so I went with it. It is particularly nice in my situation (don't want to debate the benefits/drawbacks of circular dependencies).

The problem is, I am getting an error that is probably caused by this circular dependency system. In the past, I have gotten an error where requiring a module returns a blank {} object, because it hasn't finished exporting the circular dependency, which causes an error because the things you are accessing on that required module aren't finished being attached.

Say you had this contrived example:

```<code>// a.js
import * as b from './b'

export function log(text: string) {
  console.log(`${b.timestamp()}: ${text}`)
}

// b.js
import * as a from './a'

export function timestamp(): number {
  a.log('debug')
  return Date.now()
}

// index.js
import * as b from './b'

const t = b.timestamp()
</code>```

The a module will be {} blank because it is not finished yet. That is at least what I am experiencing, I am getting an error because my properties on my exports are undefined and I just have an empty object.

How do you compile a TypeScript project to allow for these circular dependencies?

In my project, I have 300 files so far for a compiler, and one small piece is basically like this (for demo purposes):

```<code>// ast.js
export enum AST = {
  One = 'one'
  Two = 'two'
}

// list.js
import { AST } from '~'

export const AST_NODES = [
  AST.One,
  Ast.Two
]

// api.js
export * from './list'
export * from './ast'

// index.js
import * as api from './api'

export * from './api'

export { api }
</code>```

With this tsconfig.json:

```<code>{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es2020",
    "lib": ["es2020"],
    "outDir": "host",
    "rootDir": "make",
    "sourceMap": true,
    "strictNullChecks": true,
    "esModuleInterop": true,
    "noUncheckedIndexedAccess": true,
    "baseUrl": "./make",
    "paths": {
      "~*": ["./*"],
      "~": ["."]
    },
    "noImplicitAny": true
  },
  "include": ["make"],
  "exclude": ["node_modules"]
}
</code>```

So ~ loads from the base of the project, and everything is exported from the tree of files at the base (they all have unique names). This is important because, for a compiler, I have about 500 functions so far, and a lot of them are circular/recursive, but I want to break them apart into separate files to make things manageable/understandable. They all import api and call the functions they need internal to a function (i.e. not calling the function in the top-level scope, if that's relevant). Anyways, that's the rough structure.

So how can I compile this so it works in TypeScript? I tried ts-node but it doesn't resolve the "aliases", so I have this in my package.json now:

```<code>"scripts": {
  "build": "tsc && tsc-alias",
  "watch": "concurrently --kill-others \"tsc -w\" \"tsc-alias -w\""
},
</code>```

The module tsc-alias seems to be successfully resolving the aliases, but I am getting that error because the compiled file is like this:

```<code>"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CARD_TYPE = void 0;
const _1 = require("../..");
exports.CARD_TYPE = [
    _1.Mesh.CodeCard,
    _1.Mesh.BookCard,
    _1.Mesh.DeckCard,
];
</code>```

(It is loading from the base at ../..). But the base loads this current file as well. So not really sure what to do now. TypeScript-wise (in VSCode), I get no errors and it seems to like all my files and can resolve all the variables/functions/imports/exports properly. But now that I try to run it (I just converted to TypeScript and refactored), it is erroring at this thing. Is it not possible to do what I'm trying? Or do I need to change some things? Or can it somehow handle this?

Body:
I read somewhere about how to organize your code in a TypeScript project, and it recommended circular dependencies, so I went with it. It is particularly nice in my situation (don't want to debate the benefits/drawbacks of circular dependencies).

The problem is, I am getting an error that is probably caused by this circular dependency system. In the past, I have gotten an error where requiring a module returns a blank {} object, because it hasn't finished exporting the circular dependency, which causes an error because the things you are accessing on that required module aren't finished being attached.

Say you had this contrived example:

// a.js
import * as b from './b'

export function log(text: string) {
  console.log(`${b.timestamp()}: ${text}`)
}

// b.js
import * as a from './a'

export function timestamp(): number {
  a.log('debug')
  return Date.now()
}

// index.js
import * as b from './b'

const t = b.timestamp()

The a module will be {} blank because it is not finished yet. That is at least what I am experiencing, I am getting an error because my properties on my exports are undefined and I just have an empty object.

How do you compile a TypeScript project to allow for these circular dependencies?

In my project, I have 300 files so far for a compiler, and one small piece is basically like this (for demo purposes):

// ast.js
export enum AST = {
  One = 'one'
  Two = 'two'
}

// list.js
import { AST } from '~'

export const AST_NODES = [
  AST.One,
  Ast.Two
]

// api.js
export * from './list'
export * from './ast'

// index.js
import * as api from './api'

export * from './api'

export { api }

With this tsconfig.json:

{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es2020",
    "lib": ["es2020"],
    "outDir": "host",
    "rootDir": "make",
    "sourceMap": true,
    "strictNullChecks": true,
    "esModuleInterop": true,
    "noUncheckedIndexedAccess": true,
    "baseUrl": "./make",
    "paths": {
      "~*": ["./*"],
      "~": ["."]
    },
    "noImplicitAny": true
  },
  "include": ["make"],
  "exclude": ["node_modules"]
}

So ~ loads from the base of the project, and everything is exported from the tree of files at the base (they all have unique names). This is important because, for a compiler, I have about 500 functions so far, and a lot of them are circular/recursive, but I want to break them apart into separate files to make things manageable/understandable. They all import api and call the functions they need internal to a function (i.e. not calling the function in the top-level scope, if that's relevant). Anyways, that's the rough structure.

So how can I compile this so it works in TypeScript? I tried ts-node but it doesn't resolve the "aliases", so I have this in my package.json now:

"scripts": {
  "build": "tsc && tsc-alias",
  "watch": "concurrently --kill-others \"tsc -w\" \"tsc-alias -w\""
},

The module tsc-alias seems to be successfully resolving the aliases, but I am getting that error because the compiled file is like this:

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CARD_TYPE = void 0;
const _1 = require("../..");
exports.CARD_TYPE = [
    _1.Mesh.CodeCard,
    _1.Mesh.BookCard,
    _1.Mesh.DeckCard,
];

(It is loading from the base at ../..). But the base loads this current file as well. So not really sure what to do now. TypeScript-wise (in VSCode), I get no errors and it seems to like all my files and can resolve all the variables/functions/imports/exports properly. But now that I try to run it (I just converted to TypeScript and refactored), it is erroring at this thing. Is it not possible to do what I'm trying? Or do I need to change some things? Or can it somehow handle this?


问:
Validating an infix expression
I'm trying to validate infix expressions.

So far, I've developed code that can detect a large percentage of invalid infix expressions, but for some reason, the case "( ( ( ) ) ) 5"  is not detected as invalid.

How do I detect the invalid condition when there are parenthesis that have no expression?

ContentLicense: CC BY-SA 3.0

Title: Validating an infix expression


问:
Some of the attributes missing in log-stash logs
```<code>input {
  http {
    port => 8080
    codec => json
  }
}

</code>```

filter part:

```<code>          map['username'] ||= event.get('username');
          map['error'] ||= event.get('message');
          map['filename'] ||= event.get('filename');
          map['line'] ||= event.get('line');
</code>```
```<code>output {
  stdout {
    codec => rubydebug
  }

  if [type] == "client" {
    elasticsearch {
      hosts => ["${LOGSTASH_OUTPUT_HOST}"]
      index => "%{[@metadata][target_index_client]}"
      user => "${LOGSTASH_OUTPUT_USER:}"
      password => "${LOGSTASH_OUTPUT_PASS:}"
      manage_template => false
    }
  } else if [type] == "server" {
    elasticsearch {
      hosts => ["${LOGSTASH_OUTPUT_HOST}"]
      index => "%{[@metadata][target_index_server]}"
      user => "${LOGSTASH_OUTPUT_USER:}"
      password => "${LOGSTASH_OUTPUT_PASS:}"
      manage_template => false
    }
  }
}
</code>```

**We getting most of the attributes but some the important attribute missing in our logstash ** please suggest how to fix this issue

Body:
input {
  http {
    port => 8080
    codec => json
  }
}

filter part:

          map['username'] ||= event.get('username');
          map['error'] ||= event.get('message');
          map['filename'] ||= event.get('filename');
          map['line'] ||= event.get('line');

output {
  stdout {
    codec => rubydebug
  }

  if [type] == "client" {
    elasticsearch {
      hosts => ["${LOGSTASH_OUTPUT_HOST}"]
      index => "%{[@metadata][target_index_client]}"
      user => "${LOGSTASH_OUTPUT_USER:}"
      password => "${LOGSTASH_OUTPUT_PASS:}"
      manage_template => false
    }
  } else if [type] == "server" {
    elasticsearch {
      hosts => ["${LOGSTASH_OUTPUT_HOST}"]
      index => "%{[@metadata][target_index_server]}"
      user => "${LOGSTASH_OUTPUT_USER:}"
      password => "${LOGSTASH_OUTPUT_PASS:}"
      manage_template => false
    }
  }
}

**We getting most of the attributes but some the important attribute missing in our logstash ** please suggest how to fix this issue