问:
Django multi-country app with one database for all apps
I'm developing one template application which can be used in many countries and in each country I plan to show country-specific language set for users, also I want to use only ONE database for all those applications...
So my question is: is it possible somehow to set LANGUAGES variable in settings.py for specific country? Because as I understood I have only one table with translations in my database where all translations are have column_lang model... so if i.e I had app for America with language list: en, es, fr and Poland application with language list: en, pl
will I had some database conflicts if I had only one database and different languages?
And if so maybe is there some way to avoid those conflicts?

P.S use PostgreSQL database and Django 4.1.1;

P.P.P.S I added column for country code to each table which should be country-specific;

P.P.S in Database projecting and python I don't have so much experience so maybe dummy question =)

Thanks for helping!


来源: stackexchange

问:
One-hot encoding of a Pandas DF of 21 long RNA Sequences
I have tried several solution but most of them work for NL processing. Data has many special characters which can NOT be omitted.

I tried keras StringLookup(), pd.get_dummies(), sklearn OneHotEncoding

ContentLicense: CC BY-SA 4.0


问:
GraphQL .NET Mutations with Nested InputObjectGraphType
Within GraphQL-Dotnet i have a mutation with a list type input type, and within that type, i have a list of items, which themselves are an input type.

I have defined the mutation and the resolver for the mutation to be:

            Field<ListType>("createList")
                .Argument<NonNullGraphType<ListInputType>>("list")
                .ResolveAsync(async context =>
                {
                    var list = context.GetArgument<ListEntity>("list");
                    var val = await dataContext.AddAsync(list);
                    await dataContext.SaveChangesAsync();
                    return val.Entity;
                });
```
<p>And my list type is defined as</p>
<pre class="lang-cs prettyprint-override"><code>    public class ListInputType : InputObjectGraphType<ListEntity>
    {
        public ListInputType()
        {
            Name = "listInput";

            Field(f => f.Key).Description("list key");
///...
            Field<ListGraphType<ListItemInputType>>("items").Resolve(f =>
            {
                return null;
            });
        }
    }
</code>```

I am expecting to be able to put a break point within the resolve, and examine what is going on within the resolve, so that i can finish mapping up the list items, so i am able to then have EF within the mutation definition, save both the new list its self, as well as the items.

The breakpoint never gets hit.

I have also tried Field(f => f.ListItems) on its own instead of the Field<ListGraphType<ListItemInputType>>... line, and that creates a schema for me, but i get hidden crashes and exceptions that cannot be caught when i attempt to push the mutation.

All i am looking to do is the following:

```<code>
mutation {
  createList(list: {
    key: "new_list",
    items: [
      {
        alias: "alias1",
        order: 1
      },
      {
        alias: "alias2",
        order: 2
      },
      {
        alias: "alias3",
        order: 3
      }
    ]
  }) {
    id
  }
}
</code>```

But i dont seem to be able to figure it out or find the answer anywhere on here or google.

Body:
Within GraphQL-Dotnet i have a mutation with a list type input type, and within that type, i have a list of items, which themselves are an input type.

I have defined the mutation and the resolver for the mutation to be:

            Field<ListType>("createList")
                .Argument<NonNullGraphType<ListInputType>>("list")
                .ResolveAsync(async context =>
                {
                    var list = context.GetArgument<ListEntity>("list");
                    var val = await dataContext.AddAsync(list);
                    await dataContext.SaveChangesAsync();
                    return val.Entity;
                });

And my list type is defined as

    public class ListInputType : InputObjectGraphType<ListEntity>
    {
        public ListInputType()
        {
            Name = "listInput";

            Field(f => f.Key).Description("list key");
///...
            Field<ListGraphType<ListItemInputType>>("items").Resolve(f =>
            {
                return null;
            });
        }
    }

I am expecting to be able to put a break point within the resolve, and examine what is going on within the resolve, so that i can finish mapping up the list items, so i am able to then have EF within the mutation definition, save both the new list its self, as well as the items.

The breakpoint never gets hit.

I have also tried Field(f => f.ListItems) on its own instead of the Field<ListGraphType<ListItemInputType>>... line, and that creates a schema for me, but i get hidden crashes and exceptions that cannot be caught when i attempt to push the mutation.

All i am looking to do is the following:

mutation {
  createList(list: {
    key: "new_list",
    items: [
      {
        alias: "alias1",
        order: 1
      },
      {
        alias: "alias2",
        order: 2
      },
      {
        alias: "alias3",
        order: 3
      }
    ]
  }) {
    id
  }
}

But i dont seem to be able to figure it out or find the answer anywhere on here or google.


问:
The Firebase database 'kavery-taxi-default-rtdb' has been deactivated
My firebase realtime database not responding how to fix this?


问:
Dynamically ordering tasks in airflow
Currently I have a single DAG in airflow, with a few tasks. This DAG is triggered by an external service using airflow's dagRuns api. This is working.

Now I want to control which tasks to run (i.e. I want to skip some tasks) through the service. (Use case is : an end user interacts with a ui and chooses a subset of tasks to run, which is received by the service triggering the dag runs). I also want the ability to reorder dynamically.

Effectively, the service gives airflow during dagRuns call, an array : ["task1", "task2", "task3"]

and, the airflow dag runs the tasks in that order:
 task1 >> task2 >> task3

I was able to skip tasks by using a branch-operator before every task, and going over a DummyOperator in a parallel branch, if the input array did not contain the task. Like:
branch_op >> [task1, DummyOperator]

How can I also add dynamic ordering tasks to this?

Title: Dynamically ordering tasks in airflow


问:
convert terminal results to pdf file
i create a custuom report that shows results in command shell using the following function:

report = performance_report(trading_system, operations, trading_system.closed_equity, trading_system.open_equity)

how can i convert the results i see on my terminal to a simple pdf?
thanks

i have tried the following

```<code>from A06_engine_strategy import report
from fpdf import FPDF

helloworld = report
print(helloworld)

pdf = FPDF() # create pdf
pdf.add_page() #add page!
pdf.set_font("Arial", size=12) # font

pdf.cell(200, 10, txt=helloworld, ln=1, align="C")

pdf.output("simple_demo.pdf") # output file
</code>```

but seems does not working correctly.
what i am missing? thanks

Title: convert terminal results to pdf file

Body:
i create a custuom report that shows results in command shell using the following function:

report = performance_report(trading_system, operations, trading_system.closed_equity, trading_system.open_equity)

how can i convert the results i see on my terminal to a simple pdf?
thanks

i have tried the following

from A06_engine_strategy import report
from fpdf import FPDF

helloworld = report
print(helloworld)

pdf = FPDF() # create pdf
pdf.add_page() #add page!
pdf.set_font("Arial", size=12) # font

pdf.cell(200, 10, txt=helloworld, ln=1, align="C")

pdf.output("simple_demo.pdf") # output file

but seems does not working correctly.
what i am missing? thanks


问:
How to add button for youtube with chrome extension
i'm developing chrome extension. I want to add button to youtube. But button is not showing. (It only appears for a very short time while the page is loading, then disappears immediately.)

Content.js

