问:
Minecraft overlay doesn't appear (1.7.10)
I would like some help with my mod I am doing in version 1.7.10.
I made an overlay that is displayed when the player wins exp in his job(so an ExtendedEntityProperties) I made a feature that with a boolean display message = true to run it when the player wins the exp and displays the overlay unless it is not displayed. Here is the code of the extendedentity and the superposition.

ExtendedEntityProperties:

```<code>package fr.valerium.valemod.jobs;

import java.util.HashMap;

import cpw.mods.fml.common.network.simpleimpl.IMessage;
import fr.valerium.valemod.ModVale;
import fr.valerium.valemod.jobs.Tasks.Tasks;
import fr.valerium.valemod.packets.PacketJobs;
import fr.valerium.valemod.utils.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.common.IExtendedEntityProperties;

public class JobManager implements IExtendedEntityProperties {

    public final static String EXT_PROP_JOB = "ExtPropJob";

    private final EntityPlayer player;

    public HashMap<String, Integer> levels;
    public HashMap<String, Integer> experience;
    public HashMap<String, Long> maxExperience;

    public static final int MINER = 1;
    public static final int FARMER = 2;
    public static final int HUNTER = 3;
    public static final int ALCHIMIST = 4;

    public static final String MINER_NAME = "miner";
    public static final String FARMER_NAME = "farmer";
    public static final String HUNTER_NAME = "hunter";
    public static final String ALCHIMIST_NAME = "alchimist";

    public static final int MAX_LEVEL = 20;

    Overlay overlay = new Overlay();

    public JobManager(EntityPlayer player) {
        this.player = player;

        this.levels = new HashMap<String, Integer>();
        this.experience = new HashMap<String, Integer>();
        this.maxExperience = new HashMap<String, Long>();

        this.levels.put(MINER_NAME, 1);
        this.experience.put(MINER_NAME, 0);
        this.maxExperience.put(MINER_NAME, 200000L);

        this.levels.put(FARMER_NAME, 1);
        this.experience.put(FARMER_NAME, 0);
        this.maxExperience.put(FARMER_NAME, 200000L);

        this.levels.put(HUNTER_NAME, 1);
        this.experience.put(HUNTER_NAME, 0);
        this.maxExperience.put(HUNTER_NAME, 200000L);

        this.levels.put(ALCHIMIST_NAME, 1);
        this.experience.put(ALCHIMIST_NAME, 0);
        this.maxExperience.put(ALCHIMIST_NAME, 200000L);
    }

    public void sync() {
        PacketJobs packet = new PacketJobs(levels, experience, maxExperience);
        ModVale.network.sendToServer((IMessage) packet);
    }

    public static final void register(EntityPlayer player) {
        player.registerExtendedProperties(JobManager.EXT_PROP_JOB, new JobManager(player));
    }

    public static final JobManager get(EntityPlayer player) {
        return (JobManager) player.getExtendedProperties(EXT_PROP_JOB);

    }

    @Override
    public void saveNBTData(NBTTagCompound compound) {
        NBTTagCompound properties = new NBTTagCompound();

        for (String job : levels.keySet()) {
            properties.setInteger(job + "Level", levels.get(job));
            properties.setInteger(job + "Experience", experience.get(job));
            properties.setLong(job + "MaxExperience", maxExperience.get(job));
        }

        sync();

        compound.setTag(EXT_PROP_JOB, properties);
    }

    @Override
    public void loadNBTData(NBTTagCompound compound) {
        NBTTagCompound properties = (NBTTagCompound) compound.getTag(EXT_PROP_JOB);

        for (String job : levels.keySet()) {
            levels.put(job, properties.getInteger(job + "Level"));
            experience.put(job, properties.getInteger(job + "Experience"));
            maxExperience.put(job, properties.getLong(job + "MaxExperience"));
        }

        sync();
    }

    @Override
    public void init(Entity entity, World world) {
    }

    public int getLevel(String job) {
        Integer level = levels.get(job);
        return level == null ? 0 : level;
    }

    public void setLevel(String job, int level) {
        levels.put(job, level);
        sync();
    }

    public int getExperience(String job) {
        Integer exp = experience.get(job);
        return exp == null ? 0 : exp;
    }

    public void setExperience(String job, int exp) {
        experience.put(job, exp);
        sync();
    }

    public long getMaxExperience(String job) {
        Long maxExp = maxExperience.get(job);
        return maxExp == null ? 0 : maxExp;
    }

    public void setMaxExperience(String job, long maxExp) {
        maxExperience.put(job, maxExp);
        sync();
    }

    public void addExperience(String jobName, int xp) {
        int currentXp = experience.get(jobName);
        int newXp = currentXp + xp;
        int level = levels.get(jobName);
        long maxXp = maxExperience.get(jobName);
        while (newXp >= maxXp && level < MAX_LEVEL) {
            newXp -= maxXp;
            level++;
            maxXp = (long) (maxXp * 1.5);
        }

        Tasks task = Utils.tasks.get(jobName);
        overlay.setTask(task, xp);

        levels.put(jobName, level);
        experience.put(jobName, newXp);
        maxExperience.put(jobName, maxXp);
        sync();
    }

}
</code>```

Overlay :

```<code>package fr.valerium.valemod.events;

import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import fr.valerium.valemod.jobs.Tasks.Tasks;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.RenderGameOverlayEvent;

public class OverlayRenderer {

    private static final int DISPLAY_DURATION = 20 * 2; // 20 ticks par seconde, durée de 2 secondes
    private int timer = 0;
    private boolean displayMessage = true;
    private String message = "Ceci est un overlay avec du texte.";
    Tasks task;
    private int xp;

    @SubscribeEvent
    public void renderOverlay(RenderGameOverlayEvent.Text event) {
        if (displayMessage) {
            FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
            // affiche le message en haut à droite de l'écran du joueur
            fontRenderer.drawString(message, event.resolution.getScaledWidth() - fontRenderer.getStringWidth(message) - 5, 5, 0xFFFFFF);
            timer++;
            if (timer > DISPLAY_DURATION) {
                displayMessage = false;
                timer = 0;
            }
        }
    }

    public void setTask(Tasks task, int xp) {
        displayMessage = true;
        this.task = task;
        this.xp = xp;
        timer = 0;
    }
}
</code>```

I tried to insert system.out.println(); everywhere and everything is good.
The overlay is instantiated, by default it is not displayed but if I make it display by default it works but not when I make it appear when we win from the exp.

Body:
I would like some help with my mod I am doing in version 1.7.10.
I made an overlay that is displayed when the player wins exp in his job(so an ExtendedEntityProperties) I made a feature that with a boolean display message = true to run it when the player wins the exp and displays the overlay unless it is not displayed. Here is the code of the extendedentity and the superposition.

ExtendedEntityProperties:

package fr.valerium.valemod.jobs;

import java.util.HashMap;

import cpw.mods.fml.common.network.simpleimpl.IMessage;
import fr.valerium.valemod.ModVale;
import fr.valerium.valemod.jobs.Tasks.Tasks;
import fr.valerium.valemod.packets.PacketJobs;
import fr.valerium.valemod.utils.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.common.IExtendedEntityProperties;

public class JobManager implements IExtendedEntityProperties {

    public final static String EXT_PROP_JOB = "ExtPropJob";

    private final EntityPlayer player;

    public HashMap<String, Integer> levels;
    public HashMap<String, Integer> experience;
    public HashMap<String, Long> maxExperience;

    public static final int MINER = 1;
    public static final int FARMER = 2;
    public static final int HUNTER = 3;
    public static final int ALCHIMIST = 4;

    public static final String MINER_NAME = "miner";
    public static final String FARMER_NAME = "farmer";
    public static final String HUNTER_NAME = "hunter";
    public static final String ALCHIMIST_NAME = "alchimist";

    public static final int MAX_LEVEL = 20;

    Overlay overlay = new Overlay();

    public JobManager(EntityPlayer player) {
        this.player = player;

        this.levels = new HashMap<String, Integer>();
        this.experience = new HashMap<String, Integer>();
        this.maxExperience = new HashMap<String, Long>();

        this.levels.put(MINER_NAME, 1);
        this.experience.put(MINER_NAME, 0);
        this.maxExperience.put(MINER_NAME, 200000L);

        this.levels.put(FARMER_NAME, 1);
        this.experience.put(FARMER_NAME, 0);
        this.maxExperience.put(FARMER_NAME, 200000L);

        this.levels.put(HUNTER_NAME, 1);
        this.experience.put(HUNTER_NAME, 0);
        this.maxExperience.put(HUNTER_NAME, 200000L);

        this.levels.put(ALCHIMIST_NAME, 1);
        this.experience.put(ALCHIMIST_NAME, 0);
        this.maxExperience.put(ALCHIMIST_NAME, 200000L);
    }

    public void sync() {
        PacketJobs packet = new PacketJobs(levels, experience, maxExperience);
        ModVale.network.sendToServer((IMessage) packet);
    }

    public static final void register(EntityPlayer player) {
        player.registerExtendedProperties(JobManager.EXT_PROP_JOB, new JobManager(player));
    }

    public static final JobManager get(EntityPlayer player) {
        return (JobManager) player.getExtendedProperties(EXT_PROP_JOB);

    }

    @Override
    public void saveNBTData(NBTTagCompound compound) {
        NBTTagCompound properties = new NBTTagCompound();

        for (String job : levels.keySet()) {
            properties.setInteger(job + "Level", levels.get(job));
            properties.setInteger(job + "Experience", experience.get(job));
            properties.setLong(job + "MaxExperience", maxExperience.get(job));
        }

        sync();

        compound.setTag(EXT_PROP_JOB, properties);
    }

    @Override
    public void loadNBTData(NBTTagCompound compound) {
        NBTTagCompound properties = (NBTTagCompound) compound.getTag(EXT_PROP_JOB);

        for (String job : levels.keySet()) {
            levels.put(job, properties.getInteger(job + "Level"));
            experience.put(job, properties.getInteger(job + "Experience"));
            maxExperience.put(job, properties.getLong(job + "MaxExperience"));
        }

        sync();
    }

    @Override
    public void init(Entity entity, World world) {
    }

    public int getLevel(String job) {
        Integer level = levels.get(job);
        return level == null ? 0 : level;
    }

    public void setLevel(String job, int level) {
        levels.put(job, level);
        sync();
    }

    public int getExperience(String job) {
        Integer exp = experience.get(job);
        return exp == null ? 0 : exp;
    }

    public void setExperience(String job, int exp) {
        experience.put(job, exp);
        sync();
    }

    public long getMaxExperience(String job) {
        Long maxExp = maxExperience.get(job);
        return maxExp == null ? 0 : maxExp;
    }

    public void setMaxExperience(String job, long maxExp) {
        maxExperience.put(job, maxExp);
        sync();
    }

