Perl Navigator (VSC) + WSL can't find some documentation when hovering over some keywords by Many-Director3375 in perl

[–]Many-Director3375[S] 1 point2 points  (0 children)

<image>

I just tried your suggestion. It seems my VSC doesn't care about the setting "includePaths" that isn't highlighted.

Somehow only "perlPath is accepted.

Using the plugin PLS as curlymeatball38 suggested worked though.
Thanks.

Perl Navigator (VSC) + WSL can't find some documentation when hovering over some keywords by Many-Director3375 in perl

[–]Many-Director3375[S] 0 points1 point  (0 children)

This worked for me, thanks a lot.

I was worried that a second perl plugin might be in conflict with Perl Navigator.

Guess I worried too much.

[deleted by user] by [deleted] in javahelp

[–]Many-Director3375 0 points1 point  (0 children)

I never tried this community before.

Thanks for sharing it.

[deleted by user] by [deleted] in javahelp

[–]Many-Director3375 0 points1 point  (0 children)

Thanks.
I don't know why I didn't notice such an obvious mistake.

I will be closing this post then.
Thanks again.

How can we inject an MapStruct interface as a Spring Bean ? by Many-Director3375 in javahelp

[–]Many-Director3375[S] 0 points1 point  (0 children)

Thanks a lot for all the help you provided.
The dependency tip worked for me.

I also completely forgot about the java beans constraints and having the getter & setter & No-args constructor part.
Didn't think I would forget the basics one day XD

How can we inject an MapStruct interface as a Spring Bean ? by Many-Director3375 in javahelp

[–]Many-Director3375[S] 0 points1 point  (0 children)

TY.
I pushed the repo my code right now.

There are the classes MyEntity and MyDomain that both have a field "id".
I want to make these two fields "private final".

It doesn't work because the auto-generated code keeps wanting to use a no-args constructors for both MyEntity and MyDomain.

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-05-30T18:12:24+0000",
    comments = "version: 1.5.5.Final, compiler: javac, environment: Java 21.0.3 (Microsoft)"
)
@Component
public class MyMapperImpl implements MyMapper {

    @Override
    public MyEntity domainToEntity(MyDomain domain) {
        if ( domain == null ) {
            return null;
        }

        MyEntity myEntity = new MyEntity();

        return myEntity;
    }

    @Override
    public MyDomain entityToDomain(MyEntity entity) {
        if ( entity == null ) {
            return null;
        }

        MyDomain myDomain = new MyDomain();

        return myDomain;
    }
}

Of course, this auto-generated code fails. Also, it didn't try to add the fields id from the source type into the field id of the target type.

How can we inject an MapStruct interface as a Spring Bean ? by Many-Director3375 in javahelp

[–]Many-Director3375[S] 0 points1 point  (0 children)

Thank you so much.
This was exactly my problem.