```<code>let btn = document.createElement("button");
btn.innerHTML = "Music Button";
btn.id = "btn-music";
btn.style.zIndex = "10";
document.body.appendChild(btn);
document.getElementById("title").insertBefore(btn, document.getElementById("title").children[0]);
</code>```

Body:
i'm developing chrome extension. I want to add button to youtube. But button is not showing. (It only appears for a very short time while the page is loading, then disappears immediately.)

Content.js

let btn = document.createElement("button");
btn.innerHTML = "Music Button";
btn.id = "btn-music";
btn.style.zIndex = "10";
document.body.appendChild(btn);
document.getElementById("title").insertBefore(btn, document.getElementById("title").children[0]);


问:
Chrome extension Proxy SSL error: err_tunnel_connection_failed Workerman
I am trying to create my own proxy server and connect to it through the chrome extension.

My proxy server is implemented in PHP workerman.

```<code><?php

$context = [
    'ssl' => [
        'local_cert'  => '/var/www/httpd-cert/www-root/faster.tw-team.com_le3.crtca',
        'local_pk'    => '/var/www/httpd-cert/www-root/faster.tw-team.com_le3.key',
        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true
    ]
];

$http_worker = new Worker('http://0.0.0.0:7777', $context);

$http_worker->count = 4;
$http_worker->transport = 'ssl';

$http_worker->onConnect = function( Workerman\Connection\TcpConnection $connection)
{
    $response = new Response(200);
    $response->withStatus(200, 'Connection Established');
    $connection->send( $response);

};
$http_worker->onMessage = function ($connection, $request) {

    $response = new Response(200, [], 'test');
    $connection->send( $response);

};

Worker::runAll();

</code>```

I received the SSL certificate via let'sencrypt. If you open the site in a browser https://faster.tw-team.com:7777 / then it shows that everything is fine with the certificate.

But when I turn on the chrome extension where I connect to this server through a proxy, it gives an SSL error if I open an https site: err_tunnel_connection_failed

```<code>var config = {
    mode: "fixed_servers",
    rules: {
        singleProxy: {
            scheme: "https",
            host: "faster.tw-team.com",
            port: 7777
        },
        bypassList: ["foobar.com"]
    }
};
chrome.proxy.settings.set(
    {value: config, scope: 'regular'},
    function() {}
);
</code>```

At the same time, if I open any http site under a proxy, then there is no error and everything works correctly.

I tried various options for specifying the certificate in $context on my server, but it did not give any result.

Please can you tell me how I can solve this problem?

Body:
I am trying to create my own proxy server and connect to it through the chrome extension.

My proxy server is implemented in PHP workerman.

<?php

$context = [
    'ssl' => [
        'local_cert'  => '/var/www/httpd-cert/www-root/faster.tw-team.com_le3.crtca',
        'local_pk'    => '/var/www/httpd-cert/www-root/faster.tw-team.com_le3.key',
        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true
    ]
];

$http_worker = new Worker('http://0.0.0.0:7777', $context);

$http_worker->count = 4;
$http_worker->transport = 'ssl';

$http_worker->onConnect = function( Workerman\Connection\TcpConnection $connection)
{
    $response = new Response(200);
    $response->withStatus(200, 'Connection Established');
    $connection->send( $response);

};
$http_worker->onMessage = function ($connection, $request) {

    $response = new Response(200, [], 'test');
    $connection->send( $response);

};

Worker::runAll();

I received the SSL certificate via let'sencrypt. If you open the site in a browser https://faster.tw-team.com:7777 / then it shows that everything is fine with the certificate.

But when I turn on the chrome extension where I connect to this server through a proxy, it gives an SSL error if I open an https site: err_tunnel_connection_failed

var config = {
    mode: "fixed_servers",
    rules: {
        singleProxy: {
            scheme: "https",
            host: "faster.tw-team.com",
            port: 7777
        },
        bypassList: ["foobar.com"]
    }
};
chrome.proxy.settings.set(
    {value: config, scope: 'regular'},
    function() {}
);

At the same time, if I open any http site under a proxy, then there is no error and everything works correctly.

I tried various options for specifying the certificate in $context on my server, but it did not give any result.

Please can you tell me how I can solve this problem?


问:
MapStruct Mapper Bean not found
I am trying to create a mapper for my Capteur class :

Capteur:

```<code>package fr.projettresscientifique.reel.referentielreel.model.java;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class Capteur {

    private Integer id;

    private Coordonnee coordonnee;

    private Integer intensite;

}

</code>```

CapteurDto:

```<code>package fr.projettresscientifique.reel.referentielreel.model.dto;

import jakarta.annotation.Nonnull;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class CapteurDto {

    @Nonnull
    private Integer id;

    private CoordonneeDto coordonnee;

    private Integer intensite;

}

</code>```

CapteurMapper :

```<code>package fr.projettresscientifique.reel.referentielreel.mapper;

import java.util.List;

import org.mapstruct.Mapper;

import fr.projettresscientifique.reel.referentielreel.model.dto.CapteurDto;
import fr.projettresscientifique.reel.referentielreel.model.java.Capteur;
import fr.projettresscientifique.reel.referentielreel.model.jpa.CapteurJpa;

@Mapper(componentModel = "spring")
public interface CapteurMapper {

    Capteur toCapteur(CapteurJpa capteurJpa);

    Capteur toCapteur(CapteurDto capteurDto);

    CapteurDto toCapteurDto(Capteur capteur);

    CapteurDto toCapteurDto(CapteurJpa capteurJpa);

    CapteurJpa toCapteurJpa(Capteur capteur);

    CapteurJpa toCapteurJpa(CapteurDto capteurDto);

    List<CapteurDto> toCapteurDto(List<CapteurJpa> capteurJpa);

}

</code>```

And have use them all in a Controller with the help of a JpaRepo :

CapteurRepo :

```<code>package fr.projettresscientifique.reel.referentielreel.repository;

import java.util.UUID;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import fr.projettresscientifique.reel.referentielreel.model.jpa.CapteurJpa;

@Repository
public interface CapteurRepository extends JpaRepository<CapteurJpa, UUID> {

}

</code>```

CapteurController:

```<code>package fr.projettresscientifique.reel.referentielreel.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import fr.projettresscientifique.reel.referentielreel.mapper.CapteurMapper;
import fr.projettresscientifique.reel.referentielreel.model.dto.CapteurDto;
import fr.projettresscientifique.reel.referentielreel.model.jpa.CapteurJpa;
import fr.projettresscientifique.reel.referentielreel.repository.CapteurRepository;

@RestController
@RequestMapping("/capteur")
public class CapteurController {

    @Autowired
    CapteurRepository capteurRepository;

    @Autowired
    CapteurMapper capteurMapper;

    @GetMapping("/test")
    public List<CapteurDto> getAllCapteur() {

        List<CapteurJpa> listJpa = capteurRepository.findAll();

        List<CapteurDto> listDto = capteurMapper.toCapteurDto(listJpa);

        return listDto;

    }

}

</code>```

Strangely I get this error:

```<code>***************************
APPLICATION FAILED TO START
***************************

Description:

Field capteurMapper in fr.projettresscientifique.reel.referentielreel.controller.CapteurController required a bean of type 'fr.projettresscientifique.reel.referentielreel.mapper.CapteurMapper' that could not be found.

The injection point has the following annotations:
    - @org.springframework.beans.factory.annotation.Autowired(required=true)

Action:

Consider defining a bean of type 'fr.projettresscientifique.reel.referentielreel.mapper.CapteurMapper' in your configuration.
</code>```

I saw that I had to add a mapstruct plugin and a compilerArg to say to use the springModel

pom.xml:

```<code><?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.0</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
    <groupId>fr.projettresscientifique.reel</groupId>
    <artifactId>referentiel-reel</artifactId>
    <version>1</version>
    <name>referentiel-reel</name>
    <description>WebServer du Simulateur</description>
    <properties>
        <java.version>17</java.version>
        <org.mapstruct.version>1.5.3.Final</org.mapstruct.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web-services</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.mapstruct/mapstruct -->
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <version>1.5.3.Final</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.mapstruct/mapstruct-processor -->
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-processor</artifactId>
            <version>${org.mapstruct.version}</version>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>6.1.6.Final</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>

                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>${org.mapstruct.version}</version>
                        </path>
                    </annotationProcessorPaths>
                    <compilerArgs>
                        <compilerArg>
                            -Amapstruct.defaultComponentModel=spring
                        </compilerArg>
                    </compilerArgs>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

</code>```

It works when I do a mvn clean install

But the second there's a maven update (from Eclipse or exemple) it doesn't work again

Any help please ?

Thanks a lot !

Edit 1:

Even with the mvn clean install, I get my implementation:

```<code>package fr.projettresscientifique.reel.referentielreel.mapper;

import fr.projettresscientifique.reel.referentielreel.model.dto.CapteurDto;
import fr.projettresscientifique.reel.referentielreel.model.java.Capteur;
import fr.projettresscientifique.reel.referentielreel.model.jpa.CapteurJpa;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Component;

/*
@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2022-12-14T16:58:02+0100",
    comments = "version: 1.5.3.Final, compiler: javac, environment: Java 17.0.1 (Eclipse Adoptium)"
)
*/
@Component
public class CapteurMapperImpl implements CapteurMapper {

    @Override
    public Capteur toCapteur(CapteurJpa capteurJpa) {
        if ( capteurJpa == null ) {
            return null;
        }

        Capteur capteur = new Capteur();

        return capteur;
    }

    @Override
    public Capteur toCapteur(CapteurDto capteurDto) {
        if ( capteurDto == null ) {
            return null;
        }

        Capteur capteur = new Capteur();

        return capteur;
    }

    @Override
    public CapteurDto toCapteurDto(Capteur capteur) {
        if ( capteur == null ) {
            return null;
        }

        CapteurDto capteurDto = new CapteurDto();

        return capteurDto;
    }

    @Override
    public CapteurDto toCapteurDto(CapteurJpa capteurJpa) {
        if ( capteurJpa == null ) {
            return null;
        }

        CapteurDto capteurDto = new CapteurDto();

        return capteurDto;
    }

    @Override
    public CapteurJpa toCapteurJpa(Capteur capteur) {
        if ( capteur == null ) {
            return null;
        }

        CapteurJpa capteurJpa = new CapteurJpa();

        return capteurJpa;
    }

    @Override
    public CapteurJpa toCapteurJpa(CapteurDto capteurDto) {
        if ( capteurDto == null ) {
            return null;
        }

        CapteurJpa capteurJpa = new CapteurJpa();

        return capteurJpa;
    }

    @Override
    public List<CapteurDto> toCapteurDto(List<CapteurJpa> capteurJpa) {
        if ( capteurJpa == null ) {
            return null;
        }

        List<CapteurDto> list = new ArrayList<CapteurDto>( capteurJpa.size() );
        for ( CapteurJpa capteurJpa1 : capteurJpa ) {
            list.add( toCapteurDto( capteurJpa1 ) );
        }

        return list;
    }
}
</code>```

But it doesn't work when used

Edit 2:

It works after a mvn clean install

But when I try to map from List to List I get this error

```<code>Hibernate:
    select
        c1_0.id,
        c1_0.latitude,
        c1_0.longitude,
        c1_0.intensite
    from
        capteurs c1_0
2022-12-14T17:15:52.846+01:00 ERROR 21820 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class fr.projettresscientifique.reel.referentielreel.model.dto.CapteurDto]] with root cause

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class fr.projettresscientifique.reel.referentielreel.model.dto.CapteurDto and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0])
    at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1306) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:408) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:53) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:30) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents(CollectionSerializer.java:145) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:107) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:25) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:400) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1568) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:1061) ~[jackson-databind-2.14.1.jar:2.14.1]
    at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:483) ~[spring-web-6.0.2.jar:6.0.2]
    at org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:103) ~[spring-web-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:297) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:194) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:78) ~[spring-web-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:135) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:884) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1080) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:973) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1003) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:895) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:705) ~[tomcat-embed-core-10.1.1.jar:6.0]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:880) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:814) ~[tomcat-embed-core-10.1.1.jar:6.0]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:223) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-6.0.2.jar:6.0.2]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.2.jar:6.0.2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-6.0.2.jar:6.0.2]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.2.jar:6.0.2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.0.2.jar:6.0.2]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.2.jar:6.0.2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:119) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:400) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1739) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

</code>```

Edit 3:

With help I realised the problem is coming from the Lombook Getters and Setters.

I added it to the compiler in the pom

```<code><?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.0</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
    <groupId>fr.projettresscientifique.reel</groupId>
    <artifactId>referentiel-reel</artifactId>
    <version>1</version>
    <name>referentiel-reel</name>
    <description>WebServer du Simulateur</description>
    <properties>
        <java.version>17</java.version>
        <org.mapstruct.version>1.5.3.Final</org.mapstruct.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web-services</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.mapstruct/mapstruct -->
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <version>${org.mapstruct.version}</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.mapstruct/mapstruct-processor -->
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-processor</artifactId>
            <version>${org.mapstruct.version}</version>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>6.1.6.Final</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>${org.mapstruct.version}</version>
                        </path>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>1.18.24</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
</code>```

And I changed my build path to this:
enter image description here

But I still get either the no bean found error if I just Maven update then launch.

Or my mapper just looks like this, so doesn't work, if I do a mvn clean install from cmd in the project:

package fr.projettresscientifique.reel.referentielreel.mapper;

import fr.projettresscientifique.reel.referentielreel.model.dto.CapteurDto;
import fr.projettresscientifique.reel.referentielreel.model.java.Capteur;
import fr.projettresscientifique.reel.referentielreel.model.jpa.CapteurJpa;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Component;

/*
@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2023-01-03T09:50:24+0100",
    comments = "version: 1.5.3.Final, compiler: javac, environment: Java 17.0.1 (Eclipse Adoptium)"
)
*/
@Component
public class CapteurMapperImpl implements CapteurMapper {

    @Override
    public Capteur toCapteur(CapteurJpa capteurJpa) {
        if ( capteurJpa == null ) {
            return null;
        }

        Capteur capteur = new Capteur();

        return capteur;
    }