    public void addExperience(String jobName, int xp) {
        int currentXp = experience.get(jobName);
        int newXp = currentXp + xp;
        int level = levels.get(jobName);
        long maxXp = maxExperience.get(jobName);
        while (newXp >= maxXp && level < MAX_LEVEL) {
            newXp -= maxXp;
            level++;
            maxXp = (long) (maxXp * 1.5);
        }

        Tasks task = Utils.tasks.get(jobName);
        overlay.setTask(task, xp);

        levels.put(jobName, level);
        experience.put(jobName, newXp);
        maxExperience.put(jobName, maxXp);
        sync();
    }

}

Overlay :

package fr.valerium.valemod.events;

import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import fr.valerium.valemod.jobs.Tasks.Tasks;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.RenderGameOverlayEvent;

public class OverlayRenderer {

    private static final int DISPLAY_DURATION = 20 * 2; // 20 ticks par seconde, durée de 2 secondes
    private int timer = 0;
    private boolean displayMessage = true;
    private String message = "Ceci est un overlay avec du texte.";
    Tasks task;
    private int xp;

    @SubscribeEvent
    public void renderOverlay(RenderGameOverlayEvent.Text event) {
        if (displayMessage) {
            FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
            // affiche le message en haut à droite de l'écran du joueur
            fontRenderer.drawString(message, event.resolution.getScaledWidth() - fontRenderer.getStringWidth(message) - 5, 5, 0xFFFFFF);
            timer++;
            if (timer > DISPLAY_DURATION) {
                displayMessage = false;
                timer = 0;
            }
        }
    }

    public void setTask(Tasks task, int xp) {
        displayMessage = true;
        this.task = task;
        this.xp = xp;
        timer = 0;
    }
}

I tried to insert system.out.println(); everywhere and everything is good.
The overlay is instantiated, by default it is not displayed but if I make it display by default it works but not when I make it appear when we win from the exp.


来源: stackexchange

问:
create a sql view in laravel and convert a legacy sql query to new synthax
i got a form and i need to connect two tables and get the sum of one value of the two tables and display it in a mysql view. i saw in a sql legacy to laravel sql converter that i should use sum between '' , if i dont do it the values are not well summed, and if i use them it gives synthax error, how to do it well?

->with([
    'form' => DB::table('form')
        ->select('repair.valor', DB::raw("'SUM'(valor) as totalValor"))
        ->join('repair','form.carPlate','=','repair.carPlate')
        ->get()
]);
}
```

ContentLicense: CC BY-SA 4.0


问:
Computing Aliases while creating the Index Template in Elastic Search 8.x
I have created the index template in elastic search 8.5.3. Here, I need the alias creation with a dynamic name.

For example, if the index name is, es.contact100 then the alias should be as.contact100.model.

I used this one,

{ "as-{index}": {} }

But, the output is, as-es.contact100

Please help me to resolve this.


问:
Find Bytes processed by SSISDB job on SQL Server Management Studio
Using SQL Server Management Studio, I am trying to gauge how many Bytes of data are being processed by SSIS packages. I know how to generate reports in Integration Services Catalogs to view statistics and messages, but these seem to only give statistics on time duration. The following is a sample of the Execution Performance statistics that are provided. Is there a way to view the number of Bytes that were read/written for each package?

```<code>ID:05050505      Start Time: 1/5/2023 1:24:06 AM  Duration(sec): 2051.417
</code>```

At present I don't have direct access to the server logs.

Body:
Using SQL Server Management Studio, I am trying to gauge how many Bytes of data are being processed by SSIS packages. I know how to generate reports in Integration Services Catalogs to view statistics and messages, but these seem to only give statistics on time duration. The following is a sample of the Execution Performance statistics that are provided. Is there a way to view the number of Bytes that were read/written for each package?

ID:05050505      Start Time: 1/5/2023 1:24:06 AM  Duration(sec): 2051.417

At present I don't have direct access to the server logs.


问:
How to add a column to a dataframe with values calculated by aggregating previous group of rows
I wanted to add a column to a dataframe with aggregated values of previous group of rows.

Below code is working but it is very slow.

Building relevant dataframes/dataseries and map/merge them will probably speed up the process. However, I was wondering if there are other function/method that I can utilize that can make it faster.

I tried to add column using groupby.get_group.agg  (note: past 90 records excluded --- for trial code), but didnt succeed.

```<code>df_filtered.groupby(['id_stock', 'trend_count']).get_group(df_filtered['id_stock'], df_filtered['trend_count']-1)['Group Index'].min()
</code>```

For add'l info:

The code below first create a virtual filtered table with the following conditions:

Previous trend group

last 90 records

same id_stock

same ref_Price

After building the filtered table, aggregation applied to 'Group Index'. This function will do it every row (probably reason why it is slow)

Im new to python, my reference of coding is based on DAX (powerbi). In DAX, this seems to work fine. But I know python is much faster, probably just need to know how to do it properly.

```<code>def prev_ref_index(row):
    trend_count_prev = row['trend_count'] - 1
    start_row = row['Group Index'] - 90
    end_row = row['Group Index']
    ref_Price = row['prev_ref_price_adj']
    stock = row['id_stock']

    prev_index = df_filtered.loc[ ( (df_filtered['trend_count'] == trend_count_prev) | ( (df_filtered['Group Index'] >= start_row) & (df_filtered['Group Index'] <= end_row) ) ) & (df_filtered['Price'] == ref_Price) & (df_filtered['id_stock'] == stock), 'Group Index' ].min()
    return prev_index

df_filtered['prev_ref_group_index'] = df_filtered.apply(prev_ref_index, axis=1)
</code>```

See below sample data:

in first group of id_stock(A00134), Group Index 4 was fetch as it meets all the conditions:

same stock

price and prev_ref_price_adj match

previous trend_count group

within last 90 days record

MIN Group Index

Body:
I wanted to add a column to a dataframe with aggregated values of previous group of rows.

Below code is working but it is very slow.

Building relevant dataframes/dataseries and map/merge them will probably speed up the process. However, I was wondering if there are other function/method that I can utilize that can make it faster.

I tried to add column using groupby.get_group.agg  (note: past 90 records excluded --- for trial code), but didnt succeed.

df_filtered.groupby(['id_stock', 'trend_count']).get_group(df_filtered['id_stock'], df_filtered['trend_count']-1)['Group Index'].min()

For add'l info:

The code below first create a virtual filtered table with the following conditions:

Previous trend group

last 90 records

same id_stock

same ref_Price

After building the filtered table, aggregation applied to 'Group Index'. This function will do it every row (probably reason why it is slow)

Im new to python, my reference of coding is based on DAX (powerbi). In DAX, this seems to work fine. But I know python is much faster, probably just need to know how to do it properly.

def prev_ref_index(row):
    trend_count_prev = row['trend_count'] - 1
    start_row = row['Group Index'] - 90
    end_row = row['Group Index']
    ref_Price = row['prev_ref_price_adj']
    stock = row['id_stock']

    prev_index = df_filtered.loc[ ( (df_filtered['trend_count'] == trend_count_prev) | ( (df_filtered['Group Index'] >= start_row) & (df_filtered['Group Index'] <= end_row) ) ) & (df_filtered['Price'] == ref_Price) & (df_filtered['id_stock'] == stock), 'Group Index' ].min()
    return prev_index

df_filtered['prev_ref_group_index'] = df_filtered.apply(prev_ref_index, axis=1)

See below sample data:

in first group of id_stock(A00134), Group Index 4 was fetch as it meets all the conditions:

same stock

price and prev_ref_price_adj match

previous trend_count group

within last 90 days record

MIN Group Index


问:
I don't know how to use Pytorch to differentiate the inference results of a neural network
I would like to perform automatic differentiation on a trained model, for example Physics-informed Neural Networks (PINNs), where the input variables x1,x2 are defined on the model when defining the model, but in my trained model I have such x1,x2 I have not defined the I simply define two input variables as nn.Linear(2, 16).
Is it possible to do automatic differentiation on this trained model?

```<code>class Model(nn.Module):
    def __init__(self):
        super(Model, self).__init__()
        self.linear1 = nn.Linear(2, 16)
        self.linear2 = nn.Linear(16, 1)

    def forward(self, x):
        x = self.linear1(x)
        x = torch.sigmoid(x)
        x = self.linear2(x)
        x = torch.sigmoid(x)

        return x

net = Model()

device = "cuda" if torch.cuda.is_available() else "cpu"
net.to(device)

PATH = "NN_model.pth"
net.load_state_dict(torch.load(PATH, map_location=device))
</code>```

I want to differentiate the learned model by x1.

Body:
I would like to perform automatic differentiation on a trained model, for example Physics-informed Neural Networks (PINNs), where the input variables x1,x2 are defined on the model when defining the model, but in my trained model I have such x1,x2 I have not defined the I simply define two input variables as nn.Linear(2, 16).
Is it possible to do automatic differentiation on this trained model?

class Model(nn.Module):
    def __init__(self):
        super(Model, self).__init__()
        self.linear1 = nn.Linear(2, 16)
        self.linear2 = nn.Linear(16, 1)

    def forward(self, x):
        x = self.linear1(x)
        x = torch.sigmoid(x)
        x = self.linear2(x)
        x = torch.sigmoid(x)

        return x

net = Model()

device = "cuda" if torch.cuda.is_available() else "cpu"
net.to(device)

PATH = "NN_model.pth"
net.load_state_dict(torch.load(PATH, map_location=device))

I want to differentiate the learned model by x1.


问:
How can I change the font sizing within multiple lines of a string in Lua? (WoW Lua Question)
I am currently beginning to write functions for WoW WeakAura addons that use the WoW Lua in order to create the addon.  I am trying to change the fonts within the printed string so that I have a Header essentially.

The code is essentially as follows:

return string.format("|cFFFFFFFFHeader Text|r\nRegular Text|r\nMore Regular Text|r\nEven More Regular Text")

The current printing returns all of the text the same size, but I just want to make the "Header Text" a size larger. I've found how to modify the colors, but I have yet to find anything similar for font size.  Can someone assist?


问:
Spring Boot configure WebSecurityConfig error
I am using Spring Boot 3.0.1, and am trying to configure web access.

I have the following:

```<code>@Configuration
@EnableWebSecurity
public class WebSecurityConfig {