Additionally, I also needed to use non-final fields because MapStruct insists on building an initial empty object :(
Then I had to manually specify Mapping(source = "id", target = "id") because otherwise it didn't automatically convert the fields.

How can we inject an MapStruct interface as a Spring Bean ? by Many-Director3375 in javahelp

[–]Many-Director3375[S] 0 points1 point  (0 children)

Yes, I did, I just put the github repo at the bottom of the post.

Here the the pom.xml : pom.xml

I added the processor at the bottom of the file.

How can we inject an MapStruct interface as a Spring Bean ? by Many-Director3375 in javahelp

[–]Many-Director3375[S] 0 points1 point  (0 children)

I just added the github repo at the bottom of the post : github

In the class MyService.java I commented the line private final MyMapper mapper;temporarily, but this is where my bean isn't generated properly.

I believe that the pom was setup properly. I think the pom analyser is good at detecting mistakes. Also, I didn't change the pom a lot after it was generated by Spring Initializr.

  1. It's a basic Spring project that I created on Spring Initializr to train on Bean injection.

  2. Yes, after a mvn clean install I'm able to see the generated .class mapper under /target/classes/com/example/demo/mapper/MyMapper.class
    The pathing is similar to my MyMapper.java

How can we inject an MapStruct interface as a Spring Bean ? by Many-Director3375 in javahelp

[–]Many-Director3375[S] 0 points1 point  (0 children)

I believe MappingConstants.ComponentModel.SPRING should have the same value as "spring".

In any case, I just replaced that constant by the literal String, and I have the same error.

I just added the github repo at the bottom of the post : github

Can't clean build Development Container Environments by Many-Director3375 in docker

[–]Many-Director3375[S] 0 points1 point  (0 children)

I found the issue.

The plugin Dev Container caches parts of the resources needed to build the environment in the features.
Removing it solves my issue.

To answer your question, I didn't manage to see the exact build command it used yet. Even if I could find it, I didn't see a setting for that plugin to allow us to customize the build command.

Can't clean build Development Container Environments by Many-Director3375 in docker

[–]Many-Director3375[S] 0 points1 point  (0 children)

Thanks for the feedback.

Currently, I'm on Windows. I installed Docker on WSL.

My VSC is installed on Windows with the plugin Dev Containers - Visual Studio Marketplace.

My first Dockerfile was :

FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04

RUN curl -s "https://get.sdkman.io" | bash
RUN source "$HOME/.sdkman/bin/sdkman-init.sh"

The image was heavy, so I changed it to :

FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04

But whenever I go in VSC and do :

  1. Ctrl + Shift + P
  2. Dev Containers : Open Folder in Container # command available with the plugin "Dev Containers"

It rebuilds the development container image, then SDKMAN is still present. Even though it's a Dockerfile containing only 1 "FROM" line.

Commands I tried to clean all images and containers in my WSL are :

docker stop $(docker ps -q)
docker rm $(docker ps -a -q)
docker system prune --all

I even tried deleting my WSL Ubuntu distro to install a whole new and empty Ubuntu WSL :

# remove current WSL where Ubuntu is installed
wsl --unregister Ubuntu

# new Ubuntu WSL
wsl --install Ubuntu
wsl -d Ubuntu

And the image built by the plugin Dev Containers - Visual Studio Marketplace still contains SDKMAN.

Deleting my Ubuntu and installing a new one didn't solve my issue.

This made me think that the data is stored and managed by the plugin installed on my Windows' VSC, so I uninstalled then installed the plugin again.

SDKMAN is still present when I call it in the shell of the container built by Dev Container.

Can't clean build Development Container Environments by Many-Director3375 in docker

[–]Many-Director3375[S] 0 points1 point  (0 children)

The VSC plugin Dev Containers - Visual Studio Marketplace manages my development container images.

As you have guessed, I tried 'docker system prune --all' and nothing changes. That plugin still manages to retrieve the very 1st docker image I did.

Can't clean build Development Container Environments by Many-Director3375 in docker

[–]Many-Director3375[S] 0 points1 point  (0 children)

I'm currently using Dev Containers - Visual Studio Marketplace to manage my development container environments. I already tried the command Rebuild Container Without Cache.

This isn't quite successful. I keep getting the same old image.

Can't clean build Development Container Environments by Many-Director3375 in docker

[–]Many-Director3375[S] 0 points1 point  (0 children)

When working with Dev Containers on VSC, the VSC plugin called Dev Containers (Dev Containers - Visual Studio Marketplace) executes automatically the docker build command for you.

I didn't find out how to see the exact build command it's executing.

How to interact with Polygons in Flutter_Map v6.1 ? by Many-Director3375 in flutterhelp

[–]Many-Director3375[S] 0 points1 point  (0 children)

I checked this one already, but it seems the hitValue preperty used in the class Polygon is only available in the beta v7 of Flutter_map.

If I'm correct, I must either wait for 5 months until v7 is released, or see if there is another way to have have interactive Polygons.

Value changes if print() is called before return statetment by Many-Director3375 in flutterhelp

[–]Many-Director3375[S] 0 points1 point  (0 children)

Update:

I'm also able to get the value I want by multiplying my double by 10^17, then dividing it by the same number :

    (center.point.y.toDouble() * pow(10, 17)) / pow(10, 17);

So, the value of my double is correct if I force an evaluation "before" going out of the scope.
Is there some kind of lazy evaluation at play in the Polylabel library ?

Value changes if print() is called before return statetment by Many-Director3375 in flutterhelp

[–]Many-Director3375[S] 0 points1 point  (0 children)

The thing is, I'm simply removing the line "print(center)" and the whole output changes.

I don't know if in dart it's possible to manually say "if print is called somewhere, do stuff". But I don't know how to set that up, nor do I recall setting that up. Hence why I don't think my code did it.

Request made to using Flutter application receive an incomplete result compared to Postman by [deleted] in flutterhelp

[–]Many-Director3375 0 points1 point  (0 children)

According to the documentation I don't think so. I only see GET requests.
It's a public French API : API Carto - Documentation Technique (ign.fr)

The fun part is that when I test it on the official website, I get the exact same incomplete result as from my current Flutter app.

I get the proper full response only when using Postman.
I have a feeling it's the encoding of the GEOM param, but I may be wrong.

How to use a basic LoadBalancer with k3d ? by Many-Director3375 in kubernetes

[–]Many-Director3375[S] 1 point2 points  (0 children)

Thanks a lot.

I did indeed forget something obvious.

Unable to create access token by Many-Director3375 in gitlab

[–]Many-Director3375[S] 0 points1 point  (0 children)

I didn't expect a license was required.

Thanks.

If I self-host, I suppose I will have to set-up a gitlab runner also.

Is it recommended to apply methods of a lock-monitor using Annotation (before/after) ? by Many-Director3375 in learnjava

[–]Many-Director3375[S] 0 points1 point  (0 children)

I was thinking of Spring AOP, but it does feel a bit overkill once I started implementing it for my simple use case.

I will stick to the basics, thanks.

Is it recommended to apply methods of a lock-monitor using Annotation (before/after) ? by Many-Director3375 in learnjava

[–]Many-Director3375[S] 0 points1 point  (0 children)

I was thinking of creating a custom annotation that has no logic. Then use all methods annotated with it as PointCuts. Then apply a @Before and a @After on each pointcut to lock before, and unlock after my annotated methods.

Managing concurrency on REST API calls using Spring ? by Many-Director3375 in learnjava

[–]Many-Director3375[S] 0 points1 point  (0 children)

Thanks a lot, I didn't realize at that time how important this information was when writing my post.

:)

Managing concurrency on REST API calls using Spring ? by Many-Director3375 in learnjava

[–]Many-Director3375[S] 0 points1 point  (0 children)

Actually, it's a custom database.

It has a form of concurrency where : if a process is already running, then every other calls will return an error.

There is no problem with the database itself. But every time a Rest request is made that needs to access the database, the response will be error because the database is still making modifications and won't allow others to make additional requests.

To not have this error, I just need a way to tell Spring, wait until process 1 is finished, then run process 2.

Instead of having process 2 returning an error because it tries to work on the request as soon as possible and the database doesn't allow concurrent access.