    @Override
    public Capteur toCapteur(CapteurDto capteurDto) {
        if ( capteurDto == null ) {
            return null;
        }

        Capteur capteur = new Capteur();

        return capteur;
    }

    @Override
    public CapteurDto toCapteurDto(Capteur capteur) {
        if ( capteur == null ) {
            return null;
        }

        CapteurDto capteurDto = new CapteurDto();

        return capteurDto;
    }

    @Override
    public CapteurDto toCapteurDto(CapteurJpa capteurJpa) {
        if ( capteurJpa == null ) {
            return null;
        }

        CapteurDto capteurDto = new CapteurDto();

        return capteurDto;
    }

    @Override
    public CapteurJpa toCapteurJpa(Capteur capteur) {
        if ( capteur == null ) {
            return null;
        }

        CapteurJpa capteurJpa = new CapteurJpa();

        return capteurJpa;
    }

    @Override
    public CapteurJpa toCapteurJpa(CapteurDto capteurDto) {
        if ( capteurDto == null ) {
            return null;
        }

        CapteurJpa capteurJpa = new CapteurJpa();

        return capteurJpa;
    }

    @Override
    public List<CapteurDto> toCapteurDto(List<CapteurJpa> capteurJpa) {
        if ( capteurJpa == null ) {
            return null;
        }

        List<CapteurDto> list = new ArrayList<CapteurDto>( capteurJpa.size() );
        for ( CapteurJpa capteurJpa1 : capteurJpa ) {
            list.add( toCapteurDto( capteurJpa1 ) );
        }

        return list;
    }
}
```
<p><strong>Solution:</strong></p>
<p>I found a solution in the end, I was missing Lombok and Lombok-Mapstruct-Binding in my build part of my pom.xml</p>
```package fr.projettresscientifique.reel.referentielreel.model.dto;

import jakarta.annotation.Nonnull;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class CapteurDto {

    @Nonnull
    private Integer id;

    private CoordonneeDto coordonnee;

    private Integer intensite;

}