    @Bean
    public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
        http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
                .authorizeHttpRequests().requestMatchers("/soapWS/**").permitAll().and()
                .authorizeHttpRequests().requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll().and()
                .authorizeHttpRequests().requestMatchers("/actuator/**").permitAll().and()
                .authorizeHttpRequests().requestMatchers("/powwow/spreadsheet/**").permitAll().and()
                .authorizeHttpRequests().requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll()
                .anyRequest().authenticated().and()
                .cors().and()
                .httpBasic().and()
                .csrf().disable();
        return http.build();
    }

    @Bean
    protected AuthenticationManager configure(AuthenticationManagerBuilder auth) throws Exception {
        return
                auth.authenticationProvider(customWebAuthenticationProvider)
                .inMemoryAuthentication()
                .passwordEncoder(passwordEncoder())
                .withUser(WEB_ACCESS_USERNAME).password(passwordEncoder().encode(WEB_ACCESS_PASSWORD)).roles("USER")
                        .and().and().getObject();
    }

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }

}
</code>```

Error

Error creating bean with name 'configure' defined in class path
resource [com/xxxx/powwow/config/WebSecurityConfig.class]: Failed to
instantiate
[org.springframework.security.authentication.AuthenticationManager]:
Factory method 'configure' threw exception with message: Cannot apply
org.springframework.security.config.annotation.authentication.configurers.provisioning.InMemoryUserDetailsManagerConfigurer@57b7287c
to already built object

I was previously using Spring Boot 2.5.1, and the following method was working perfectly. However, with the new version, it requires a return type.

```<code>@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth.authenticationProvider(customWebAuthenticationProvider);
    auth.inMemoryAuthentication()
            .passwordEncoder(passwordEncoder())
            .withUser(WEB_ACCESS_USERNAME).password(passwordEncoder().encode(WEB_ACCESS_PASSWORD)).roles("USER");
}
</code>```

Any help appreciated.

UPDATE

Thanks to the comments below, I have updated it to the following which compiles an runs with no errors now, however all requests return a 401 error:

```<code>@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
    http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
            .authorizeHttpRequests().requestMatchers("/soapWS/**").permitAll().and()
            .authorizeHttpRequests().requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll().and()
            .authorizeHttpRequests().requestMatchers("/actuator/**").permitAll().and()
            .authorizeHttpRequests().requestMatchers("/powwow/spreadsheet/**").permitAll()
            .anyRequest().authenticated().and()
            .cors().and()
            .httpBasic().and()
            .csrf().disable();
    return http.build();
}

@Bean
public InMemoryUserDetailsManager userDetailsService() {
    UserDetails user = User
            .withUsername(WEB_ACCESS_USERNAME)
            .password(passwordEncoder().encode(WEB_ACCESS_PASSWORD))
            .roles("USER")
            .build();
    return new InMemoryUserDetailsManager(user);
}

@Bean
public WebSecurityCustomizer webSecurityCustomizer() {
    return (web) -> {
        web.ignoring().requestMatchers("/swagger-ui/**", "/v3/api-docs/**");
    };
}

@Bean
public PasswordEncoder passwordEncoder() {
    return new BCryptPasswordEncoder();
}
</code>```

e.g. If I try to access Swagger via the following, it always gets a 401, even through I do have 'Basic Auth' set in in Postman to correct credentials (this worked before the upgrade):

```<code>http://localhost:8085/swagger-ui/index.html#/
</code>```

or a REST endpoint via:

```<code>http://localhost:8085/powwow/test-me
</code>```

Body:
I am using Spring Boot 3.0.1, and am trying to configure web access.

I have the following:

@Configuration
@EnableWebSecurity
public class WebSecurityConfig {

    @Bean
    public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
        http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
                .authorizeHttpRequests().requestMatchers("/soapWS/**").permitAll().and()
                .authorizeHttpRequests().requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll().and()
                .authorizeHttpRequests().requestMatchers("/actuator/**").permitAll().and()
                .authorizeHttpRequests().requestMatchers("/powwow/spreadsheet/**").permitAll().and()
                .authorizeHttpRequests().requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll()
                .anyRequest().authenticated().and()
                .cors().and()
                .httpBasic().and()
                .csrf().disable();
        return http.build();
    }

    @Bean
    protected AuthenticationManager configure(AuthenticationManagerBuilder auth) throws Exception {
        return
                auth.authenticationProvider(customWebAuthenticationProvider)
                .inMemoryAuthentication()
                .passwordEncoder(passwordEncoder())
                .withUser(WEB_ACCESS_USERNAME).password(passwordEncoder().encode(WEB_ACCESS_PASSWORD)).roles("USER")
                        .and().and().getObject();
    }

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }

}

Error

Error creating bean with name 'configure' defined in class path
resource [com/xxxx/powwow/config/WebSecurityConfig.class]: Failed to
instantiate
[org.springframework.security.authentication.AuthenticationManager]:
Factory method 'configure' threw exception with message: Cannot apply
org.springframework.security.config.annotation.authentication.configurers.provisioning.InMemoryUserDetailsManagerConfigurer@57b7287c
to already built object

I was previously using Spring Boot 2.5.1, and the following method was working perfectly. However, with the new version, it requires a return type.

@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth.authenticationProvider(customWebAuthenticationProvider);
    auth.inMemoryAuthentication()
            .passwordEncoder(passwordEncoder())
            .withUser(WEB_ACCESS_USERNAME).password(passwordEncoder().encode(WEB_ACCESS_PASSWORD)).roles("USER");
}

Any help appreciated.

UPDATE

Thanks to the comments below, I have updated it to the following which compiles an runs with no errors now, however all requests return a 401 error:

@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
    http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
            .authorizeHttpRequests().requestMatchers("/soapWS/**").permitAll().and()
            .authorizeHttpRequests().requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll().and()
            .authorizeHttpRequests().requestMatchers("/actuator/**").permitAll().and()
            .authorizeHttpRequests().requestMatchers("/powwow/spreadsheet/**").permitAll()
            .anyRequest().authenticated().and()
            .cors().and()
            .httpBasic().and()
            .csrf().disable();
    return http.build();
}

@Bean
public InMemoryUserDetailsManager userDetailsService() {
    UserDetails user = User
            .withUsername(WEB_ACCESS_USERNAME)
            .password(passwordEncoder().encode(WEB_ACCESS_PASSWORD))
            .roles("USER")
            .build();
    return new InMemoryUserDetailsManager(user);
}

@Bean
public WebSecurityCustomizer webSecurityCustomizer() {
    return (web) -> {
        web.ignoring().requestMatchers("/swagger-ui/**", "/v3/api-docs/**");
    };
}

@Bean
public PasswordEncoder passwordEncoder() {
    return new BCryptPasswordEncoder();
}

e.g. If I try to access Swagger via the following, it always gets a 401, even through I do have 'Basic Auth' set in in Postman to correct credentials (this worked before the upgrade):

http://localhost:8085/swagger-ui/index.html#/

or a REST endpoint via:

http://localhost:8085/powwow/test-me


问:
Assertion failed error in minting using bn.js
I am trying to create NFT minting project but minting costs 1000000000000000000000. Since it is a big number I want to use bn.js in my project: https://www.npmjs.com/package/bn.js?activeTab=readme

Here how I am doing minting with bn.js

```<code>import BN from "bn.js";
const claimNFTs = async () => {
    let cost = blockchain.cost;
    let gasLimit = CONFIG.GAS_LIMIT;
    let totalCostWei = new BN(Number(cost * mintAmount));
    let totalGasLimit = String(gasLimit * mintAmount);
    setFeedback(`Minting your ${CONFIG.NFT_NAME}...`);
    setClaimingNft(true);
    blockchain.smartContract.methods
      .mint(wallet.account, mintAmount)
      .send({
        gasLimit: String(totalGasLimit),
        to: CONFIG.CONTRACT_ADDRESS,
        from: wallet.account,
        value: totalCostWei,
      })
      .once("error", (err) => {
        setFeedback("Sorry, something went wrong please try again later.");
        setClaimingNft(false);
      })
      .then((receipt) => {
        setFeedback(`WOW, the ${CONFIG.NFT_NAME} is yours!`);
        setClaimingNft(false);
      });
  };
</code>```

But I am getting an error: bn.js:6 Uncaught (in promise) Error: Assertion failed at assert (bn.js:6:1) at BN._initNumber (bn.js:128:1)

So how can I do minting with big number? Is my approach wrong?

Body:
I am trying to create NFT minting project but minting costs 1000000000000000000000. Since it is a big number I want to use bn.js in my project: https://www.npmjs.com/package/bn.js?activeTab=readme

Here how I am doing minting with bn.js

import BN from "bn.js";
const claimNFTs = async () => {
    let cost = blockchain.cost;
    let gasLimit = CONFIG.GAS_LIMIT;
    let totalCostWei = new BN(Number(cost * mintAmount));
    let totalGasLimit = String(gasLimit * mintAmount);
    setFeedback(`Minting your ${CONFIG.NFT_NAME}...`);
    setClaimingNft(true);
    blockchain.smartContract.methods
      .mint(wallet.account, mintAmount)
      .send({
        gasLimit: String(totalGasLimit),
        to: CONFIG.CONTRACT_ADDRESS,
        from: wallet.account,
        value: totalCostWei,
      })
      .once("error", (err) => {
        setFeedback("Sorry, something went wrong please try again later.");
        setClaimingNft(false);
      })
      .then((receipt) => {
        setFeedback(`WOW, the ${CONFIG.NFT_NAME} is yours!`);
        setClaimingNft(false);
      });
  };

But I am getting an error: bn.js:6 Uncaught (in promise) Error: Assertion failed at assert (bn.js:6:1) at BN._initNumber (bn.js:128:1)

So how can I do minting with big number? Is my approach wrong?


问:
What is the best way to achieve drop-down menu in the header of the mat-table in Angular
I am building an application which has an angular material component Mat-Table.

My goal is to have the drop-down menu on the header of the table for each column as seen below.

My approach involves below:

adding <mat-select> inside the

```<code>.....
  <ng-container matColumnDef="position">
    <th mat-header-cell *matHeaderCellDef>
     <mat-form-field appearance="fill">
      <mat-label>Cars</mat-label>
      <select matNativeControl required>
         <option value="volvo">Volvo</option>
         <option value="saab">Saab</option>
         <option value="mercedes">Mercedes</option>
         <option value="audi">Audi</option>
      </select>
    </mat-form-field>
    </th>

    <td mat-cell *matCellDef="let element"> {{element.position}} </td>
  </ng-container>