```0

Title: MapStruct Mapper Bean not found

Body:
I am trying to create a mapper for my Capteur class :

Capteur:

package fr.projettresscientifique.reel.referentielreel.model.java;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class Capteur {

    private Integer id;

    private Coordonnee coordonnee;

    private Integer intensite;

}

CapteurDto:

package fr.projettresscientifique.reel.referentielreel.model.dto;

import jakarta.annotation.Nonnull;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class CapteurDto {

    @Nonnull
    private Integer id;

    private CoordonneeDto coordonnee;

    private Integer intensite;

}

CapteurMapper :

package fr.projettresscientifique.reel.referentielreel.mapper;

import java.util.List;

import org.mapstruct.Mapper;

import fr.projettresscientifique.reel.referentielreel.model.dto.CapteurDto;
import fr.projettresscientifique.reel.referentielreel.model.java.Capteur;
import fr.projettresscientifique.reel.referentielreel.model.jpa.CapteurJpa;

@Mapper(componentModel = "spring")
public interface CapteurMapper {

    Capteur toCapteur(CapteurJpa capteurJpa);

    Capteur toCapteur(CapteurDto capteurDto);

    CapteurDto toCapteurDto(Capteur capteur);

    CapteurDto toCapteurDto(CapteurJpa capteurJpa);

    CapteurJpa toCapteurJpa(Capteur capteur);

    CapteurJpa toCapteurJpa(CapteurDto capteurDto);

    List<CapteurDto> toCapteurDto(List<CapteurJpa> capteurJpa);

}

And have use them all in a Controller with the help of a JpaRepo :

CapteurRepo :

package fr.projettresscientifique.reel.referentielreel.repository;

import java.util.UUID;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import fr.projettresscientifique.reel.referentielreel.model.jpa.CapteurJpa;

@Repository
public interface CapteurRepository extends JpaRepository<CapteurJpa, UUID> {

}

CapteurController:

package fr.projettresscientifique.reel.referentielreel.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import fr.projettresscientifique.reel.referentielreel.mapper.CapteurMapper;
import fr.projettresscientifique.reel.referentielreel.model.dto.CapteurDto;
import fr.projettresscientifique.reel.referentielreel.model.jpa.CapteurJpa;
import fr.projettresscientifique.reel.referentielreel.repository.CapteurRepository;

@RestController
@RequestMapping("/capteur")
public class CapteurController {

    @Autowired
    CapteurRepository capteurRepository;

    @Autowired
    CapteurMapper capteurMapper;

    @GetMapping("/test")
    public List<CapteurDto> getAllCapteur() {

        List<CapteurJpa> listJpa = capteurRepository.findAll();

        List<CapteurDto> listDto = capteurMapper.toCapteurDto(listJpa);

        return listDto;

    }

}

Strangely I get this error:

***************************
APPLICATION FAILED TO START
***************************

Description:

Field capteurMapper in fr.projettresscientifique.reel.referentielreel.controller.CapteurController required a bean of type 'fr.projettresscientifique.reel.referentielreel.mapper.CapteurMapper' that could not be found.

The injection point has the following annotations:
    - @org.springframework.beans.factory.annotation.Autowired(required=true)

Action:

Consider defining a bean of type 'fr.projettresscientifique.reel.referentielreel.mapper.CapteurMapper' in your configuration.

I saw that I had to add a mapstruct plugin and a compilerArg to say to use the springModel

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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.0</version>
        <relativePath />
    </parent>
    <groupId>fr.projettresscientifique.reel</groupId>
    <artifactId>referentiel-reel</artifactId>
    <version>1</version>
    <name>referentiel-reel</name>
    <description>WebServer du Simulateur</description>
    <properties>
        <java.version>17</java.version>
        <org.mapstruct.version>1.5.3.Final</org.mapstruct.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web-services</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <version>1.5.3.Final</version>
        </dependency>

        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-processor</artifactId>
            <version>${org.mapstruct.version}</version>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>6.1.6.Final</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>

                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>${org.mapstruct.version}</version>
                        </path>
                    </annotationProcessorPaths>
                    <compilerArgs>
                        <compilerArg>
                            -Amapstruct.defaultComponentModel=spring
                        </compilerArg>
                    </compilerArgs>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

It works when I do a mvn clean install

But the second there's a maven update (from Eclipse or exemple) it doesn't work again

Any help please ?

Thanks a lot !

Edit 1:

Even with the mvn clean install, I get my implementation:

package fr.projettresscientifique.reel.referentielreel.mapper;

import fr.projettresscientifique.reel.referentielreel.model.dto.CapteurDto;
import fr.projettresscientifique.reel.referentielreel.model.java.Capteur;
import fr.projettresscientifique.reel.referentielreel.model.jpa.CapteurJpa;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Component;

/*
@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2022-12-14T16:58:02+0100",
    comments = "version: 1.5.3.Final, compiler: javac, environment: Java 17.0.1 (Eclipse Adoptium)"
)
*/
@Component
public class CapteurMapperImpl implements CapteurMapper {

    @Override
    public Capteur toCapteur(CapteurJpa capteurJpa) {
        if ( capteurJpa == null ) {
            return null;
        }

        Capteur capteur = new Capteur();

        return capteur;
    }

    @Override
    public Capteur toCapteur(CapteurDto capteurDto) {
        if ( capteurDto == null ) {
            return null;
        }

        Capteur capteur = new Capteur();

        return capteur;
    }

    @Override
    public CapteurDto toCapteurDto(Capteur capteur) {
        if ( capteur == null ) {
            return null;
        }

        CapteurDto capteurDto = new CapteurDto();

        return capteurDto;
    }

    @Override
    public CapteurDto toCapteurDto(CapteurJpa capteurJpa) {
        if ( capteurJpa == null ) {
            return null;
        }

        CapteurDto capteurDto = new CapteurDto();

        return capteurDto;
    }

    @Override
    public CapteurJpa toCapteurJpa(Capteur capteur) {
        if ( capteur == null ) {
            return null;
        }

        CapteurJpa capteurJpa = new CapteurJpa();

        return capteurJpa;
    }

    @Override
    public CapteurJpa toCapteurJpa(CapteurDto capteurDto) {
        if ( capteurDto == null ) {
            return null;
        }

        CapteurJpa capteurJpa = new CapteurJpa();

        return capteurJpa;
    }

    @Override
    public List<CapteurDto> toCapteurDto(List<CapteurJpa> capteurJpa) {
        if ( capteurJpa == null ) {
            return null;
        }

        List<CapteurDto> list = new ArrayList<CapteurDto>( capteurJpa.size() );
        for ( CapteurJpa capteurJpa1 : capteurJpa ) {
            list.add( toCapteurDto( capteurJpa1 ) );
        }

        return list;
    }
}

But it doesn't work when used

Edit 2:

It works after a mvn clean install

But when I try to map from List to List I get this error

Hibernate:
    select
        c1_0.id,
        c1_0.latitude,
        c1_0.longitude,
        c1_0.intensite
    from
        capteurs c1_0
2022-12-14T17:15:52.846+01:00 ERROR 21820 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class fr.projettresscientifique.reel.referentielreel.model.dto.CapteurDto]] with root cause

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class fr.projettresscientifique.reel.referentielreel.model.dto.CapteurDto and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0])
    at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1306) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:408) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:53) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:30) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents(CollectionSerializer.java:145) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:107) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:25) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:400) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1568) ~[jackson-databind-2.14.1.jar:2.14.1]
    at com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:1061) ~[jackson-databind-2.14.1.jar:2.14.1]
    at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:483) ~[spring-web-6.0.2.jar:6.0.2]
    at org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:103) ~[spring-web-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:297) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:194) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:78) ~[spring-web-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:135) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:884) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1080) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:973) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1003) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:895) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:705) ~[tomcat-embed-core-10.1.1.jar:6.0]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:880) ~[spring-webmvc-6.0.2.jar:6.0.2]
    at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:814) ~[tomcat-embed-core-10.1.1.jar:6.0]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:223) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-6.0.2.jar:6.0.2]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.2.jar:6.0.2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-6.0.2.jar:6.0.2]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.2.jar:6.0.2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.0.2.jar:6.0.2]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.2.jar:6.0.2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:119) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:400) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1739) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-10.1.1.jar:10.1.1]
    at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

Edit 3:

With help I realised the problem is coming from the Lombook Getters and Setters.

I added it to the compiler in the pom

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.0</version>
        <relativePath />
    </parent>
    <groupId>fr.projettresscientifique.reel</groupId>
    <artifactId>referentiel-reel</artifactId>
    <version>1</version>
    <name>referentiel-reel</name>
    <description>WebServer du Simulateur</description>
    <properties>
        <java.version>17</java.version>
        <org.mapstruct.version>1.5.3.Final</org.mapstruct.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web-services</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <version>${org.mapstruct.version}</version>
        </dependency>

        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-processor</artifactId>
            <version>${org.mapstruct.version}</version>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>6.1.6.Final</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>${org.mapstruct.version}</version>
                        </path>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>1.18.24</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

And I changed my build path to this:
enter image description here

But I still get either the no bean found error if I just Maven update then launch.

Or my mapper just looks like this, so doesn't work, if I do a mvn clean install from cmd in the project:

package fr.projettresscientifique.reel.referentielreel.mapper;

import fr.projettresscientifique.reel.referentielreel.model.dto.CapteurDto;
import fr.projettresscientifique.reel.referentielreel.model.java.Capteur;
import fr.projettresscientifique.reel.referentielreel.model.jpa.CapteurJpa;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Component;

/*
@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2023-01-03T09:50:24+0100",
    comments = "version: 1.5.3.Final, compiler: javac, environment: Java 17.0.1 (Eclipse Adoptium)"
)
*/
@Component
public class CapteurMapperImpl implements CapteurMapper {

    @Override
    public Capteur toCapteur(CapteurJpa capteurJpa) {
        if ( capteurJpa == null ) {
            return null;
        }

        Capteur capteur = new Capteur();

        return capteur;
    }

    @Override
    public Capteur toCapteur(CapteurDto capteurDto) {
        if ( capteurDto == null ) {
            return null;
        }

        Capteur capteur = new Capteur();

        return capteur;
    }

    @Override
    public CapteurDto toCapteurDto(Capteur capteur) {
        if ( capteur == null ) {
            return null;
        }

        CapteurDto capteurDto = new CapteurDto();

        return capteurDto;
    }

    @Override
    public CapteurDto toCapteurDto(CapteurJpa capteurJpa) {
        if ( capteurJpa == null ) {
            return null;
        }

        CapteurDto capteurDto = new CapteurDto();

        return capteurDto;
    }

    @Override
    public CapteurJpa toCapteurJpa(Capteur capteur) {
        if ( capteur == null ) {
            return null;
        }

        CapteurJpa capteurJpa = new CapteurJpa();

        return capteurJpa;
    }

    @Override
    public CapteurJpa toCapteurJpa(CapteurDto capteurDto) {
        if ( capteurDto == null ) {
            return null;
        }

        CapteurJpa capteurJpa = new CapteurJpa();

        return capteurJpa;
    }

    @Override
    public List<CapteurDto> toCapteurDto(List<CapteurJpa> capteurJpa) {
        if ( capteurJpa == null ) {
            return null;
        }

        List<CapteurDto> list = new ArrayList<CapteurDto>( capteurJpa.size() );
        for ( CapteurJpa capteurJpa1 : capteurJpa ) {
            list.add( toCapteurDto( capteurJpa1 ) );
        }

        return list;
    }
}

Solution:

I found a solution in the end, I was missing Lombok and Lombok-Mapstruct-Binding in my build part of my pom.xml

<annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>${org.projectlombok.version}</version>
                        </path>

                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok-mapstruct-binding</artifactId>
                            <version>0.2.0</version>
                        </path>
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>${org.mapstruct.version}</version>
                        </path>
</annotationProcessorPaths>


问:
`plot_raster` for data with missing stripes
Frequently I want to plot raster data with a lot of missing values, including entire missing rows or columns. Consider the following as a toy example:

```<code>library(ggplot2)