.....
</code>```

Is there a better approach to achieve this or any library which helps to achieve the result?

Body:
I am building an application which has an angular material component Mat-Table.

My goal is to have the drop-down menu on the header of the table for each column as seen below.

My approach involves below:

adding <mat-select> inside the

.....
  <ng-container matColumnDef="position">

     <mat-form-field appearance="fill">
      <mat-label>Cars</mat-label>
      <select matNativeControl required>
         <option value="volvo">Volvo</option>
         <option value="saab">Saab</option>
         <option value="mercedes">Mercedes</option>
         <option value="audi">Audi</option>
      </select>
    </mat-form-field>

     {{element.position}}
  </ng-container>
.....

Is there a better approach to achieve this or any library which helps to achieve the result?


问:
SDL SetRenderDrawColor Opacity doesn't work
I have an issue with my code. I don't manage to change the opacity of my RenderDrawColor.

Indeed, I know that SetRenderDrawColor is defined by (renderer, R, G, B, a --> which represents the opacity value). Nevertheless, I tried to change a value but my color doesn't change and I have my rectangle fully fill again.

Here a photo of what I have with my code :

Screen that I have with my code

Here is my code, that I execute with a main.c script :

```<code>void display_end_menu(SDL_Renderer *renderer) {

if (SDL_SetRenderDrawColor(renderer, 0, 255, 0, 30) != 0) {
    return_error("Impossible de modifier la couleur du render");
    SDL_Quit();
}

SDL_Rect shadow_screen;
shadow_screen.w = 1280;
shadow_screen.h = 720;
shadow_screen.x = (SCREEN_WIDTH - shadow_screen.w)/2;
shadow_screen.y = (SCREEN_HEIGHT - shadow_screen.h)/2;

if (SDL_RenderFillRect(renderer, &shadow_screen) != 0) {
    return_error("Impossible de dessiner le rectangle dans le render");
    SDL_Quit();
}

if (SDL_SetRenderDrawColor(renderer, 255, 255, 255, 30) != 0) {
    return_error("Impossible de modifier la couleur du render");
    SDL_Quit();
}
SDL_Rect quit_button;
quit_button.w = 200;
quit_button.h = 50;
quit_button.x = (SCREEN_WIDTH - quit_button.w)/2;
quit_button.y = (SCREEN_HEIGHT - quit_button.h)/2;

if (SDL_RenderFillRect(renderer, &quit_button) != 0) {
    return_error("Impossible de dessiner le rectangle dans le render");
    SDL_Quit();
}
}
</code>```

I tried several numbers for alpha such as 0, 30 and so on, but it's impossible to edit the opacity of the rectangle.

Body:
I have an issue with my code. I don't manage to change the opacity of my RenderDrawColor.

Indeed, I know that SetRenderDrawColor is defined by (renderer, R, G, B, a --> which represents the opacity value). Nevertheless, I tried to change a value but my color doesn't change and I have my rectangle fully fill again.

Here a photo of what I have with my code :

Screen that I have with my code

Here is my code, that I execute with a main.c script :

void display_end_menu(SDL_Renderer *renderer) {

if (SDL_SetRenderDrawColor(renderer, 0, 255, 0, 30) != 0) {
    return_error("Impossible de modifier la couleur du render");
    SDL_Quit();
}

SDL_Rect shadow_screen;
shadow_screen.w = 1280;
shadow_screen.h = 720;
shadow_screen.x = (SCREEN_WIDTH - shadow_screen.w)/2;
shadow_screen.y = (SCREEN_HEIGHT - shadow_screen.h)/2;

if (SDL_RenderFillRect(renderer, &shadow_screen) != 0) {
    return_error("Impossible de dessiner le rectangle dans le render");
    SDL_Quit();
}

if (SDL_SetRenderDrawColor(renderer, 255, 255, 255, 30) != 0) {
    return_error("Impossible de modifier la couleur du render");
    SDL_Quit();
}
SDL_Rect quit_button;
quit_button.w = 200;
quit_button.h = 50;
quit_button.x = (SCREEN_WIDTH - quit_button.w)/2;
quit_button.y = (SCREEN_HEIGHT - quit_button.h)/2;

if (SDL_RenderFillRect(renderer, &quit_button) != 0) {
    return_error("Impossible de dessiner le rectangle dans le render");
    SDL_Quit();
}
}

I tried several numbers for alpha such as 0, 30 and so on, but it's impossible to edit the opacity of the rectangle.


问:
execute a command in all files in a directory
I have thousands of folders that I want to perform the same data processing script on. I set up the script below, it executes on the first file in the directory, but instead of moving to the next folder it endlessly repeats the script in the first folder. What am I missing? Thank you!

for folder in i*; do
cd "$folder"
command
done

for folder in i*; do
cd "$folder"
command
done


问:
Incorrect Padding while decrypt using AES python
So I am implementing AES encryption and decryption algorithm that takes in the password as sha1 hashed value below is the encryption logic

```<code>def encrypt(password, message):
    # Hash the password using SHA1
    hashed_password = hashlib.sha1(password.encode()).hexdigest()

    # Use the hashed password as the key for AES
    cipher = AES.new(hashed_password[:16].encode(), AES.MODE_CBC)

    # Pad the message to a multiple of the block size
    padded_message = pad(message.encode(), AES.block_size)

    # Encrypt the message
    ciphertext = cipher.encrypt(padded_message)

    # Encode the ciphertext in base64
    encrypted_text = base64.b64encode(ciphertext).decode('utf-8')

    # Return the encrypted message
    return encrypted_text

</code>```

The encrypt method runs successfuly without any errors
Then below is the decrypt method

```<code>def decrypt(password, encrypted_text):
    # Hash the password using SHA1
    hashed_password = hashlib.sha1(password.encode()).hexdigest()

    # Use the hashed password as the key for AES
    cipher = AES.new(hashed_password[:16].encode(), AES.MODE_CBC)

    # Decode the encrypted text from base64
    ciphertext = base64.b64decode(encrypted_text)

    # Decrypt the message
    padded_message = cipher.decrypt(ciphertext)

    # Unpad the message
    message = unpad(padded_message, AES.block_size).decode()

    # Return the decrypted message
    return message

</code>```

Also the necessary imports are below

```<code>import hashlib
from Cryptodome.Cipher import AES
from Cryptodome.Util.Padding import pad, unpad
import base64

</code>```

Now when I run the following code

```<code>password = "justKey"
message = "Hello, World!"

encrypted_text = encrypt(password, message)
print(encrypted_text)
decrypted_message = decrypt(password, encrypted_text)

print(decrypted_message)
</code>```

It returns with the following

```<code>Traceback (most recent call last):
  File "main.py", line 51, in <module>
    decrypted_message = decrypt(password, encrypted_text)
  File "main.py", line 40, in decrypt
    message = unpad(padded_message, AES.block_size).decode()
  File "/home/runner/test/venv/lib/python3.8/site-packages/Cryptodome/Util/Padding.py", line 92, in unpad
    raise ValueError("Padding is incorrect.")