set.seed(50)
d = expand.grid(x = 1:100, y = 1:100)
d$v = rnorm(nrow(d))
d[d$x %in% sample(d$x, 5), "v"] = NA_real_
ggplot() + geom_raster(aes(x, y, fill = v), data = d)
</code>```

This works so far, but what if I want to omit plotting the missing values at all, instead of plotting gray squares for them? If I change data = d to data = d[!is.na(d$v),], then I get the warning "Raster pixels are placed at uneven horizontal intervals and will be shifted. Consider using geom_tile() instead." I don't see a shift in this example, but I worry that if ggplot2 shifts the data, that could lead to squares being plotted at the wrong coordinates for real data. How do I avoid this shifting?

Body:
Frequently I want to plot raster data with a lot of missing values, including entire missing rows or columns. Consider the following as a toy example:

library(ggplot2)

set.seed(50)
d = expand.grid(x = 1:100, y = 1:100)
d$v = rnorm(nrow(d))
d[d$x %in% sample(d$x, 5), "v"] = NA_real_
ggplot() + geom_raster(aes(x, y, fill = v), data = d)

This works so far, but what if I want to omit plotting the missing values at all, instead of plotting gray squares for them? If I change data = d to data = d[!is.na(d$v),], then I get the warning "Raster pixels are placed at uneven horizontal intervals and will be shifted. Consider using geom_tile() instead." I don't see a shift in this example, but I worry that if ggplot2 shifts the data, that could lead to squares being plotted at the wrong coordinates for real data. How do I avoid this shifting?


问:
Terraform Github Provider - Destroy results in 404 not found []
I have built and configured a Github repo using Terraform and the github integration.  Github permissions are course-grained, so I need to give the repo users administrator privs on the repo.  I am also using the "github_repository_file" resource to update a file in the repo.

When attempting a terraform destroy, the plan throws the following error:

```<code> Error: unexpected status code: 404 Not Found
│
│   with module.sciclops.module.gha.github_repository_file.yml_file,
│   on ../terraform-azurerm-sciclops/modules/gha/gha.tf line 27, in resource "github_repository_file" "yml_file":
│   27: resource "github_repository_file" "yml_file" {
</code>```

Tracing the error, I've determined that the user has manually deleted the repo, so of course the repository file no longer exists. I would have expected Terraform to handle tracked (but manually deleted) resources gracefully, and remove the entry from the state file.

Has anyone else run into this issue with the github provider?

I'm seeing something similar documented here: https://github.com/integrations/terraform-provider-github/issues/481

Body:
I have built and configured a Github repo using Terraform and the github integration.  Github permissions are course-grained, so I need to give the repo users administrator privs on the repo.  I am also using the "github_repository_file" resource to update a file in the repo.

When attempting a terraform destroy, the plan throws the following error:

 Error: unexpected status code: 404 Not Found
│
│   with module.sciclops.module.gha.github_repository_file.yml_file,
│   on ../terraform-azurerm-sciclops/modules/gha/gha.tf line 27, in resource "github_repository_file" "yml_file":
│   27: resource "github_repository_file" "yml_file" {

Tracing the error, I've determined that the user has manually deleted the repo, so of course the repository file no longer exists. I would have expected Terraform to handle tracked (but manually deleted) resources gracefully, and remove the entry from the state file.

Has anyone else run into this issue with the github provider?

I'm seeing something similar documented here: https://github.com/integrations/terraform-provider-github/issues/481


问:
How can I rename or edit a User in Databricks
Is it possible to rename or edit a User in Databricks (in Azure) once they have been created?

When I was first given access to Databricks, the admin spelled my last name incorrectly. From that point on, every time I create something it pulls in that incorrect last name. This even happens after changing Azure subscriptions and creating a brand new workspace myself and therefore the Admin. However, I cannot find any option to edit a user, including my own user info.

For example, when I go to create a new cluster, it pulls in the misspelled last name:


问:
Put labels and icons above input
I want to set my labels and icons above and inside the input box. How could I do that?
To be more specific, I'm trying to do an web app with flask (python) where I can register a car rent, where there is the driver of the car, the passenger, the license plate of the car, the date of pick-up and delivery of the car, the pick-up time and the delivery time, the initial and final odometer.

Here is my html code:

```<code><div class="viaturas">
        <h2>Relatório de tráfego</h2>
        <form action="{{ url_for('viaturas') }}" method="post" autocomplete="on">

            <label>Condutor:</label>
            <span class="material-symbols-rounded">badge</span>
            <input type="text" placeholder="CPF" minlength="11" maxlength="11">

            <label>Passageiros:</label>
            <span class="material-symbols-rounded">badge</span>
            <input type="text" placeholder="CPF" minlength="11" maxlength="11">

            <label>Veículo:</label>
            <span class="material-symbols-rounded">pin</span>
            <input type='text' placeholder="Placa do carro" required minlength="7" maxlength="7">

            <label>Data de retirada:</label>
            <span class="material-symbols-rounded">calendar_month</span>
            <input type="date" placeholder="Data">

            <label>Hora de retirada:</label>
            <span class="material-symbols-rounded">update</span>
            <input type="time" placeholder="Hora de retirada">

            <label>Odômetro inicial:</label>
            <span class="material-symbols-rounded">update</span>
            <input type="number" placeholder="Odômetro">

            <label>Odômetro final:</label>
            <span class="material-symbols-rounded">update</span>
            <input type="number" placeholder="Odômetro">

            <label>Kilômetros rodados:</label>
            <span class="material-symbols-rounded">calendar_month</span>
            <input type="number" placeholder="Kilômetros">

            <label>Data de devolução:</label>
            <span class="material-symbols-rounded">calendar_month</span>
            <input type="date" placeholder="Data">

            <label>Hora de devolução:</label>
            <span class="material-symbols-rounded">update</span>
            <input type="time" placeholder="Hora de retirada">

            <input type="submit" value="Cadastrar">
</code>```

And here is my CSS code:

```<code>.viaturas {
    display: flex;
    flex-direction: column;
    justify-content:space-evenly;
}

.viaturas input{
    outline: none;
    border-radius: 15px;
    border: solid 1px #717c8d;
    height: 22pt;
    background-color: #dddbe74f;
    padding-left: 30pt;
    width: 14%;
}

.viaturas span{
    position: relative;
    margin-top: 1.5pt;
    margin-left: 5pt;
}

.viaturas ::placeholder {
    color: #494a5ca6;
}

.viaturas label{
    font-size: 10pt;
    margin-top: 10pt;
}
</code>```

And here is the image of what I want to do:

Title: Put labels and icons above input

Body:
I want to set my labels and icons above and inside the input box. How could I do that?
To be more specific, I'm trying to do an web app with flask (python) where I can register a car rent, where there is the driver of the car, the passenger, the license plate of the car, the date of pick-up and delivery of the car, the pick-up time and the delivery time, the initial and final odometer.

Here is my html code:

Relatório de tráfego

        <form action="{{ url_for('viaturas') }}" method="post" autocomplete="on">

            Condutor:
            badge
            <input type="text" placeholder="CPF" minlength="11" maxlength="11">

            Passageiros:
            badge
            <input type="text" placeholder="CPF" minlength="11" maxlength="11">

            Veículo:
            pin
            <input type='text' placeholder="Placa do carro" required minlength="7" maxlength="7">

            Data de retirada:
            calendar_month
            <input type="date" placeholder="Data">

            Hora de retirada:
            update
            <input type="time" placeholder="Hora de retirada">

            Odômetro inicial:
            update
            <input type="number" placeholder="Odômetro">

            Odômetro final:
            update
            <input type="number" placeholder="Odômetro">

            Kilômetros rodados:
            calendar_month
            <input type="number" placeholder="Kilômetros">

            Data de devolução:
            calendar_month
            <input type="date" placeholder="Data">

            Hora de devolução:
            update
            <input type="time" placeholder="Hora de retirada">

            <input type="submit" value="Cadastrar">

And here is my CSS code:

.viaturas {
    display: flex;
    flex-direction: column;
    justify-content:space-evenly;
}

.viaturas input{
    outline: none;
    border-radius: 15px;
    border: solid 1px #717c8d;
    height: 22pt;
    background-color: #dddbe74f;
    padding-left: 30pt;
    width: 14%;
}

.viaturas span{
    position: relative;
    margin-top: 1.5pt;
    margin-left: 5pt;
}

.viaturas ::placeholder {
    color: #494a5ca6;
}

.viaturas label{
    font-size: 10pt;
    margin-top: 10pt;
}

And here is the image of what I want to do:


问:
REGEXP_SIMILAR in Teradata
I am trying to take out names from a table where name does not contain characters or numbers.

```<code>Name Flag
Abc    0
124    0
£%     1
AB÷    0
17     0
*&     1
</code>```

What function to be used in Teradata to achieve the desired result?

Best,

Title: REGEXP_SIMILAR in Teradata

Body:
I am trying to take out names from a table where name does not contain characters or numbers.

Name Flag
Abc    0
124    0
£%     1
AB÷    0
17     0
*&     1

What function to be used in Teradata to achieve the desired result?

Best,


问:
JAVA Migration from jdk1.7 and weblogic 12c to jdk 1.8 and weblogic 14c
i ve migrate a web application from weblogic 12c and jdk1.7 to weblogic 14c and jdk1.8. The web application use jax-re for rest services and has the following custom JacksonContextProvider for mapping json:

```<code>package eu.sia.mdp.backoffice.common;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.TimeZone;

import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;

/**
 * ObjectMapper settings
 *
 * @author g.palladino
 *
 */
@Provider
@Produces(MediaType.APPLICATION_JSON)
public class JacksonContextResolver implements ContextResolver<ObjectMapper> {
    private final ObjectMapper objectMapper;

    private static final Logger log = LoggerFactory.getLogger( JacksonContextResolver.class );

    public JacksonContextResolver() {
        this.objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL);
//      DATEFORMAT DF = NEW SIMPLEDATEFORMAT("YYYY-MM-DD HH:MM:SS.SSSZ");
//      this.objectMapper.setDateFormat(df);
        this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
        this.objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        this.objectMapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT,true);
        this.objectMapper.getSerializationConfig().getDateFormat().setTimeZone(TimeZone.getTimeZone("CET"));
    }

    @Override
    public ObjectMapper getContext(Class<?> objectType) {

        return null;
    }
}
</code>```

the application, for the webservices, use the jax-rs 2.0.1 and jersey 2.29 provided by server weblogic 14.1.1 (14c). In version built with jdk1.7 and deployed on server weblogic 12c the libraries was not provided by the server but put in pom file without scope provided and the custom ContextResolver was worked fine. Now, with provided libraries, the custom ContextResolver is completely ignored and the webservices return json in a format that is not as i want, for example the dates was in the format 'yyyy-MM-ddTHH:mm:ss.SSSZ' (2022-12-16T11:33:21.123 0100' and now I receive the dates in the format 'yyyy-MM-ddTHH:mm:ss.SSSZ [UTC]' (2022-12-16T11:33:21.123Z [UTC]) and if pass this date to a rest service in my application i have the type mismatch error. Seems that is used the server's ObjectMapper.
could someone help me figure out how to configure the weblogic.xml and/or web.xml files to pass the jax-rs and jersey libraries without provided scope in order to then use the custom ObjectMapper in the class JacksonContextResolver implements ContextResolver ObjectMapper and not the server ObjectMapper???

the current server is Weblogic 14.1.1.

pom file:

```<code><!-- JAX-RS -->
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.0.1</version>
            <scope>provided</scope>
        </dependency>

        <!--<dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.1.1</version>
            <scope>provided</scope>
        </dependency>-->

        <!-- CDI -->
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>

        <!-- Jersey -->
        <dependency>
            <groupId>org.glassfish.jersey.containers</groupId>
            <artifactId>jersey-container-servlet</artifactId>
            <version>${jersey.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-server</artifactId>
            <version>${jersey.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
            <version>${jersey.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-moxy</artifactId>
            <version>${jersey.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-jackson</artifactId>
            <version>${jersey.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.ext</groupId>
            <artifactId>jersey-bean-validation</artifactId>
            <version>${jersey.version}</version>
            <scope>provided</scope>
        </dependency>
</code>```

web.xml

```<code><?xml version="1.0" encoding="UTF-8"?>

<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    metadata-complete="false">

    <servlet>
        <servlet-name>jersey-serlvet</servlet-name>
        <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>jersey.config.server.provider.packages</param-name>
            <param-value>eu.sia.mdp.backoffice</param-value>
        </init-param>
        <init-param>
            <param-name>jersey.config.server.provider.classnames</param-name>
            <param-value>com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider</param-value>
        </init-param>
       <init-param>
            <param-name>jersey.config.server.tracing</param-name>
            <param-value>ALL</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>jersey-serlvet</servlet-name>
        <url-pattern>/services/*</url-pattern>
    </servlet-mapping>

    <mime-mapping>
        <extension>json</extension>
        <mime-type>application/json</mime-type>
    </mime-mapping>

    <resource-ref>
        <description>Database MP</description>
        <res-ref-name>jdbc/MPDB</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>
</web-app>
</code>```

weblogic.xml

```<code><?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="...">

   <container-descriptor>

      <prefer-application-packages>
         <package-name>org.slf4j.*</package-name>
         <package-name>org.apache.commons.logging.*</package-name>
         <package-name>com.sun.jersey.*</package-name>
        <!--<package-name>org.glassfish.jersey.*</package-name>
         <package-name>org.glassfish.hk2.*</package-name>-->
         <package-name>org.jvnet.hk2.*</package-name>
         <!--<package-name>jersey.repackaged.org.objectweb.asm.*</package-name>-->
         <package-name>org.objectweb.asm.*</package-name>
         <package-name>com.sun.ws.rs.ext.*</package-name>
         <!--<package-name>javax.ws.rs.*</package-name>
         <package-name>javax.validation.*</package-name>-->
         <package-name>org.hibernate.validator.*</package-name>
      </prefer-application-packages>

      <prefer-application-resources>
         <resource-name>org/slf4j/impl/StaticLoggerBinder.class</resource-name>
         <resource-name>org.hibernate.validator.*</resource-name>
         <resource-name>javax.validation.*</resource-name>
      </prefer-application-resources>

   </container-descriptor>

   <context-root>mdp-portale-bo</context-root>

   <library-ref>
      <library-name>jax-rs</library-name>
      <specification-version>2.0</specification-version>
      <exact-match>false</exact-match>
   </library-ref>

    <resource-description>
        <res-ref-name>jdbc/MDPDB</res-ref-name>
        <jndi-name>jdbc/MDPDB</jndi-name>
    </resource-description>

</weblogic-web-app>
</code>```

Thanks

Body:
i ve migrate a web application from weblogic 12c and jdk1.7 to weblogic 14c and jdk1.8. The web application use jax-re for rest services and has the following custom JacksonContextProvider for mapping json:

package eu.sia.mdp.backoffice.common;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.TimeZone;

import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;

/**
 * ObjectMapper settings
 *
 * @author g.palladino
 *
 */
@Provider
@Produces(MediaType.APPLICATION_JSON)
public class JacksonContextResolver implements ContextResolver<ObjectMapper> {
    private final ObjectMapper objectMapper;

    private static final Logger log = LoggerFactory.getLogger( JacksonContextResolver.class );

    public JacksonContextResolver() {
        this.objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL);
//      DATEFORMAT DF = NEW SIMPLEDATEFORMAT("YYYY-MM-DD HH:MM:SS.SSSZ");
//      this.objectMapper.setDateFormat(df);
        this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
        this.objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        this.objectMapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT,true);
        this.objectMapper.getSerializationConfig().getDateFormat().setTimeZone(TimeZone.getTimeZone("CET"));
    }

    @Override
    public ObjectMapper getContext(Class<?> objectType) {

        return null;
    }
}

the application, for the webservices, use the jax-rs 2.0.1 and jersey 2.29 provided by server weblogic 14.1.1 (14c). In version built with jdk1.7 and deployed on server weblogic 12c the libraries was not provided by the server but put in pom file without scope provided and the custom ContextResolver was worked fine. Now, with provided libraries, the custom ContextResolver is completely ignored and the webservices return json in a format that is not as i want, for example the dates was in the format 'yyyy-MM-ddTHH:mm:ss.SSSZ' (2022-12-16T11:33:21.123 0100' and now I receive the dates in the format 'yyyy-MM-ddTHH:mm:ss.SSSZ [UTC]' (2022-12-16T11:33:21.123Z [UTC]) and if pass this date to a rest service in my application i have the type mismatch error. Seems that is used the server's ObjectMapper.
could someone help me figure out how to configure the weblogic.xml and/or web.xml files to pass the jax-rs and jersey libraries without provided scope in order to then use the custom ObjectMapper in the class JacksonContextResolver implements ContextResolver ObjectMapper and not the server ObjectMapper???

the current server is Weblogic 14.1.1.

pom file:

        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.0.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jersey.containers</groupId>
            <artifactId>jersey-container-servlet</artifactId>
            <version>${jersey.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-server</artifactId>
            <version>${jersey.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
            <version>${jersey.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-moxy</artifactId>
            <version>${jersey.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-jackson</artifactId>
            <version>${jersey.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.ext</groupId>
            <artifactId>jersey-bean-validation</artifactId>
            <version>${jersey.version}</version>
            <scope>provided</scope>
        </dependency>

web.xml

<?xml version="1.0" encoding="UTF-8"?>

<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    metadata-complete="false">

    <servlet>
        <servlet-name>jersey-serlvet</servlet-name>
        <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>jersey.config.server.provider.packages</param-name>
            <param-value>eu.sia.mdp.backoffice</param-value>
        </init-param>
        <init-param>
            <param-name>jersey.config.server.provider.classnames</param-name>
            <param-value>com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider</param-value>
        </init-param>
       <init-param>
            <param-name>jersey.config.server.tracing</param-name>
            <param-value>ALL</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>jersey-serlvet</servlet-name>
        <url-pattern>/services/*</url-pattern>
    </servlet-mapping>

    <mime-mapping>
        <extension>json</extension>
        <mime-type>application/json</mime-type>
    </mime-mapping>

    <resource-ref>
        <description>Database MP</description>
        <res-ref-name>jdbc/MPDB</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>
</web-app>

weblogic.xml

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="...">

   <container-descriptor>

      <prefer-application-packages>
         <package-name>org.slf4j.*</package-name>
         <package-name>org.apache.commons.logging.*</package-name>
         <package-name>com.sun.jersey.*</package-name>

         <package-name>org.jvnet.hk2.*</package-name>

         <package-name>org.objectweb.asm.*</package-name>
         <package-name>com.sun.ws.rs.ext.*</package-name>

         <package-name>org.hibernate.validator.*</package-name>
      </prefer-application-packages>

      <prefer-application-resources>
         <resource-name>org/slf4j/impl/StaticLoggerBinder.class</resource-name>
         <resource-name>org.hibernate.validator.*</resource-name>
         <resource-name>javax.validation.*</resource-name>
      </prefer-application-resources>

   </container-descriptor>

   <context-root>mdp-portale-bo</context-root>

   <library-ref>
      <library-name>jax-rs</library-name>
      <specification-version>2.0</specification-version>
      <exact-match>false</exact-match>
   </library-ref>

    <resource-description>
        <res-ref-name>jdbc/MDPDB</res-ref-name>
        <jndi-name>jdbc/MDPDB</jndi-name>
    </resource-description>

</weblogic-web-app>

Thanks


问:
How do i fix VLC importing issues? (Python 3.6)
I am trying to make a simple youtube video player, however i am having issues i dont know how to deal with.
code:

```<code>import vlc
import pafy
#################################################
url = "https://www.youtube.com/c/pyrocynicalvevo"
video = pafy.new(url)
best = video.getbest()
media = vlc.MediaPlayer(best.url)
media.play()
</code>```

error:

```<code>Traceback (most recent call last):
  File "C:\Users\xxxx\Desktop\RUBY\ythandler.py", line 1, in <module>
    import vlc
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\vlc.py", line 220, in <module>
    dll, plugin_path  = find_lib()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\vlc.py", line 180, in find_lib
    dll = ctypes.CDLL('.\\' + libname)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 344, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
</code>```

im on 64 bit windows 11 pc running the code on sublime.

any help is greatly appreciated. i did pip install pafy and pip install python-vlc, aswell as pip3 install python-vlc

Body:
I am trying to make a simple youtube video player, however i am having issues i dont know how to deal with.
code:

import vlc
import pafy
#################################################
url = "https://www.youtube.com/c/pyrocynicalvevo"
video = pafy.new(url)
best = video.getbest()
media = vlc.MediaPlayer(best.url)
media.play()

error:

Traceback (most recent call last):
  File "C:\Users\xxxx\Desktop\RUBY\ythandler.py", line 1, in <module>
    import vlc
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\vlc.py", line 220, in <module>
    dll, plugin_path  = find_lib()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python36\lib\site-packages\vlc.py", line 180, in find_lib
    dll = ctypes.CDLL('.\\' + libname)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 344, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

im on 64 bit windows 11 pc running the code on sublime.

any help is greatly appreciated. i did pip install pafy and pip install python-vlc, aswell as pip3 install python-vlc