ValueError: Padding is incorrect.
</code>```

Is there anything that I am missing, earlier I was using AES without any hashing of the password, but as the new password is not 16 bytes, so using sha1 to generate 16 bytes hash of it. Also I know that the hash generated is different everytime, So can this be a pin point?

Body:
So I am implementing AES encryption and decryption algorithm that takes in the password as sha1 hashed value below is the encryption logic

def encrypt(password, message):
    # Hash the password using SHA1
    hashed_password = hashlib.sha1(password.encode()).hexdigest()

    # Use the hashed password as the key for AES
    cipher = AES.new(hashed_password[:16].encode(), AES.MODE_CBC)

    # Pad the message to a multiple of the block size
    padded_message = pad(message.encode(), AES.block_size)

    # Encrypt the message
    ciphertext = cipher.encrypt(padded_message)

    # Encode the ciphertext in base64
    encrypted_text = base64.b64encode(ciphertext).decode('utf-8')

    # Return the encrypted message
    return encrypted_text

The encrypt method runs successfuly without any errors
Then below is the decrypt method

def decrypt(password, encrypted_text):
    # Hash the password using SHA1
    hashed_password = hashlib.sha1(password.encode()).hexdigest()

    # Use the hashed password as the key for AES
    cipher = AES.new(hashed_password[:16].encode(), AES.MODE_CBC)

    # Decode the encrypted text from base64
    ciphertext = base64.b64decode(encrypted_text)

    # Decrypt the message
    padded_message = cipher.decrypt(ciphertext)

    # Unpad the message
    message = unpad(padded_message, AES.block_size).decode()

    # Return the decrypted message
    return message

Also the necessary imports are below

import hashlib
from Cryptodome.Cipher import AES
from Cryptodome.Util.Padding import pad, unpad
import base64

Now when I run the following code

password = "justKey"
message = "Hello, World!"

encrypted_text = encrypt(password, message)
print(encrypted_text)
decrypted_message = decrypt(password, encrypted_text)

print(decrypted_message)

It returns with the following

Traceback (most recent call last):
  File "main.py", line 51, in <module>
    decrypted_message = decrypt(password, encrypted_text)
  File "main.py", line 40, in decrypt
    message = unpad(padded_message, AES.block_size).decode()
  File "/home/runner/test/venv/lib/python3.8/site-packages/Cryptodome/Util/Padding.py", line 92, in unpad
    raise ValueError("Padding is incorrect.")
ValueError: Padding is incorrect.

Is there anything that I am missing, earlier I was using AES without any hashing of the password, but as the new password is not 16 bytes, so using sha1 to generate 16 bytes hash of it. Also I know that the hash generated is different everytime, So can this be a pin point?


问:
Unity Animation Rigging Local and World Position Problem
I have a problem with changing TwoBone IK target positions.
If i move a parent of the constraint targets while previewing as an animation, the moving will work.

During runtime manually moving targets is the only working way. If i move a parent, there won't be any changes in object's mesh.

So my main question:
How could i make a target's world position response of an TwoBone IK Constraint?

My guesses ended with the fact that mesh responds only on the local position... But then, why at the start it counts world position of a targets?


问:
Notion API unreadable dictionary keys
I am getting the following properties dictionary:

```<code>value: {
          id: 'e44ddbba-580a-42af-882c-****',
          version: 70,
          type: 'page',
          properties: {
            '==~K': [ [ 'Yes' ] ],
            '=bhc': [ [ 'Yes' ] ],
            'BN]P': [ [ 'OSS,Node.js' ] ],
            'PO@I': [
              [
                '‣',
                [ [ 'd', { type: 'date', start_date: '2022-12-30' } ] ]
              ]
            ],
            'Yy:}': [
              [
                'e420f665-61de-474e-8804-****-profile_image-300x300.png',
                [
                  [
                    'a',
                    'https://s3-us-west-2.amazonaws.com/secure.notion-static.com/495afc3e-4d4b-48e8-*****/e420f6-300x300.png'
                  ]
                ]
              ]
            ],
            'a<ql': [
              [
                '‣',
                [ [ 'd', { type: 'date', start_date: '2018-03-07' } ] ]
              ]
            ],
            '}nqi': [
              [
                'sdcsbdciusc',
                [ [ 'a', 'sdckbsidcsidc' ] ]
              ]
            ],
            '~]S<': [
              [
                'The best techniques'
              ]
            ],
            title: [ [ 'Example article' ] ]
          },
          content: [
            '9420af59-f255-4387-8d35-97*****',

</code>```

How am I supposed to decode those keys?

I need to get the all properties of the page. I am just using fetch Api.

This stackoverflow does not let me post unless I add this text.

Title: Notion API unreadable dictionary keys

Body:
I am getting the following properties dictionary:

value: {
          id: 'e44ddbba-580a-42af-882c-****',
          version: 70,
          type: 'page',
          properties: {
            '==~K': [ [ 'Yes' ] ],
            '=bhc': [ [ 'Yes' ] ],
            'BN]P': [ [ 'OSS,Node.js' ] ],
            'PO@I': [
              [
                '‣',
                [ [ 'd', { type: 'date', start_date: '2022-12-30' } ] ]
              ]
            ],
            'Yy:}': [
              [
                'e420f665-61de-474e-8804-****-profile_image-300x300.png',
                [
                  [
                    'a',
                    'https://s3-us-west-2.amazonaws.com/secure.notion-static.com/495afc3e-4d4b-48e8-*****/e420f6-300x300.png'
                  ]
                ]
              ]
            ],
            'a<ql': [
              [
                '‣',
                [ [ 'd', { type: 'date', start_date: '2018-03-07' } ] ]
              ]
            ],
            '}nqi': [
              [
                'sdcsbdciusc',
                [ [ 'a', 'sdckbsidcsidc' ] ]
              ]
            ],
            '~]S<': [
              [
                'The best techniques'
              ]
            ],
            title: [ [ 'Example article' ] ]
          },
          content: [
            '9420af59-f255-4387-8d35-97*****',

How am I supposed to decode those keys?

I need to get the all properties of the page. I am just using fetch Api.

This stackoverflow does not let me post unless I add this text.


问:
Build AWS Amplify Backend Using AWS CDK
;TLDR: Effectively, how to build a backend for Amplify via AWS CDK which consists of an API Gateway and Lambda function.

I am currently attempting to make an Amplify solution as IaC. The application is relatively simple and only uses Amplify, which hosts frontend and acts as a passthrough the to other resources via the amplify library for JS, API Gateway and a Lambda function. The API Gateway passes REST requests to the Lambda function for processing.

As a dummy app, I have created IaC as such:

```<code>class AmplifyInfraStack(Stack):

    def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
        super().__init__(scope, construct_id, **kwargs)

        amplify_app = amplify.CfnApp(self, "MyApp", name='MyAppName')

        lambda_function = lambda_.Function(
               self,
               'MyFunction',
               code=lambda_.InlineCode(inline_code),
               handler='index.lambda_handler',
               runtime=lambda_.Runtime.PYTHON_3_9
           )

        api = apiGateway.LambdaRestApi(self, 'MyAPI', handler=lambda_function)
</code>```

Which will create all of the resources I require, with the API Gateway and Lambda function being linked; however, the Amplify resource is effectively on its own and does not recognise the other resources linked resources, like in the backend section of the Amplify  AWS Console where it should show 'APIs' and 'Functions'.

I understand this is because I haven't explicitly told them that they should be linked, though reading through the documentation I can't seem to find a way to actually tell Amplify that these resources need to be linked, like I have done for the API Gateway and Lambda in the example above.

My question is, is there a way to use CDK to generate Amplify with a backend containing Functions and APIs? My need for this, as described earlier is so the 'aws-amplify' library in the JS frontend can recognise the linked API to the Amplify resource it's hosted on.

Any help would be appreciated, thanks.

Title: Build AWS Amplify Backend Using AWS CDK

Body:
;TLDR: Effectively, how to build a backend for Amplify via AWS CDK which consists of an API Gateway and Lambda function.

I am currently attempting to make an Amplify solution as IaC. The application is relatively simple and only uses Amplify, which hosts frontend and acts as a passthrough the to other resources via the amplify library for JS, API Gateway and a Lambda function. The API Gateway passes REST requests to the Lambda function for processing.

As a dummy app, I have created IaC as such:

class AmplifyInfraStack(Stack):

    def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
        super().__init__(scope, construct_id, **kwargs)

        amplify_app = amplify.CfnApp(self, "MyApp", name='MyAppName')

        lambda_function = lambda_.Function(
               self,
               'MyFunction',
               code=lambda_.InlineCode(inline_code),
               handler='index.lambda_handler',
               runtime=lambda_.Runtime.PYTHON_3_9
           )

        api = apiGateway.LambdaRestApi(self, 'MyAPI', handler=lambda_function)

Which will create all of the resources I require, with the API Gateway and Lambda function being linked; however, the Amplify resource is effectively on its own and does not recognise the other resources linked resources, like in the backend section of the Amplify  AWS Console where it should show 'APIs' and 'Functions'.

I understand this is because I haven't explicitly told them that they should be linked, though reading through the documentation I can't seem to find a way to actually tell Amplify that these resources need to be linked, like I have done for the API Gateway and Lambda in the example above.

My question is, is there a way to use CDK to generate Amplify with a backend containing Functions and APIs? My need for this, as described earlier is so the 'aws-amplify' library in the JS frontend can recognise the linked API to the Amplify resource it's hosted on.

Any help would be appreciated, thanks.


问:
Flutter Detect the end of a Listview with NeverScrollableScrollPhysics
I have a listview :

```<code>NotificationListener<ScrollNotification>(
                  onNotification: (ScrollNotification notification) {
                    if (notification.metrics.atEdge) {
                      if (notification.metrics.pixels == 0) {
                        print('At top');
                      } else {
                        print('At bottom');
                      }
                    }
                    return true;
                  },
                  child: ListView.builder(
                      physics: const NeverScrollableScrollPhysics(),
                      padding: const EdgeInsets.only(
                          left: 12, right: 12, top: 5),
                      scrollDirection: Axis.vertical,
                      itemCount: 10,
                      shrinkWrap: true,
                      itemBuilder: (context, index) {
                        //

                        //
                        return Text(index);
                         }),
                ),
</code>```

I noticed its not printing anything unless i remove the NeverScrollableScrollPhysics and i dont want the Listview to be scrollable it already has s scrollable parent(SingleChildScrollView())

Body:
I have a listview :

NotificationListener<ScrollNotification>(
                  onNotification: (ScrollNotification notification) {
                    if (notification.metrics.atEdge) {
                      if (notification.metrics.pixels == 0) {
                        print('At top');
                      } else {
                        print('At bottom');
                      }
                    }
                    return true;
                  },
                  child: ListView.builder(
                      physics: const NeverScrollableScrollPhysics(),
                      padding: const EdgeInsets.only(
                          left: 12, right: 12, top: 5),
                      scrollDirection: Axis.vertical,
                      itemCount: 10,
                      shrinkWrap: true,
                      itemBuilder: (context, index) {
                        //

                        //
                        return Text(index);
                         }),
                ),

I noticed its not printing anything unless i remove the NeverScrollableScrollPhysics and i dont want the Listview to be scrollable it already has s scrollable parent(SingleChildScrollView())


问:
Visualise different areas on the axes in a matplotlib python plot
I would like to generate a plot like this in Python:

I am primarily interested in the possibility of inserting the pink and green areas into the plot in order to highlight different ranges. Area1-3 should get different colours and names later.

Thanks a lot!

PS: my Phython code atm is:

```<code>fig3, ax3 = plt.subplots()
plot3 = ax3.scatter(nocore[0,:],nocore[1,:],c=nocore[2,:], s=3, cmap='seismic', label='Group X')
ax3.set_xlabel("X")
ax3.set_ylabel("Y")
ax3.legend(loc='upper center', bbox_to_anchor=(0.5, 1.15))
plt.ylim(ymin=45, ymax=362)
plt.ylim(ymin=0, ymax=320)
fig3.colorbar(plot3, ax=ax3, label ='Colorrange')
plt.savefig('nocore.png', dpi=300)
plt.show()
</code>```

Not sure what to do or what is the best way of doing it.

Body:
I would like to generate a plot like this in Python:

I am primarily interested in the possibility of inserting the pink and green areas into the plot in order to highlight different ranges. Area1-3 should get different colours and names later.

Thanks a lot!

PS: my Phython code atm is:

fig3, ax3 = plt.subplots()
plot3 = ax3.scatter(nocore[0,:],nocore[1,:],c=nocore[2,:], s=3, cmap='seismic', label='Group X')
ax3.set_xlabel("X")
ax3.set_ylabel("Y")
ax3.legend(loc='upper center', bbox_to_anchor=(0.5, 1.15))
plt.ylim(ymin=45, ymax=362)
plt.ylim(ymin=0, ymax=320)
fig3.colorbar(plot3, ax=ax3, label ='Colorrange')
plt.savefig('nocore.png', dpi=300)
plt.show()

Not sure what to do or what is the best way of doing it.


问:
oauth2: cannot fetch token: 400 Bad Request Response: in Prometheus targets, while federating metrics
I am trying to use oauth2 in the kube-prom-stack for the authetication for metrics federate from a https node.
Below is my configuration:

```<code>`additionalScrapeConfigs:
      - job_name: 'test-federation'
        scrape_interval: 20s
        scrape_timeout: 20s
        scheme: https
        oauth2:
          client_id: 'auth-server'
          client_secret: 'XXXXXXXXXXX'
          token_url: 'http://XXX.XXX.XX.XX:80/auth/token '
          endpoint_params:
            grant_type: 'client_credentials'
        metrics_path: /federate
        honor_labels: true
        tls_config:
          insecure_skip_verify: true
        metric_relabel_configs:
          - source_labels: [id]
            regex: '^static-agent$'
            action: drop
        params:
          match[]:
            - '{job="xyz"}'
        static_configs:
          - targets: ['XXX.XX.XX.XX:9090']`
</code>```

But, when i checked my prometheus tarhgets i see below error:

oauth2: cannot fetch token: 400 Bad Request Response: {"code":"400","description":"Invalid credentials"}
Please help.

```<code>oauth2:
          client_id: 'auth-server'
          client_secret: 'XXXXXXXXXXX'
          token_url: 'http://XXX.XXX.XX.XX:80/auth/token '
          endpoint_params:
            grant_type: 'client_credentials'
</code>```

I tried the above for Oauth2 authentication, but i see the below error in prometheues targets while scraping metrics from other node.

oauth2: cannot fetch token: 400 Bad Request Response: {"code":"400","description":"Invalid credentials"}

Body:
I am trying to use oauth2 in the kube-prom-stack for the authetication for metrics federate from a https node.
Below is my configuration:

`additionalScrapeConfigs:
      - job_name: 'test-federation'
        scrape_interval: 20s
        scrape_timeout: 20s
        scheme: https
        oauth2:
          client_id: 'auth-server'
          client_secret: 'XXXXXXXXXXX'
          token_url: 'http://XXX.XXX.XX.XX:80/auth/token '
          endpoint_params:
            grant_type: 'client_credentials'
        metrics_path: /federate
        honor_labels: true
        tls_config:
          insecure_skip_verify: true
        metric_relabel_configs:
          - source_labels: [id]
            regex: '^static-agent$'
            action: drop
        params:
          match[]:
            - '{job="xyz"}'
        static_configs:
          - targets: ['XXX.XX.XX.XX:9090']`

But, when i checked my prometheus tarhgets i see below error:

oauth2: cannot fetch token: 400 Bad Request Response: {"code":"400","description":"Invalid credentials"}
Please help.

oauth2:
          client_id: 'auth-server'
          client_secret: 'XXXXXXXXXXX'
          token_url: 'http://XXX.XXX.XX.XX:80/auth/token '
          endpoint_params:
            grant_type: 'client_credentials'

I tried the above for Oauth2 authentication, but i see the below error in prometheues targets while scraping metrics from other node.

oauth2: cannot fetch token: 400 Bad Request Response: {"code":"400","description":"Invalid credentials"}


问:
HTTP Status 500 – Internal Server Error - The value for the ___ class attribute [ ____ ] is invalid
This is my RegistrationController.jsp

```<code><%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.jsplogindemo.dao.UserDao" %>
<%@page import="com.jsplogindemo.daoimpl.UserDaoImpl" %>

 <jsp:useBean class="com.jsplogindemo.entity.User"
    id="user" scope="page"></jsp:useBean>
    <jsp:setProperty name="user" property="*"/>

    <%
        UserDao daoImpl = new UserDaoImpl();

        if(daoImpl.addNewUser(user)) {
            response.sendRedirect(
                    "login.jsp?msg=regsuccess");
        }
        else {
            response.sendRedirect(
                    "registration.jsp?msg=regerror");
        }
    %>
</code>```

This is LoginController.jsp

```<code><%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.jsplogindemo.dao.UserDao" %>
<%@page import="com.jsplogindemo.daoimpl.UserDaoImpl" %>

 <jsp:useBean class="com.jsplogindemo.entity.User"
    id="user" scope="page"></jsp:useBean>
    <jsp:setProperty name="user" property="*"/>

    <%
        UserDao daoImpl = new UserDaoImpl();

        if(daoImpl.checkUserCredentials(user)) {

            session.setAttribute("USERNAME",
                    user.getUsername());
            response.sendRedirect("home");
        }
        else {
            response.sendRedirect(
                    "login.jsp?msg=loginerror");
        }
    %>
</code>```

This is User.java

```<code>package com.jsplogindemo.entity;

public class User {
     private String username;
     private String email;
     private String password;

     public User() {

    }
    public User(String username, String email, String password) {
        super();
        this.setUsername(username);
        this.setEmail(email);
        this.setPassword(password);
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }

}
</code>```

This is my folder structure
folder structure

I want to register the user and take to the login page but it show this type of error

I am using Apache Tomcat/9.0.70

HTTP Status 500 – Internal Server Error
Type Exception Report

Message /controller/RegistrationController.jsp (line: [6], column: [1]) The value for the useBean class attribute [com.jsplogindemo.entity.User] is invalid.

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

Body:
This is my RegistrationController.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.jsplogindemo.dao.UserDao" %>
<%@page import="com.jsplogindemo.daoimpl.UserDaoImpl" %>

 <jsp:useBean class="com.jsplogindemo.entity.User"
    id="user" scope="page"></jsp:useBean>
    <jsp:setProperty name="user" property="*"/>

    <%
        UserDao daoImpl = new UserDaoImpl();

        if(daoImpl.addNewUser(user)) {
            response.sendRedirect(
                    "login.jsp?msg=regsuccess");
        }
        else {
            response.sendRedirect(
                    "registration.jsp?msg=regerror");
        }
    %>

This is LoginController.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.jsplogindemo.dao.UserDao" %>
<%@page import="com.jsplogindemo.daoimpl.UserDaoImpl" %>

 <jsp:useBean class="com.jsplogindemo.entity.User"
    id="user" scope="page"></jsp:useBean>
    <jsp:setProperty name="user" property="*"/>

    <%
        UserDao daoImpl = new UserDaoImpl();

        if(daoImpl.checkUserCredentials(user)) {

            session.setAttribute("USERNAME",
                    user.getUsername());
            response.sendRedirect("home");
        }
        else {
            response.sendRedirect(
                    "login.jsp?msg=loginerror");
        }
    %>

This is User.java

package com.jsplogindemo.entity;

public class User {
     private String username;
     private String email;
     private String password;

     public User() {

    }
    public User(String username, String email, String password) {
        super();
        this.setUsername(username);
        this.setEmail(email);
        this.setPassword(password);
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }

}

This is my folder structure
folder structure

I want to register the user and take to the login page but it show this type of error

I am using Apache Tomcat/9.0.70

HTTP Status 500 – Internal Server Error
Type Exception Report

Message /controller/RegistrationController.jsp (line: [6], column: [1]) The value for the useBean class attribute [com.jsplogindemo.entity.User] is invalid.

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception


问:
Swagger how implement /api/apiinfo?myvalue
Swagger how can you implement  GET
/api/apiinfo?myvalue
"/api/apiinfo?"- this path.

If I do as /api/apiinfo?{myvalue} I get this call in curl: "https://example.com/api/apiinfo?myvalue="
I.e. an equal sign is added, because myvalue is interpreted as a key


问:
Save and display images in React
I have a profile to keep data from the user, and he can edit when he want. To keep the session, I pass some info from the user in localStorage, because in this project we don't use a library like redux, and one of these fields is "picture" to represent the photo in user's profile.

The problem consists when I try to "save" the image in the localStorage, when I upload the input and save it, it's ok, the picture saves in the database, and in localStorage that link (where the picture is hosted in the db)  is correct, but if I try to edit some other field, like "name" for example and I click to apply the changes, the picture should be the same that I save previously, but the result is a file object and the url is not found in the database. It's like that object file replace that field in the localStorage.

Here I detach some lines of the code to guide me a little.

When I have a succesfull login, I saved the picture from data supplied from the api. PictureURL concat the url from the api with the picture URL that I received from the call.

```<code>------------
localStorage.setItem("picture", pictureURL);
------------
</code>```

In my profile component, I have a state that initially load all the data from the localStorage, picture included. This state I'll use later to send the user to the api

```<code>const [userState, setUserState] = useState({
--------------------------------
picture: localStorage.getItem("picture"),
------------------
});
</code>```

Then in my component, I have an input to upload the new image that I want to change

```<code><Input
    type={"file"}
    size={"sm"}
    mt={"10%"}
    ml={25}
    accept="image/*"
    onChange={imageChange}
    ></Input>
</code>```

imageChange is a function that consists in read the file, with FileReader, store the result in another state call imgData (that functionality is to show a preview of that image), and then set the picture in the main state userState that I mentioned before

```<code>const imageChange = (e) => {
const reader = new FileReader();
reader.addEventListener("load", () => {
  setImgData(reader.result);
});
reader.readAsDataURL(e.target.files[0]);

setUserState({ ...userState, picture: e.target.files[0] });
</code>```

};

And finally, I have a handler to pass all the data from the userState to a formData and send to the api, and when it's all ok, set the localStorage fields with the new data

```<code>---------------------------
localStorage.setItem("picture", userState.picture);
---------------------------
</code>```

Sorry if it's too long, but I don't know where I have the error, maybe when I manage the picture at the beginning, or it's a problem in the backend, but idk! I have 3 days with this problem and I can't see what's going on.

First of all, thanks a lot for the help. All the critics to become more "clean" and to grow up are welcome :)

Title: Save and display images in React

Body:
I have a profile to keep data from the user, and he can edit when he want. To keep the session, I pass some info from the user in localStorage, because in this project we don't use a library like redux, and one of these fields is "picture" to represent the photo in user's profile.

The problem consists when I try to "save" the image in the localStorage, when I upload the input and save it, it's ok, the picture saves in the database, and in localStorage that link (where the picture is hosted in the db)  is correct, but if I try to edit some other field, like "name" for example and I click to apply the changes, the picture should be the same that I save previously, but the result is a file object and the url is not found in the database. It's like that object file replace that field in the localStorage.

Here I detach some lines of the code to guide me a little.

When I have a succesfull login, I saved the picture from data supplied from the api. PictureURL concat the url from the api with the picture URL that I received from the call.

------------
localStorage.setItem("picture", pictureURL);
------------

In my profile component, I have a state that initially load all the data from the localStorage, picture included. This state I'll use later to send the user to the api

const [userState, setUserState] = useState({
--------------------------------
picture: localStorage.getItem("picture"),
------------------
});

Then in my component, I have an input to upload the new image that I want to change

<Input
    type={"file"}
    size={"sm"}
    mt={"10%"}
    ml={25}
    accept="image/*"
    onChange={imageChange}
    ></Input>

imageChange is a function that consists in read the file, with FileReader, store the result in another state call imgData (that functionality is to show a preview of that image), and then set the picture in the main state userState that I mentioned before

const imageChange = (e) => {
const reader = new FileReader();
reader.addEventListener("load", () => {
  setImgData(reader.result);
});
reader.readAsDataURL(e.target.files[0]);

setUserState({ ...userState, picture: e.target.files[0] });

};

And finally, I have a handler to pass all the data from the userState to a formData and send to the api, and when it's all ok, set the localStorage fields with the new data

---------------------------
localStorage.setItem("picture", userState.picture);
---------------------------

Sorry if it's too long, but I don't know where I have the error, maybe when I manage the picture at the beginning, or it's a problem in the backend, but idk! I have 3 days with this problem and I can't see what's going on.

First of all, thanks a lot for the help. All the critics to become more "clean" and to grow up are welcome :)


问:
Springboot REST API Testcase passing in local but failing in build
I have a test case class something like

```<code>@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@AutoConfigureWebTestClient
public class sampleTests {

   when(test.getUrl()).thenReturn("http://localhost:8080/sampletest");

 @Test
  public void getEndpoint() throws Exception {
        webTestClient.get().uri("/sampletest").exchange().expectStatus().isOk().expectBody().consumeWith(System.out::println).json(expectedBody);

         }

}
</code>```

This is passing in local, but got failed with the following error when executed in the azure DevOps pipeline.

```<code>java.lang.AssertionError: Status expected:<200 OK> but was:<500 INTERNAL_SERVER_ERROR>
</code>```

Any insights on the same will be much appreciated.

Body:
I have a test case class something like

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@AutoConfigureWebTestClient
public class sampleTests {

   when(test.getUrl()).thenReturn("http://localhost:8080/sampletest");

 @Test
  public void getEndpoint() throws Exception {
        webTestClient.get().uri("/sampletest").exchange().expectStatus().isOk().expectBody().consumeWith(System.out::println).json(expectedBody);

         }

}

This is passing in local, but got failed with the following error when executed in the azure DevOps pipeline.

java.lang.AssertionError: Status expected:<200 OK> but was:<500 INTERNAL_SERVER_ERROR>

Any insights on the same will be much appreciated.


问:
GWD Rectangle hover color doesn't change
For work I need to make some HTML5 banners and they are almost done except for 1 thing.
I need to code a hover change in the following HTML5 banner.
When you hover over the button the background colour of the rectangle need to change from orange to black.

Class gwd-grp-1b38 / ID 'oranje'

But it doesn't work... Any idea how to fix this?

I tried multiple things, even removed the tap area but the colour still didn't change.
The text on the button is a svg file because the fonts aren't online fonts, this resulted in making the button like this.

```<code><!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="generator" content="Google Web Designer 15.0.4.1108">
  <meta name="template" content="Banner 3.0.0">
  <meta name="environment" content="gwd-genericad">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="gwdpage_style.css" rel="stylesheet" data-version="13" data-exports-type="gwd-page">
  <link href="gwdpagedeck_style.css" rel="stylesheet" data-version="14" data-exports-type="gwd-pagedeck">
  <link href="gwdimage_style.css" rel="stylesheet" data-version="17" data-exports-type="gwd-image">
  <link href="gwdtaparea_style.css" rel="stylesheet" data-version="7" data-exports-type="gwd-taparea">
  <style id="gwd-lightbox-style">
    .gwd-lightbox {
      overflow: hidden;
    }
  </style>
  <style id="gwd-text-style">
    p {
      margin: 0px;
    }
    h1 {
      margin: 0px;
    }
    h2 {
      margin: 0px;
    }
    h3 {
      margin: 0px;
    }
  </style>
  <style>
    html, body {
      width: 100%;
      height: 100%;
      margin: 0px;
    }
    .gwd-page-container {
      position: relative;
      width: 100%;
      height: 100%;
    }
    .gwd-page-content {
      background-color: transparent;
      transform: perspective(1400px) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
      position: absolute;
      transform-style: preserve-3d;
    }
    .gwd-page-content * {
      transform-style: preserve-3d;
    }
    .gwd-page-wrapper {
      background-color: rgb(255, 255, 255);
      position: absolute;
      transform: translateZ(0px);
    }
    .gwd-page-size {
      width: 160px;
      height: 600px;
    }
    .gwd-rect-1ll0 {
      position: absolute;
      box-sizing: border-box;
      border-width: 1px;
      border-style: solid;
      border-color: rgb(0, 0, 0);
      left: 0px;
      top: 0px;
      width: 160px;
      height: 600px;
    }
    .gwd-image-13h3 {
      position: absolute;
      width: 135px;
      height: 32.96px;
      left: 13px;
      top: 506px;
    }
    .gwd-image-qwzt {
      position: absolute;
      width: 135px;
      height: 48.18px;
      left: 9px;
      top: 157px;
    }
    .gwd-input-k9vt {
      position: absolute;
      border: none;
      background-image: none;
      background-color: transparent;
      height: 18px;
      width: 100px;
      left: 40px;
      top: 513px;
    }
    .gwd-taparea-lspc {
      position: absolute;
      width: 130px;
      left: 15px;
      height: 40px;
      top: 544px;
    }
    .gwd-image-1efh {
      position: absolute;
      left: 9px;
      top: 106px;
      width: 105px;
      height: 18.41px;
    }
    .gwd-p-16bb {
      position: absolute;
      font-family: Verdana;
      background-image: none;
      background-color: transparent;
      color: rgb(0, 66, 136);
      font-weight: bold;
      width: 314px;
      line-height: 0px;
      letter-spacing: 1px;
      height: 10px;
      left: 10px;
      top: 136px;
      font-size: 18px;
    }
    input:focus::placeholder {
      color: transparent;
    }
    textarea:focus, input:focus {
      outline: none;
    }
    .gwd-image-1i3o {
      position: absolute;
      width: 160px;
      height: 600px;
      top: 0px;
      left: 1px;
    }
    .gwd-image-1xcr {
      position: absolute;
      width: 300px;
      height: 420px;
      top: 205px;
      left: 94px;
      transform: translate3d(100px, 0px, 0px);
    }
    @keyframes gwd-gen-4bzbgwdanimation_gwd-keyframes {
      0% {
        transform: translate3d(100px, 0px, 0px);
        animation-timing-function: ease;
      }
      100% {
        transform: translate3d(-130px, 0px, 0px);
        animation-timing-function: linear;
      }
    }
    #page1.gwd-play-animation .gwd-gen-4bzbgwdanimation {
      animation: 0.7s linear 0s 1 normal forwards running gwd-gen-4bzbgwdanimation_gwd-keyframes;
    }
    [data-gwd-group="button"] .gwd-grp-1b38.gwd-image-10ho {
      position: absolute;
      width: 120px;
      height: 29.29px;
      transform: translate3d(0px, 0px, 0px);
      left: 0px;
      top: 0px;
    }
    [data-gwd-group="button"] .gwd-grp-1b38.gwd-rect-361w {
      position: absolute;
      width: 120px;
      height: 29.2857px;
      box-sizing: border-box;
      border-width: 1px;
      border-style: solid;
      border-image-source: none;
      border-image-width: 1;
      border-image-outset: 0;
      border-image-repeat: stretch;
      border-color: transparent;
      background-image: none;
      background-color: rgb(244, 123, 32);
      border-radius: 3px;
      left: 0px;
      top: 0px;
    }
    .gwd-rect-361w:hover {
      transition: all 0.2s ease 0s;
      background-color: rgb(0, 0, 0) !important;
    }
    [data-gwd-group="button"] {
      width: 120px;
      height: 29.2857px;
    }
    .gwd-div-ap9v {
      position: absolute;
      left: 20px;
      top: 550px;
      transform: translate3d(0px, 0px, 0px) scale3d(1, 1, 1);
    }
    @keyframes gwd-gen-1e3ngwdanimation_gwd-keyframes {
      0% {
        transform: scale3d(1, 1, 1);
        animation-timing-function: linear;
      }
      18.1818% {
        transform: scale3d(1, 1, 1);
        animation-timing-function: ease;
      }
      22.7273% {
        transform: scale3d(1.1613, 1.1613, 1);
        animation-timing-function: ease;
      }
      27.2727% {
        transform: scale3d(1, 1, 1);
        animation-timing-function: linear;
      }
      54.5455% {
        transform: scale3d(1, 1, 1);
        animation-timing-function: ease;
      }
      59.0909% {
        transform: scale3d(1.1613, 1.1613, 1);
        animation-timing-function: ease;
      }
      63.6364% {
        transform: scale3d(1, 1, 1);
        animation-timing-function: linear;
      }
      90.9091% {
        transform: scale3d(1, 1, 1);
        animation-timing-function: ease;
      }
      95.4545% {
        transform: scale3d(1.1613, 1.1613, 1);
        animation-timing-function: ease;
      }
      96.5455% {
        transform: scale3d(1.099, 1.099, 1);
        animation-timing-function: ease;
      }
      100% {
        transform: scale3d(1, 1, 1);
        animation-timing-function: linear;
      }
    }
    #page1.gwd-play-animation .gwd-gen-1e3ngwdanimation {
      animation: 5.5s linear 0s 1 normal forwards running gwd-gen-1e3ngwdanimation_gwd-keyframes;
    }
  </style>
  <script data-source="googbase_min.js" data-version="4" data-exports-type="googbase" src="googbase_min.js"></script>
  <script data-source="gwd_webcomponents_v1_min.js" data-version="2" data-exports-type="gwd_webcomponents_v1" src="gwd_webcomponents_v1_min.js"></script>
  <script data-source="gwdpage_min.js" data-version="13" data-exports-type="gwd-page" src="gwdpage_min.js"></script>
  <script data-source="gwdpagedeck_min.js" data-version="14" data-exports-type="gwd-pagedeck" src="gwdpagedeck_min.js"></script>
  <script data-source="gwdimage_min.js" data-version="17" data-exports-type="gwd-image" src="gwdimage_min.js"></script>
  <script data-source="gwdtaparea_min.js" data-version="7" data-exports-type="gwd-taparea" src="gwdtaparea_min.js"></script>
  <script type="text/javascript" src="../../GWD/160x600/assets/get_variables.js"></script>
  <script>
    window.adcombi.getFeed(adcombi.feedUrl)
  </script>
  <script data-source="gwdgenericad_min.js" data-version="8" data-exports-type="gwd-genericad" src="gwdgenericad_min.js"></script>
  <script type="text/javascript" src="groups_runtime.min.1.0.js" gwd-groups-version="1.0"></script>
  <script type="text/javascript" src="gwdid.min.1.0.js" gwd-gwdid-version="1.0"></script>
  <script type="text/javascript" gwd-events="support" src="gwd-events-support.1.0.js"></script>
  <script type="text/javascript" gwd-events="handlers">
    gwd.auto_Gwd_taparea_1Action = function(event) {
      // GWD Predefined Function
      gwd.actions.gwdGenericad.exit('gwd-ad', 'https://www.kwik-fit.nl/apk.go?kenteken=%5Bkenteken%5D', true, 'page1');
    };
  </script>
  <script type="text/javascript" gwd-events="registration">
    // Ondersteuningscode voor gebeurtenisverwerking in Google Web Designer
    // Dit scriptblok is automatisch gegenereerd. Bewerk dit niet.
    gwd.actions.events.registerEventHandlers = function(event) {
      gwd.actions.events.addHandler('gwd-taparea_1', 'action', gwd.auto_Gwd_taparea_1Action, false);
    };
    gwd.actions.events.deregisterEventHandlers = function(event) {
      gwd.actions.events.removeHandler('gwd-taparea_1', 'action', gwd.auto_Gwd_taparea_1Action, false);
    };
    document.addEventListener("DOMContentLoaded", gwd.actions.events.registerEventHandlers);
    document.addEventListener("unload", gwd.actions.events.deregisterEventHandlers);
  </script>
</head>

<body>
  <template id="gwd-group-definitions">
    <div data-gwd-group-def="button" data-gwd-group-class="gwd-grp-1b38" style="display: none;">
      <svg data-gwd-shape="rectangle" class="gwd-rect-361w gwd-grp-1b38" data-gwd-grp-id="oranje"></svg>
      <gwd-image source="assets/button-text.svg" scaling="stretch" class="gwd-image-10ho gwd-grp-1b38" data-gwd-grp-id="button"></gwd-image>
    </div>
  </template>
  <gwd-genericad id="gwd-ad">
    <gwd-pagedeck class="gwd-page-container" id="pagedeck">
      <gwd-page id="page1" class="gwd-page-wrapper gwd-page-size gwd-lightbox" data-gwd-width="160px" data-gwd-height="600px">
        <div class="gwd-page-content gwd-page-size">
          <gwd-image id="Achtergrond_KF_HTML_Banners_APK_zonder_man-5" source="assets/Achtergrond KF HTML Banners APK zonder man-5.jpg" scaling="stretch" class="gwd-image-1i3o" data-gwd-tl-locked=""></gwd-image>
          <gwd-image id="Man" source="assets/Man.png" scaling="stretch" class="gwd-image-1xcr gwd-gen-4bzbgwdanimation" data-gwd-tl-locked=""></gwd-image>
          <gwd-image id="kenteken" source="assets/Assets-kenteken.svg" scaling="stretch" class="gwd-image-13h3" data-gwd-tl-locked=""></gwd-image>
          <gwd-image id="je-apk" source="assets/je-apk.svg" scaling="stretch" class="gwd-image-1efh" data-gwd-tl-locked=""></gwd-image>
          <p class="gwd-p-16bb" data-gwd-tl-locked="">Plaatsnaam?</p>
          <gwd-image id="altijd-snel-300-600" source="assets/Assets-altijd-snel-300-600.svg" scaling="stretch" class="gwd-image-qwzt" data-gwd-tl-locked=""></gwd-image>
          <svg data-gwd-shape="rectangle" class="gwd-rect-1ll0" data-gwd-tl-locked=""></svg>
          <div class="gwd-div-ap9v gwd-gen-1e3ngwdanimation" data-gwd-group="button" id="knop"></div>
          <gwd-taparea id="gwd-taparea_1" class="gwd-taparea-lspc" data-gwd-tl-locked=""></gwd-taparea>
          <input type="text" id="textfield" class="gwd-input-k9vt" placeholder="Jouw kenteken" style="text-align: center; text-transform: uppercase; font-weight: bold; font-size: 11px;" data-gwd-tl-locked="">
        </div>
      </gwd-page>
    </gwd-pagedeck>
  </gwd-genericad>
  <script type="text/javascript" id="gwd-init-code">
    (function() {
      var gwdAd = document.getElementById('gwd-ad');

      /**
       * Handles the DOMContentLoaded event. The DOMContentLoaded event is
       * fired when the document has been completely loaded and parsed.
       */
      function handleDomContentLoaded(event) {

      }

      /**
       * Handles the WebComponentsReady event. This event is fired when all
       * custom elements have been registered and upgraded.
       */
      function handleWebComponentsReady(event) {
        // Start the Ad lifecycle.
        requestAnimationFrame(function() {
          setTimeout(function() {
            gwdAd.initAd();
          }, 1);
        });
      }

      /**
       * Handles the event that is dispatched after the Ad has been
       * initialized and before the default page of the Ad is shown.
       */
      function handleAdInitialized(event) {}

      window.addEventListener('DOMContentLoaded',
        handleDomContentLoaded, false);
      window.addEventListener('WebComponentsReady',
        handleWebComponentsReady, false);
      window.addEventListener('adinitialized',
        handleAdInitialized, false);
    })();
  </script>
</body>

</html>
</code>```

Body:
For work I need to make some HTML5 banners and they are almost done except for 1 thing.
I need to code a hover change in the following HTML5 banner.
When you hover over the button the background colour of the rectangle need to change from orange to black.

Class gwd-grp-1b38 / ID 'oranje'

But it doesn't work... Any idea how to fix this?

I tried multiple things, even removed the tap area but the colour still didn't change.
The text on the button is a svg file because the fonts aren't online fonts, this resulted in making the button like this.

<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="generator" content="Google Web Designer 15.0.4.1108">
  <meta name="template" content="Banner 3.0.0">
  <meta name="environment" content="gwd-genericad">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="gwdpage_style.css" rel="stylesheet" data-version="13" data-exports-type="gwd-page">
  <link href="gwdpagedeck_style.css" rel="stylesheet" data-version="14" data-exports-type="gwd-pagedeck">
  <link href="gwdimage_style.css" rel="stylesheet" data-version="17" data-exports-type="gwd-image">
  <link href="gwdtaparea_style.css" rel="stylesheet" data-version="7" data-exports-type="gwd-taparea">

  <template id="gwd-group-definitions">

      <svg data-gwd-shape="rectangle" class="gwd-rect-361w gwd-grp-1b38" data-gwd-grp-id="oranje"></svg>
      <gwd-image source="assets/button-text.svg" scaling="stretch" class="gwd-image-10ho gwd-grp-1b38" data-gwd-grp-id="button"></gwd-image>

  </template>
  <gwd-genericad id="gwd-ad">
    <gwd-pagedeck class="gwd-page-container" id="pagedeck">
      <gwd-page id="page1" class="gwd-page-wrapper gwd-page-size gwd-lightbox" data-gwd-width="160px" data-gwd-height="600px">

          <gwd-image id="Achtergrond_KF_HTML_Banners_APK_zonder_man-5" source="assets/Achtergrond KF HTML Banners APK zonder man-5.jpg" scaling="stretch" class="gwd-image-1i3o" data-gwd-tl-locked=""></gwd-image>
          <gwd-image id="Man" source="assets/Man.png" scaling="stretch" class="gwd-image-1xcr gwd-gen-4bzbgwdanimation" data-gwd-tl-locked=""></gwd-image>
          <gwd-image id="kenteken" source="assets/Assets-kenteken.svg" scaling="stretch" class="gwd-image-13h3" data-gwd-tl-locked=""></gwd-image>
          <gwd-image id="je-apk" source="assets/je-apk.svg" scaling="stretch" class="gwd-image-1efh" data-gwd-tl-locked=""></gwd-image>

Plaatsnaam?

          <gwd-image id="altijd-snel-300-600" source="assets/Assets-altijd-snel-300-600.svg" scaling="stretch" class="gwd-image-qwzt" data-gwd-tl-locked=""></gwd-image>
          <svg data-gwd-shape="rectangle" class="gwd-rect-1ll0" data-gwd-tl-locked=""></svg>

          <gwd-taparea id="gwd-taparea_1" class="gwd-taparea-lspc" data-gwd-tl-locked=""></gwd-taparea>
          <input type="text" id="textfield" class="gwd-input-k9vt" placeholder="Jouw kenteken" style="text-align: center; text-transform: uppercase; font-weight: bold; font-size: 11px;" data-gwd-tl-locked="">

      </gwd-page>
    </gwd-pagedeck>
  </gwd-genericad>


问:
Why DTW (dynamic time warping) so computationally intensive
Why is DTW so much more computationally intensive compared to euclidean distance metric?
Did not find much in literature.
Thank you.</p>


问:
Is JMC's "Java Monitor Blocked" caused by vert.x Http1xServerConnection problem?
I do profile my vert.x based http service and noticed in JMC that all my envelop threads(aka verticles) produce lots of "Java Monitor Blocked" events in class io.vertx.core.http.impl.Http1xServerConnection. Javadoc of this class says: "The internal state is protected using the synchronized keyword. If always used on the same event loop, then we benefit from biased locking which makes the overhead of synchronized near zero.". I noticed that JDK17 I use has BiasedLocking turned off. I try to run test with turned on BiasedLocking but nothing changed. It also says that BiasedLocking was deprecated and could be removed. In the internet I found this SO topic which says that it's fine that vert.x uses synchronized in some classes Does Vert.x have plans addressing the deprecation of biased locking in Java 15?

My question is that does the JMC profile looks good or I should worry and there is a performance issues in my code?


问:
Working example of @nativescript/firebase-firestore
I am trying to use the @nativescript/firebase-firestore and @nativescript/firebase-core plugin from Nativescript in my Nativescript angular project.

I ran

npm install @nativescript/firebase-core

npm install @nativescript/firebase-firestore
```
<p>and put this code to my blank native script angular project.</p>
<pre class="lang-js prettyprint-override"><code>import { firebase } from '@nativescript/firebase-core'
import '@nativescript/firebase-firestore'
const firestore = firebase().firestore()
</code>```

I was not able to make this work for IOS due to some compatibility issues.

My questions : Has anybody put this to work and could provide me a working example?

Here is my package.json :

{
  "name": "fb3",
  "main": "./src/main.ts",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "@angular/animations": "~15.0.0",
    "@angular/common": "~15.0.0",
    "@angular/compiler": "~15.0.0",
    "@angular/core": "~15.0.0",
    "@angular/forms": "~15.0.0",
    "@angular/platform-browser": "~15.0.0",
    "@angular/platform-browser-dynamic": "~15.0.0",
    "@angular/router": "~15.0.0",
    "@nativescript/angular": "~15.0.0",
    "@nativescript/core": "~8.4.0",
    "@nativescript/firebase-core": "^2.5.2",
    "@nativescript/firebase-firestore": "^2.5.2",
    "@nativescript/theme": "~3.0.2",
    "rxjs": "~7.5.0",
    "zone.js": "~0.11.5"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~15.0.0",
    "@angular/compiler-cli": "~15.0.0",
    "@nativescript/ios": "8.3.3",
    "@nativescript/types": "~8.4.0",
    "@nativescript/webpack": "~5.0.12",
    "@ngtools/webpack": "~15.0.0",
    "typescript": "~4.8.4"
  }
}
```
<p>It seems that there are issues with min required iOS version is 11.0 so I added</p>
<pre class="lang-js prettyprint-override"><code>IPHONEOS_DEPLOYMENT_TARGET = 11.0;
</code>```

to my build.xcconfig.

Body:
I am trying to use the @nativescript/firebase-firestore and @nativescript/firebase-core plugin from Nativescript in my Nativescript angular project.

I ran

npm install @nativescript/firebase-core

npm install @nativescript/firebase-firestore

and put this code to my blank native script angular project.

import { firebase } from '@nativescript/firebase-core'
import '@nativescript/firebase-firestore'
const firestore = firebase().firestore()

I was not able to make this work for IOS due to some compatibility issues.

My questions : Has anybody put this to work and could provide me a working example?

Here is my package.json :

{
  "name": "fb3",
  "main": "./src/main.ts",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "@angular/animations": "~15.0.0",
    "@angular/common": "~15.0.0",
    "@angular/compiler": "~15.0.0",
    "@angular/core": "~15.0.0",
    "@angular/forms": "~15.0.0",
    "@angular/platform-browser": "~15.0.0",
    "@angular/platform-browser-dynamic": "~15.0.0",
    "@angular/router": "~15.0.0",
    "@nativescript/angular": "~15.0.0",
    "@nativescript/core": "~8.4.0",
    "@nativescript/firebase-core": "^2.5.2",
    "@nativescript/firebase-firestore": "^2.5.2",
    "@nativescript/theme": "~3.0.2",
    "rxjs": "~7.5.0",
    "zone.js": "~0.11.5"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~15.0.0",
    "@angular/compiler-cli": "~15.0.0",
    "@nativescript/ios": "8.3.3",
    "@nativescript/types": "~8.4.0",
    "@nativescript/webpack": "~5.0.12",
    "@ngtools/webpack": "~15.0.0",
    "typescript": "~4.8.4"
  }
}

It seems that there are issues with min required iOS version is 11.0 so I added

IPHONEOS_DEPLOYMENT_TARGET = 11.0;

to my build.xcconfig.