问:
TimeSlider destroys my existing Choropleth
I have two Problems with my folium map.

Layering does not work proberly.

Time Slider do not work well (Invalid Time eg. 2016-08) is not recognized by the TimeSlider.) This I think is solvable by me.

To be specific:

I created a choropleth map. I also use feature groups but not for the choropleth.

```<code>c = folium.Choropleth(
    geo_data=wohnviertel,
    name="choropleth",
    data=sname_and_dis,
    columns=["Wohnviertel", "Counts"],
    key_on='feature.properties.Wohnviertel',
    fill_color="BuPu",
    fill_opacity=0.55,
    line_opacity=.35,
    highlight=True,
    line_color='black',
    legend_name="Amount of Street in District"
).add_to(map)
</code>```

Which is also a layer and directly added to the map. Before creating the choropleth map I want to do a TimeSliderChoropleth in the same map with different datas as a feature group.

```<code>fg = folium.FeatureGroup(name='Timeslider', show=False)
.
.
.
.
TimeSliderChoropleth(data=wohnviertel,styledict=style_dict,overlay=True).add_to(fg)
cmap.add_to(fg)
map.add_child(fg)
</code>```

When I do this, then the other layers are completly gone from the map. And featuregroup does not work then. If I do not create this TimeSlider then everything works very well. But I want to have a layer which has a timeslider in it. Did anyone has the same problem? Or has a approach to solve it?

Thanks

I tried to Featuring the groups, but that did not solve the problem.
Such that the TimeSlider is a featuregroup.

Body:
I have two Problems with my folium map.

Layering does not work proberly.

Time Slider do not work well (Invalid Time eg. 2016-08) is not recognized by the TimeSlider.) This I think is solvable by me.

To be specific:

I created a choropleth map. I also use feature groups but not for the choropleth.

c = folium.Choropleth(
    geo_data=wohnviertel,
    name="choropleth",
    data=sname_and_dis,
    columns=["Wohnviertel", "Counts"],
    key_on='feature.properties.Wohnviertel',
    fill_color="BuPu",
    fill_opacity=0.55,
    line_opacity=.35,
    highlight=True,
    line_color='black',
    legend_name="Amount of Street in District"
).add_to(map)

Which is also a layer and directly added to the map. Before creating the choropleth map I want to do a TimeSliderChoropleth in the same map with different datas as a feature group.

fg = folium.FeatureGroup(name='Timeslider', show=False)
.
.
.
.
TimeSliderChoropleth(data=wohnviertel,styledict=style_dict,overlay=True).add_to(fg)
cmap.add_to(fg)
map.add_child(fg)

When I do this, then the other layers are completly gone from the map. And featuregroup does not work then. If I do not create this TimeSlider then everything works very well. But I want to have a layer which has a timeslider in it. Did anyone has the same problem? Or has a approach to solve it?

Thanks

I tried to Featuring the groups, but that did not solve the problem.
Such that the TimeSlider is a featuregroup.


来源: stackexchange

问:
TYPO3 10 - News router with multilanguage support
In my TYPO3 site, we create news in german and translate it to english.
On my search for canonical urls for the news component, I found these helpful answer here:
https://stackoverflow.com/a/53836388/20815643

This solution works fine but not completly free of problems.
I use the code and the 2 lines routeFieldPattern and routeFieldResult create links like this:

abc.de/news/hallo-welt-2022-1763

This works without translation and the canonical URL are correct. But if I translate my news, then the correct uid have to be 1764, but the router create a link with the original news uid (1763):

abc.de/en/news/hello-world-2022-1763

The correct link should be this:

abc.de/en/news/hello-world-2022-1764

I looking for an solution to handle also the language id in the router config, but I stuck.
How can I use the language id to get full correct link?

I search for more parameters to the routeEnhancer, but found nothing.

ContentLicense: CC BY-SA 4.0


问:
How to format output of table() function in R
I am trying to print the result of table() using knitr. My MWE:

```<code>df <- data.frame(Linha=c("A","A","A","B","B","C"), Coluna=c(1,2,1,1,2,3))
tab <- table(df)
kableExtra::kbl(tab,,format = "latex")
</code>```

I get this:

With no variable names. But I would like this:

Is it possible?
Thanks!

Body:
I am trying to print the result of table() using knitr. My MWE:

df <- data.frame(Linha=c("A","A","A","B","B","C"), Coluna=c(1,2,1,1,2,3))
tab <- table(df)
kableExtra::kbl(tab,,format = "latex")

I get this:

With no variable names. But I would like this:

Is it possible?
Thanks!


问:
How can I make an "isAdmin" verification middleware?
I have an authentication middleware, where I check through my route if the user is authenticated in the header with the security token

middlewareAuth

```<code>import { Request, Response, NextFunction } from 'express';
import jwt from 'jsonwebtoken';

interface TokenPayload {
  id: string;
  iat: number;
  exp: number;
}

export default async function authMiddleware(
  req: Request, res: Response, next: NextFunction
  ) {
    const { authorization }  = req.headers;

    if (!authorization) {
      return res.status(401).json('Invalid Authorization');
    };

    const token = authorization.replace('Bearer', ' ').trim();

    try {
      const secret = process.env.JWT_SECRET as string;
      const data = jwt.verify(token, secret);

      const { id } = data as TokenPayload;

      req.userId = id;

      return next();
    } catch (err) {
      return res.status(401).json(err);
    }
}

</code>```

I import this middleware in my route, thus verifying as I describe below:

```<code>import { Router } from "express";

import CreatePost from "../controllers/postControllers/CreatePost";

import authMiddleware from "../middlewares/AuthMiddlewares";

const router = Router();

router.post('/', authMiddleware, CreatePost.store);

export default router;
</code>```

Within my user entity, I have a boolean called "isAdmin" which by default returns false. I would like a middleware that checks if also within my profile isAdmin is true and thus authenticate and put in the route along with AuthMiddleware. For that I tried to import my AuthMiddleware and verify, but without success.

```<code>import { Request, Response, NextFunction } from 'express';
import jwt from 'jsonwebtoken';
import authMiddleware from './AuthMiddlewares';

export default async function authAdminMiddleware(
    req: Request, res: Response, next: NextFunction,
) {
    authMiddleware(req, res, () => {
        if (req.userId.isAdmin) {
            next();
        } else {
            res.status(403).json("You are not alowed to do that!");
        }
    })
}

</code>```
```<code>Property 'isAdmin' does not exist on type 'string'.ts(2339)
</code>```

What would be the most effective way to create this middleware? Can anyone give me some help? Thanks

Body:
I have an authentication middleware, where I check through my route if the user is authenticated in the header with the security token

middlewareAuth

import { Request, Response, NextFunction } from 'express';
import jwt from 'jsonwebtoken';

interface TokenPayload {
  id: string;
  iat: number;
  exp: number;
}

export default async function authMiddleware(
  req: Request, res: Response, next: NextFunction
  ) {
    const { authorization }  = req.headers;

    if (!authorization) {
      return res.status(401).json('Invalid Authorization');
    };

    const token = authorization.replace('Bearer', ' ').trim();

    try {
      const secret = process.env.JWT_SECRET as string;
      const data = jwt.verify(token, secret);

      const { id } = data as TokenPayload;

      req.userId = id;

      return next();
    } catch (err) {
      return res.status(401).json(err);
    }
}

I import this middleware in my route, thus verifying as I describe below:

import { Router } from "express";

import CreatePost from "../controllers/postControllers/CreatePost";

import authMiddleware from "../middlewares/AuthMiddlewares";

const router = Router();

router.post('/', authMiddleware, CreatePost.store);

export default router;

Within my user entity, I have a boolean called "isAdmin" which by default returns false. I would like a middleware that checks if also within my profile isAdmin is true and thus authenticate and put in the route along with AuthMiddleware. For that I tried to import my AuthMiddleware and verify, but without success.

import { Request, Response, NextFunction } from 'express';
import jwt from 'jsonwebtoken';
import authMiddleware from './AuthMiddlewares';

export default async function authAdminMiddleware(
    req: Request, res: Response, next: NextFunction,
) {
    authMiddleware(req, res, () => {
        if (req.userId.isAdmin) {
            next();
        } else {
            res.status(403).json("You are not alowed to do that!");
        }
    })
}

Property 'isAdmin' does not exist on type 'string'.ts(2339)

What would be the most effective way to create this middleware? Can anyone give me some help? Thanks


问:
Date value is not visible
I have make my own input component in react js.
and in input component i took input date, when i enter details in form all the values were stored in db but when i fetch data from
database on browser using axios in react js, data is not visible in date field. its shows dd/mm/yyyy

Input looks like this.

```<code>          <Box sx={{ flexBasis: 0, flexGrow: 1 }}>
            <Input
              autofill={state.startDate}
              id="startDate"
              value="Start Date"
              type="date"
              readOnly={disabled}
              required
            />
          </Box>
          <Box sx={{ flexBasis: 0, flexGrow: 1 }}>
            <Input
              autofill={state.endDate}
              id="endDate"
              value="End Date"
              readOnly={disabled}
              type="date"
            />
          </Box>
        </Box>

slice

export interface Data {
  culturalProgramId: number;
  referenceId: number;
  name: string;
  type: string;
  status: string;
  caseworker: string;
  startDate: string;
  endDate: string;
  totalCost: any;
  totalParticipation: any;
  sessionDetails: string;
  costOrParticipationDetails: string;
  outcomes: string;
  notes: string;
}

submit handler

const submitHandler = (e: FormEvent) => {
    e.preventDefault();
    const form: any = e.currentTarget;
    const formData: Data = {
      culturalProgramId: state.culturalProgramId,
      referenceId: state.referenceId,
      name: form.name.value,
      type: form.type.value,
      status: form.status.value,
      caseworker: form.caseworker.value,
      startDate: form.startDate.value,
      endDate: form.endDate.value,
      totalCost: form.totalCost.value,
      totalParticipation: form.totalParticipation.value,
      sessionDetails: form.sessionDetails.value,
      costOrParticipationDetails: form.costOrParticipationDetails.value,
      outcomes: form.outcomes.value,
      notes: form.notes.value,
    };

[output looks like this][1]

  [1]: https://i.stack.imgur.com/h7Xai.jpg
</code>```

Title: Date value is not visible

Body:
I have make my own input component in react js.
and in input component i took input date, when i enter details in form all the values were stored in db but when i fetch data from
database on browser using axios in react js, data is not visible in date field. its shows dd/mm/yyyy

Input looks like this.

          <Box sx={{ flexBasis: 0, flexGrow: 1 }}>
            <Input
              autofill={state.startDate}
              id="startDate"
              value="Start Date"
              type="date"
              readOnly={disabled}
              required
            />
          </Box>
          <Box sx={{ flexBasis: 0, flexGrow: 1 }}>
            <Input
              autofill={state.endDate}
              id="endDate"
              value="End Date"
              readOnly={disabled}
              type="date"
            />
          </Box>
        </Box>

slice

export interface Data {
  culturalProgramId: number;
  referenceId: number;
  name: string;
  type: string;
  status: string;
  caseworker: string;
  startDate: string;
  endDate: string;
  totalCost: any;
  totalParticipation: any;
  sessionDetails: string;
  costOrParticipationDetails: string;
  outcomes: string;
  notes: string;
}

submit handler

const submitHandler = (e: FormEvent) => {
    e.preventDefault();
    const form: any = e.currentTarget;
    const formData: Data = {
      culturalProgramId: state.culturalProgramId,
      referenceId: state.referenceId,
      name: form.name.value,
      type: form.type.value,
      status: form.status.value,
      caseworker: form.caseworker.value,
      startDate: form.startDate.value,
      endDate: form.endDate.value,
      totalCost: form.totalCost.value,
      totalParticipation: form.totalParticipation.value,
      sessionDetails: form.sessionDetails.value,
      costOrParticipationDetails: form.costOrParticipationDetails.value,
      outcomes: form.outcomes.value,
      notes: form.notes.value,
    };

[output looks like this][1]

  [1]: https://i.stack.imgur.com/h7Xai.jpg


问:
How can I determine what version of JavaFX libraries I'm using in a given IntelliJ project?
I have a problem with an IntelliJ project which I'd like to raise on this forum, but before I do so, I want to gather all the information I can about my environment.

MacOS 13.0.1 (Ventura)
IntelliJ Community Edition 2021.2
JDK 15.0.2
... but I'm also using JavaFX libraries, and I presume it will help to say what version they're at.


问:
Kedro, running inference on user input
I have a pipeline with the model I want to use. Outside of the project, I have an app.py file where I'm going to create the UI/UX for my users to run my model. Right now I'm just using a sample string but later on, you can imagine that there will be a textbox for users to type.

How can I pass the user input as an input to the pipeline? I though I would be able to do so with the kedro.framework.session.session.KedroSession as seen in the code below, but doing so results in the error ValueError: Pipeline input(s) {'user-input'} not found in the DataCatalog

```<code>from kedro.framework.session import KedroSession
from kedro.framework.startup import bootstrap_project
from kedro.io import MemoryDataSet
import os

bootstrap_project("<project path>")

user_input = "this is a sample text"
user_input = MemoryDataSet(user_input)

with KedroSession.create("project") as session:
    output = session.run(
        "nlp-pipeline",
        from_inputs={
            "user-input": user_input
        }
    )

print(output)
</code>```

Title: Kedro, running inference on user input

Body:
I have a pipeline with the model I want to use. Outside of the project, I have an app.py file where I'm going to create the UI/UX for my users to run my model. Right now I'm just using a sample string but later on, you can imagine that there will be a textbox for users to type.

How can I pass the user input as an input to the pipeline? I though I would be able to do so with the kedro.framework.session.session.KedroSession as seen in the code below, but doing so results in the error ValueError: Pipeline input(s) {'user-input'} not found in the DataCatalog

from kedro.framework.session import KedroSession
from kedro.framework.startup import bootstrap_project
from kedro.io import MemoryDataSet
import os

bootstrap_project("<project path>")

user_input = "this is a sample text"
user_input = MemoryDataSet(user_input)

with KedroSession.create("project") as session:
    output = session.run(
        "nlp-pipeline",
        from_inputs={
            "user-input": user_input
        }
    )

print(output)


问:
Connector for SAP and Textura
Is there a connector to textura and SAP? We are implementing s/4hana and we have a department that uses textura.

Simple short yes or no answer along with information if there is a connector.

Title: Connector for SAP and Textura


问:
Is it possible to create an SQL constraint on a group of rows (Azure SQL)
Is it possible to create an SQL constraint or index of some sort on a group of rows? Like a unique constraint but applied to multiple rows. Rows could be duplicated but it would not be possible to have more than one variation of each group. Simplified example:

Given the following table with inserted data:

```<code>CREATE TABLE MyTable
(
    ValueColumn INT NOT NULL,
    DateColumn DATETIME NOT NULL
)

INSERT INTO MyTable VALUES(1, '2001-01-01 00:00:00.000')
INSERT INTO MyTable VALUES(1, '2001-01-01 00:00:00.000')
INSERT INTO MyTable VALUES(2, '2002-02-02 00:00:00.000')
INSERT INTO MyTable VALUES(2, '2002-02-02 00:00:00.000')
INSERT INTO MyTable VALUES(2, '2002-02-02 00:00:00.000')
INSERT INTO MyTable VALUES(3, '2003-03-03 00:00:00.000')
</code>```

Inserting this row should be possible:

```<code>INSERT INTO MyTable VALUES(3, '2003-03-03 00:00:00.000')
</code>```

But trying to insert this row should result in an error:

```<code>INSERT INTO MyTable VALUES(3, '2004-04-04 00:00:00.000') --> Violates constraint
</code>```

Essentially the following queries should always return no rows:

```<code>SELECT [ValueColumn], [DateColumn]
FROM [MyTable]
GROUP BY [ValueColumn], [DateColumn]
HAVING COUNT(DISTINCT [DateColumn]) > 1

SELECT [ValueColumn], [DateColumn]
FROM [MyTable]
GROUP BY [ValueColumn], [DateColumn]
HAVING MAX(DateColumn) != MIN(DateColumn)
</code>```

I understand this could be done with a trigger or manual clean up process but I was wondering if there was a way to add it as a constraint on the data model itself.

Body:
Is it possible to create an SQL constraint or index of some sort on a group of rows? Like a unique constraint but applied to multiple rows. Rows could be duplicated but it would not be possible to have more than one variation of each group. Simplified example:

Given the following table with inserted data:

CREATE TABLE MyTable
(
    ValueColumn INT NOT NULL,
    DateColumn DATETIME NOT NULL
)

INSERT INTO MyTable VALUES(1, '2001-01-01 00:00:00.000')
INSERT INTO MyTable VALUES(1, '2001-01-01 00:00:00.000')
INSERT INTO MyTable VALUES(2, '2002-02-02 00:00:00.000')
INSERT INTO MyTable VALUES(2, '2002-02-02 00:00:00.000')
INSERT INTO MyTable VALUES(2, '2002-02-02 00:00:00.000')
INSERT INTO MyTable VALUES(3, '2003-03-03 00:00:00.000')

Inserting this row should be possible:

INSERT INTO MyTable VALUES(3, '2003-03-03 00:00:00.000')

But trying to insert this row should result in an error:

INSERT INTO MyTable VALUES(3, '2004-04-04 00:00:00.000') --> Violates constraint

Essentially the following queries should always return no rows:

SELECT [ValueColumn], [DateColumn]
FROM [MyTable]
GROUP BY [ValueColumn], [DateColumn]
HAVING COUNT(DISTINCT [DateColumn]) > 1

SELECT [ValueColumn], [DateColumn]
FROM [MyTable]
GROUP BY [ValueColumn], [DateColumn]
HAVING MAX(DateColumn) != MIN(DateColumn)

I understand this could be done with a trigger or manual clean up process but I was wondering if there was a way to add it as a constraint on the data model itself.


问:
Spring Data Mongo Db transactional annotation error handling of TransientTransactionError
I have multiple operations on Mongo which I want to be considered as one operation so I enabled transactions. I'm using Mongo version 5.

The configuration class contains the following bean definition:

```<code>@Bean(name = "transactionManager")
MongoTransactionManager transactionManager(MongoDatabaseFactory dbFactory) {
    return new MongoTransactionManager(dbFactory);
}
</code>```

My business logic is similar to below snippet. Assume inside this method there are changes done on different collections.

```<code>@Transactional
public MyResult create(String payload) {
    //operations omitted for brevity
}
</code>```

Based on the Mongo documentation (https://www.mongodb.com/docs/v5.0/core/transactions/) I quote:

The new callback API also incorporates retry logic for TransientTransactionError or UnknownTransactionCommitResult commit errors.

Also this as reference: https://github.com/mongodb/specifications/blob/master/source/transactions/transactions.rst#error-labels

Does Spring data Mongo db know how to handle the TransientTransactionError (including the retry described in the docs)? If not what are the alternatives?

Body:
I have multiple operations on Mongo which I want to be considered as one operation so I enabled transactions. I'm using Mongo version 5.

The configuration class contains the following bean definition:

@Bean(name = "transactionManager")
MongoTransactionManager transactionManager(MongoDatabaseFactory dbFactory) {
    return new MongoTransactionManager(dbFactory);
}

My business logic is similar to below snippet. Assume inside this method there are changes done on different collections.

@Transactional
public MyResult create(String payload) {
    //operations omitted for brevity
}

Based on the Mongo documentation (https://www.mongodb.com/docs/v5.0/core/transactions/) I quote:

The new callback API also incorporates retry logic for TransientTransactionError or UnknownTransactionCommitResult commit errors.

Also this as reference: https://github.com/mongodb/specifications/blob/master/source/transactions/transactions.rst#error-labels

Does Spring data Mongo db know how to handle the TransientTransactionError (including the retry described in the docs)? If not what are the alternatives?


问:
How do I persist data between callbacks in Python Dash to make an alert?
I have a bunch of badges on my homepage whose colour indicates whether a background process is safely running or not. Using dcc.Interval, every 30 seconds a redis get command pulls information about those background processes, and accordingly updates the colour of those badges.
I am trying to make it so if one of those badges turn red, an alert noise to go off.
The difficulty I am having is in how to save the data of the current colours, so that next callback I can create the new list, compare to the old, and then update the old with the new for the next callback to use.

My callback that updates the badges is currently as follows:

```<code>
    def initialise_callbacks(app):
        @app.callback(
            [Output("{}".format(file), "color") for file in files],
            [Input("live-update2", "n_intervals")],
        )
        def update_greeks(interval):

            # default to list of "danger"
            color_list = ["danger" for i in files]

            i = 0
            for file in files:
                update_time = conn.get("{}_update".format(file.upper())) #get status from database
                if update_time:
                    if update_time.isOld:
                        color_list[i] = "success"
                    else:
                        color_list[i] = "danger"
                else:
                    color_list[i] = "danger"
            i = i + 1
            return color_list
</code>```

How do I use/save my output, color_list, in a way that next callback I can create a new color_list and compare it with the state in the previous callback, and then keep this loop going?

I have tried using dcc.Store and State, but keep running into problems with using the same variables as inputs (to compare with the new values) and then wanting to output the values too (which breaks the function as you can't have the same variables as input and output.
One solution would be to run database get commands twice in two different callbacks, once to update the colours, another to compare and update the memory store, but ideally this can be done without extra database steps.

Body:
I have a bunch of badges on my homepage whose colour indicates whether a background process is safely running or not. Using dcc.Interval, every 30 seconds a redis get command pulls information about those background processes, and accordingly updates the colour of those badges.
I am trying to make it so if one of those badges turn red, an alert noise to go off.
The difficulty I am having is in how to save the data of the current colours, so that next callback I can create the new list, compare to the old, and then update the old with the new for the next callback to use.

My callback that updates the badges is currently as follows:

    def initialise_callbacks(app):
        @app.callback(
            [Output("{}".format(file), "color") for file in files],
            [Input("live-update2", "n_intervals")],
        )
        def update_greeks(interval):

            # default to list of "danger"
            color_list = ["danger" for i in files]

            i = 0
            for file in files:
                update_time = conn.get("{}_update".format(file.upper())) #get status from database
                if update_time:
                    if update_time.isOld:
                        color_list[i] = "success"
                    else:
                        color_list[i] = "danger"
                else:
                    color_list[i] = "danger"
            i = i + 1
            return color_list

How do I use/save my output, color_list, in a way that next callback I can create a new color_list and compare it with the state in the previous callback, and then keep this loop going?

I have tried using dcc.Store and State, but keep running into problems with using the same variables as inputs (to compare with the new values) and then wanting to output the values too (which breaks the function as you can't have the same variables as input and output.
One solution would be to run database get commands twice in two different callbacks, once to update the colours, another to compare and update the memory store, but ideally this can be done without extra database steps.


问:
Binary Search Tree Updating
How can I update values in Binary Search Tree without affecting its properties (all the nodes in the left subtree have values that are less than the value of the root node and all the nodes of the right subtree have values that are greater than the value of the root node).

I tried deleting and inserting the new Value, but It's an assignment and my teacher wants different solution using rotations or swaps.

Title: Binary Search Tree Updating


问:
Use Mockito inline mock generation for a subset of tests
I tried using Mockito 2+'s inline-mocks feature to mock final classes, but I find it breaks a number of our existing tests for inexplicable reasons. Is it possible to enable inline-mocks only for specific tests?

The "normal" ways of enabling the inline mock generation is to create a file resources/mockito-extensions/org.mockito.plugins.MockMaker with the contents mock-maker-inline somewhere in the class path or to depend on the mockito-inline artifact. These seems to enable inline mock generation globally. Until I can figure out why the inline mocks break our existing tests it would be great if I can enable it only for the tests that need it.


问:
RoundedRectangle not shrinking to fit gap

I am trying to display a sort of progress bar, with two RoundedRectangles, of variable width, either side of some text.

The RoundedRectangle on the left receives an explicit width (42, and 75, in my images). When set to 42, the text is displayed correctly and the RoundedRectangle on the right auto sizes to fill the remaining gap. When set to 75, the text is cut off (it should say 7+ days, and the RoundedRectangle doesn't shrink any more than is shown. Why is this? I want to see the text, and the RoundedRectangle should shrink more.

HStack {
    RoundedRectangle(cornerRadius: 25)
        .fill(LinearGradient(
            gradient: .init(colors: [blue1, blue2]),
            startPoint: .init(x: 0.5, y: 0.5),
            endPoint: .init(x: 1, y: 0.5)
        ))
        .ignoresSafeArea()
        .opacity(1)
        .frame(width: ((Float(UIScreen.main.bounds.width) - 48) / 100) * 75, height: 8)

    Text(.init(times[selected]))
        .font(.system(size: 16, weight: .thin, design: .rounded))
        .foregroundColor(.white)
        .opacity(0.9)
        .lineLimit(1)

    RoundedRectangle(cornerRadius: 25)
        .fill(.white)
        .ignoresSafeArea()
        .opacity(0.4)
        .frame(height: 8)
}

```


问:
Custom web font special character not working in WebKit (iOS/Safari) but works on Chrome
I am using a custom web font from a type foundry, called herbier,  that is made up of characters.

How can i view this font on all browsers?
Chrome works fine, but Safari and iOS turn the type into numerals.
this is an example of the font working on safari from the original website
I am using amazon aws to host this site.

I have looked up many explanations.
changing the display: swap, text to italic, redownloading the text files, urls i use link to the fonts uploaded to my domain, i tried using text-rendering: optimizeLegibility and downloaded the web kit so i would have all svg, woff, woff versions of this font etc etc.

The specimen file has said ' The most common problem here is that you are serving the fonts from an IIS server. IIS refuses to serve files that have unknown MIME types. If that is the case, you must set the MIME type for SVG to "image/svg+xml" in the server settings.'

Is there any simple way to solve this?

Example code for a different font that works :

```<code>@font-face {
        font-family: Director-light;
        src: url('https://s3.console.aws.amazon.com/s3/object/www.MYWEBSITE.net?region=eu-west-1&prefix=Director-Light.otf'); src: url('https://s3.console.aws.amazon.com/s3/object/www.MYWEBSITE.net?region=eu-west-1&prefix=FT88-School.ttf'); }
 @font-face { font-family: Director-light; font-weight: bold; src: url('Director-Light.otf');}
    h3 {
        font-size: 15px;
        color: navy;
font-family: Director-light;
    }
</code>```

The font i am using at the moment :

```<code>@font-face {
    font-family: 'hershey-noaillnoaillesherbier';
    src: url('hershey-noailles-herbier-webfont.woff2') format('woff2'),
         url('hershey-noailles-herbier-webfont.woff') format('woff');
etcc etc

}
</code>```

Body:
I am using a custom web font from a type foundry, called herbier,  that is made up of characters.

How can i view this font on all browsers?
Chrome works fine, but Safari and iOS turn the type into numerals.
this is an example of the font working on safari from the original website
I am using amazon aws to host this site.

I have looked up many explanations.
changing the display: swap, text to italic, redownloading the text files, urls i use link to the fonts uploaded to my domain, i tried using text-rendering: optimizeLegibility and downloaded the web kit so i would have all svg, woff, woff versions of this font etc etc.

The specimen file has said ' The most common problem here is that you are serving the fonts from an IIS server. IIS refuses to serve files that have unknown MIME types. If that is the case, you must set the MIME type for SVG to "image/svg+xml" in the server settings.'

Is there any simple way to solve this?

Example code for a different font that works :

@font-face {
        font-family: Director-light;
        src: url('https://s3.console.aws.amazon.com/s3/object/www.MYWEBSITE.net?region=eu-west-1&prefix=Director-Light.otf'); src: url('https://s3.console.aws.amazon.com/s3/object/www.MYWEBSITE.net?region=eu-west-1&prefix=FT88-School.ttf'); }
 @font-face { font-family: Director-light; font-weight: bold; src: url('Director-Light.otf');}
    h3 {
        font-size: 15px;
        color: navy;
font-family: Director-light;
    }

The font i am using at the moment :

@font-face {
    font-family: 'hershey-noaillnoaillesherbier';
    src: url('hershey-noailles-herbier-webfont.woff2') format('woff2'),
         url('hershey-noailles-herbier-webfont.woff') format('woff');
etcc etc

}


问:
Google Cloud IAM - How does the authentication works between GCP resources | Step By Step Sequence Diagram
Our Services are hosted in GCP and we are using CloudRun,CloudSQL,Pubsub,Storage GCP resources.
Access to these resources are managed by defining the IAM roles to corresponding service accounts.

I would like to understand how and when IAM Policy evaluation and validation happens in the gcp resource to resource communication. for example, While cloud run connecting to pub-sub topic to publish events, How and When the the CloudRun service account bindings are validated ?

Please help to understand the step by step sequence diagram about the IAM Policy evaluation and validation in the gcp resource to resource communication.


问:
Serilog loggs only first log to cloudwatch. Need to log all logs
```<code>using Amazon.CloudWatchLogs;
using Serilog.Sinks.AwsCloudWatch;

internal class Program
{
    static async Task Main(string[] args)
    {
        Log.Logger = new LoggerConfiguration()
            .WriteTo.AmazonCloudWatch(
            logGroup: LogGroup,
            logStreamPrefix: DateTime.UtcNow.ToString("yyyyMMddHHmmssfff"),
            cloudWatchClient: client)
            .WriteTo.Console()
            .CreateLogger();
            Log.Information("Application Started");  /*only logs this one*/
            Log.Information("Application Started1");
            Log.Information("Application Started2");
            Log.Information("Application Started3");
            Log.Information("Application Started4");

        var host = Host.CreateDefaultBuilder(args)
            .ConfigureServices((_, services) =>
                .AddSingleton<Serilog.ILogger>(Log.Logger)
             ).UseSerilog()
            .Build();

        var getDDD = ActivatorUtilities.CreateInstance\<GetDDD\>(host.Services);
        await getDDD.LoadDDD();
    }
}
</code>```

I have created a logger using serilog and trying to add it to AWS cloudwatch. But only 1st log get added and rest get skipped. I want to all logs to cloudwatch

Body:
using Amazon.CloudWatchLogs;
using Serilog.Sinks.AwsCloudWatch;

internal class Program
{
    static async Task Main(string[] args)
    {
        Log.Logger = new LoggerConfiguration()
            .WriteTo.AmazonCloudWatch(
            logGroup: LogGroup,
            logStreamPrefix: DateTime.UtcNow.ToString("yyyyMMddHHmmssfff"),
            cloudWatchClient: client)
            .WriteTo.Console()
            .CreateLogger();
            Log.Information("Application Started");  /*only logs this one*/
            Log.Information("Application Started1");
            Log.Information("Application Started2");
            Log.Information("Application Started3");
            Log.Information("Application Started4");

        var host = Host.CreateDefaultBuilder(args)
            .ConfigureServices((_, services) =>
                .AddSingleton<Serilog.ILogger>(Log.Logger)
             ).UseSerilog()
            .Build();

        var getDDD = ActivatorUtilities.CreateInstance\<GetDDD\>(host.Services);
        await getDDD.LoadDDD();
    }
}

I have created a logger using serilog and trying to add it to AWS cloudwatch. But only 1st log get added and rest get skipped. I want to all logs to cloudwatch


问:
Refresh data in a ListView
I am doing a school project about a shopping centre, I have creared two ListView, in one of them we store the customers and in the other one the purchases that each of them has made, to do that I have created two classes, one for the Customers and other for the purchases, and in the class Customer there is a list with all of the purchases made. So what I am trying to do is that every time I add a purchase to the second table it automatically calcutes an average on how much money the customer spends per purchase.

This are the two classes where the Customer and Purchase are desccribed

```<code>public class Customer: INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private string name;
        private string surname;
        private DateTime born_date;
        private float spendMoneyAvg;
        private ObservableCollection<Purchase> purchaseList= new ObservableCollection<Purchase>();
        public ObservableCollection<Purchase> GetPurchasseList()
        {
            return purchaseList;
        }

        public void addPurchase(string date, float cost, int number_items)
        {
            Purchase p = new Purchase(fecha, coste,litros, km);
            purchaseList.Add(p);

        }

        public void eliminaRepos(Purchase p)
        {
            purchaseList.Remove(p);
        }

        //Here there are getter and setter for each of the properties and also the constructor
    }

------------------------------------------------------------------------------------------------
 public class Purchase: INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        //ATRIBUTOS
        private string date;
        private float cost;
        private int number_items;

        //Here there are getter and setter for each of the properties and also the constructor

    }
</code>```

This is the XAML where my ListView are declared

```<code><Window x:Class="labWork.Table"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:practica_final"
        mc:Ignorable="d"
        Title="Table" Height="450" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition/>
            <RowDefinition Height="auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Button Name="addCustomer" Content="ADD CUSTOMER" Margin="10" Grid.Row="0" Grid.Column="0" Click="AddCustomer_Click"/>
        <Button Name="deleteCustomer" Content="DELETE CUSTOMER" Margin=" 10" Grid.Row="0" Grid.Column="1" Click="DeleteCustomer_Click"/>
        <ListView Name="table1" Grid.Row="1" Margin="10" Grid.ColumnSpan="3" SelectionChanged="Table1_SelectionChanged">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Name" Width="120" DisplayMemberBinding="{Binding Name}"/>
                    <GridViewColumn Header="Surname" Width="150" DisplayMemberBinding="{Binding Surname}"/>
                    <GridViewColumn Header="Date" Width="50" DisplayMemberBinding="{Binding Born_date}"/>
                    <GridViewColumn Header="Money spend on average" Width="180" DisplayMemberBinding="{Binding SpendMoneyAvg}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <Button Name="addPurchase" Content="ADD PURCHASE" Margin="10" Grid.Row="2" Grid.Column="0" Click="AddPurchase_Click"/>
        <Button Name="deletePurchase" Content="DELETE PURCHASE" Margin=" 10" Grid.Row="2" Grid.Column="1" Click="DeletePurchase_Click"/>
        <ListView Name="tabla2" Grid.Row="3" Margin="10" Grid.ColumnSpan="3" >
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Date" Width="80" DisplayMemberBinding="{Binding Date}"/>
                    <GridViewColumn Header="Cost" Width="50" DisplayMemberBinding="{Binding Cost}"/>
                    <GridViewColumn Header="Number of Items" Width="50" DisplayMemberBinding="{Binding Number_items}"/>
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>
</Window>
</code>```

And then I have another class (Table.xaml.cs) where the methods for adding and deleting customer or purchases are declared.

So what I want is that every time I add a new Purchase on a determined Customer it appears on the Customer's ListView the money that has spend on average.

Thanks!

I want that the listView refresh the information automatically while adding data on the second listView.

Title: Refresh data in a ListView

Body:
I am doing a school project about a shopping centre, I have creared two ListView, in one of them we store the customers and in the other one the purchases that each of them has made, to do that I have created two classes, one for the Customers and other for the purchases, and in the class Customer there is a list with all of the purchases made. So what I am trying to do is that every time I add a purchase to the second table it automatically calcutes an average on how much money the customer spends per purchase.

This are the two classes where the Customer and Purchase are desccribed

public class Customer: INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private string name;
        private string surname;
        private DateTime born_date;
        private float spendMoneyAvg;
        private ObservableCollection<Purchase> purchaseList= new ObservableCollection<Purchase>();
        public ObservableCollection<Purchase> GetPurchasseList()
        {
            return purchaseList;
        }

        public void addPurchase(string date, float cost, int number_items)
        {
            Purchase p = new Purchase(fecha, coste,litros, km);
            purchaseList.Add(p);

        }

        public void eliminaRepos(Purchase p)
        {
            purchaseList.Remove(p);
        }

        //Here there are getter and setter for each of the properties and also the constructor
    }

------------------------------------------------------------------------------------------------
 public class Purchase: INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        //ATRIBUTOS
        private string date;
        private float cost;
        private int number_items;

        //Here there are getter and setter for each of the properties and also the constructor

    }

This is the XAML where my ListView are declared

<Window x:Class="labWork.Table"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:practica_final"
        mc:Ignorable="d"
        Title="Table" Height="450" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition/>
            <RowDefinition Height="auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Button Name="addCustomer" Content="ADD CUSTOMER" Margin="10" Grid.Row="0" Grid.Column="0" Click="AddCustomer_Click"/>
        <Button Name="deleteCustomer" Content="DELETE CUSTOMER" Margin=" 10" Grid.Row="0" Grid.Column="1" Click="DeleteCustomer_Click"/>
        <ListView Name="table1" Grid.Row="1" Margin="10" Grid.ColumnSpan="3" SelectionChanged="Table1_SelectionChanged">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Name" Width="120" DisplayMemberBinding="{Binding Name}"/>
                    <GridViewColumn Header="Surname" Width="150" DisplayMemberBinding="{Binding Surname}"/>
                    <GridViewColumn Header="Date" Width="50" DisplayMemberBinding="{Binding Born_date}"/>
                    <GridViewColumn Header="Money spend on average" Width="180" DisplayMemberBinding="{Binding SpendMoneyAvg}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <Button Name="addPurchase" Content="ADD PURCHASE" Margin="10" Grid.Row="2" Grid.Column="0" Click="AddPurchase_Click"/>
        <Button Name="deletePurchase" Content="DELETE PURCHASE" Margin=" 10" Grid.Row="2" Grid.Column="1" Click="DeletePurchase_Click"/>
        <ListView Name="tabla2" Grid.Row="3" Margin="10" Grid.ColumnSpan="3" >
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Date" Width="80" DisplayMemberBinding="{Binding Date}"/>
                    <GridViewColumn Header="Cost" Width="50" DisplayMemberBinding="{Binding Cost}"/>
                    <GridViewColumn Header="Number of Items" Width="50" DisplayMemberBinding="{Binding Number_items}"/>
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>
</Window>

And then I have another class (Table.xaml.cs) where the methods for adding and deleting customer or purchases are declared.

So what I want is that every time I add a new Purchase on a determined Customer it appears on the Customer's ListView the money that has spend on average.

Thanks!

I want that the listView refresh the information automatically while adding data on the second listView.


问:
Checking the price for a given pool , Can I check the price in comparison with another token from this pool?
For example, I have a code that checks the UDCD / WETH pool.

The standard price is displayed correctly, but when I change the Token1 value to something else, for example DAI / WBTC instead of USDC, the price is still displayed for the USDC/WETH value. how can I solve this?

used

uniswap/v3-sdk'  and

@uniswap/v3-core

```<code>const POOL_ADDRESS = '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640'
const TOKEN0 = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' // USDC
const TOKEN1 = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' // WETH
</code>```
```<code>

I want to check the price of a token in a pool against another token (not a default one for the pool).
</code>```

Body:
For example, I have a code that checks the UDCD / WETH pool.

The standard price is displayed correctly, but when I change the Token1 value to something else, for example DAI / WBTC instead of USDC, the price is still displayed for the USDC/WETH value. how can I solve this?

used

uniswap/v3-sdk'  and

@uniswap/v3-core

const POOL_ADDRESS = '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640'
const TOKEN0 = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' // USDC
const TOKEN1 = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' // WETH

I want to check the price of a token in a pool against another token (not a default one for the pool).


问:
Read multiple partitions from parquet using pyspark
I partitioned a parquet file based on a year-months column.
After this I want to read multiple partitions of this parquet using pyspark but I can't find an eassy and short way of doing so. I tried:
_df =  spark_sessions.read.option('compression','gzip').option("basePath", f"{_data['PQ_path']+_data['PQ_name_partitioned']}/").parquet(f"{_data['PQ_path']+_data['PQ_name_partitioned']}/ano-mes={_year}",f"{_data['PQ_path']+_data['PQ_name_partitioned']}/Anio={_year-1}",f"{_data['PQ_path']+_data['PQ_name_partitioned']}/Anio={_year-2}")
and this works, but as you can see, if I wanted to replicate this for like 15 filters, I would have yo give 15 paths and it's not an automatic change.

On pandas I would do the following:
_total_filter = [["partition-name","in","array with conditions"]] #Read parquet _df = pd.read_parquet(_path, engine='pyarrow', filters = _total_filter)

Is there something like that on pyspark?

I tried:
_df =  spark_sessions.read.option('compression','gzip').parquet(f"{_data['PQ_path']+_data['PQ_name_partitioned']}/Anio={_year}",filters=filter_array)
like in pandas, but didn't work


问:
Modal reopens when dispatching an action React Redux Toolkit
just started using React Redux Toolkit with nextjs. I am trying to find a way to submit a form by dispatching a post request action from inside a modal but every time call the dispatch action it reopens it. Is there any other way to properly dispatch the action without reopening the modal.

Help would be very appreciated :)
Thanks a lot!

Here are some parts of my code.

AddressForm.js

```<code>const handleAddAddress = (data) => {
    const addressForm = JSON.stringify({
      userName: data.userName,
      userAddress: data.userAddress,
      userAddress2: "",
      userCity: data.userCity,
      userPincode: data.userPincode,
      userState: data.userState,
      userEmail: data.userEmail,
      userMobileNumber: data.userMobileNumber,
      isDefault: true,
    });
    dispatch(saveAddress({ addressForm })).unwrap(); **//here I am dispatching the post action **
  };
</code>```

address.slice.js //this is the slice from where I am calling the api

```<code>export const saveAddress = createAsyncThunk(
  "address/saveAddress",
  async ({ addressForm }, { getState, rejectWithValue }) => {
    const state = getState();
    try {
      const res = await axios({
        method: "post",
        url: `${process.env.API_BASE_URL}/api/v1/saveaddress`,
        data: addressForm,
        headers: {
          "Content-Type": "application/json",
          Authorization: `Bearer ${state.auth.userToken}`,
        },
      });
      return res.data;
    } catch (error) {
      if (!error.response) {
        throw err;
      }
      return rejectWithValue(error.response.data);
    }
  }
);

const addressSlice = createSlice({
  name: "address",
  initialState: {
    addresses: [],
    pincodeState: {},
    httpErr: [],
  },
  reducers: {},
  extraReducers: {
    [saveAddress.pending]: (state) => {
      state.loading = true;
    },
    [saveAddress.fulfilled]: (state, action) => {
      state.loading = false;
      state.addresses = action.payload.addresses;
      localStorage.setItem("addresses", JSON.stringify(state.addresses));
    },
    [saveAddress.rejected]: (state, action) => {
      state.loading = false;
      state.httpErr = action.payload;
    },
  },
});
</code>```

Body:
just started using React Redux Toolkit with nextjs. I am trying to find a way to submit a form by dispatching a post request action from inside a modal but every time call the dispatch action it reopens it. Is there any other way to properly dispatch the action without reopening the modal.

Help would be very appreciated :)
Thanks a lot!

Here are some parts of my code.

AddressForm.js

const handleAddAddress = (data) => {
    const addressForm = JSON.stringify({
      userName: data.userName,
      userAddress: data.userAddress,
      userAddress2: "",
      userCity: data.userCity,
      userPincode: data.userPincode,
      userState: data.userState,
      userEmail: data.userEmail,
      userMobileNumber: data.userMobileNumber,
      isDefault: true,
    });
    dispatch(saveAddress({ addressForm })).unwrap(); **//here I am dispatching the post action **
  };

address.slice.js //this is the slice from where I am calling the api

export const saveAddress = createAsyncThunk(
  "address/saveAddress",
  async ({ addressForm }, { getState, rejectWithValue }) => {
    const state = getState();
    try {
      const res = await axios({
        method: "post",
        url: `${process.env.API_BASE_URL}/api/v1/saveaddress`,
        data: addressForm,
        headers: {
          "Content-Type": "application/json",
          Authorization: `Bearer ${state.auth.userToken}`,
        },
      });
      return res.data;
    } catch (error) {
      if (!error.response) {
        throw err;
      }
      return rejectWithValue(error.response.data);
    }
  }
);

const addressSlice = createSlice({
  name: "address",
  initialState: {
    addresses: [],
    pincodeState: {},
    httpErr: [],
  },
  reducers: {},
  extraReducers: {
    [saveAddress.pending]: (state) => {
      state.loading = true;
    },
    [saveAddress.fulfilled]: (state, action) => {
      state.loading = false;
      state.addresses = action.payload.addresses;
      localStorage.setItem("addresses", JSON.stringify(state.addresses));
    },
    [saveAddress.rejected]: (state, action) => {
      state.loading = false;
      state.httpErr = action.payload;
    },
  },
});


问:
how can i save my json data into a firebase current UID in angular?
I am trying to make every user has his own data , but I have my users saved on firebase and my data saved on JSON server, is there a way to connect them? to make every time a user register and login have his own data separated from the other users.
I hope you got what I am trying to do :)

here is my service for storing the data on json server
.service.ts:

```<code>import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class ApiService {

  constructor(private http : HttpClient,) { }
// order Table
 postOrder(data : any){
  return this.http.post<any>("http://localhost:3000/OrderList/",data);
 }
 getOrder(){
  return this.http.get<any>("http://localhost:3000/OrderList/");
 }
// order detials

 postOrderDetials(data : any){
  return this.http.post<any>("http://localhost:3000/OrderDetials/",data);
 }
 getOrderDetials(){
  return this.http.get<any>("http://localhost:3000/OrderDetials/");
 }
// item table

 postItemTable(data : any){
  return this.http.post<any>("http://localhost:3000/itemTable/",data);
 }

 getItemTable(){
  return this.http.get<any>("http://localhost:3000/itemTable/");
 }
// delete a row in the order table
 DeleteOrder(id : number){
  return this.http.delete<any>("http://localhost:3000/OrderList/"+id)
 }
// to edit the item table
 PutItem(data : any , id : number){
  return this.http.put<any>("http://localhost:3000/itemTable/"+id,data);
 }
//  to add to the operation table
postOperation(data : any){
  return this.http.post<any>("http://localhost:3000/OperationTable/",data);
}
getOperation(){
  return this.http.get<any>("http://localhost:3000/OperationTable/");
}
}
</code>```

and here is my service.ts for saving the user into firebase :

```<code>interface authResponeData {
  kind: string;
  idToken: string;
  email : string;
  refreshToken : string;
  expiresIn: string;
  localId:string;
}

@Injectable({
  providedIn: 'root'
})
export class AuthService {
  userData: any;

  constructor(
    private fireAuth : AngularFireAuth, private router : Router,
    public angularFireAuth: AngularFireAuth,
    private api : ApiService) {}

    login(email : string , password : string) {
      this.fireAuth.signInWithEmailAndPassword(email,password).then( ()=> {
        localStorage.setItem('AIzaSyC6Y3IuqNUMfEe-xQFpmviAD2dWeBCuztI' , 'true');
        this.router.navigate(['Order-table']);
        this.angularFireAuth.currentUser.then( data  => {
          console.log(data?.uid);
      })
      },err => {
        alert(err.message);
        this.router.navigate(['/login']);
      })
    }

  register(email : string , password : string){
    this.fireAuth.createUserWithEmailAndPassword(email , password).then( () => {
      alert("registration successful")
      this.router.navigate(['/login']);
    }, err => {
      alert(err.message);
      this.router.navigate(['/register']);
    })
  }

  SignOff() {
    this.fireAuth.signOut().then( () => {
      localStorage.removeItem('AIzaSyC6Y3IuqNUMfEe-xQFpmviAD2dWeBCuztI');
      this.router.navigate(['/login']);
    }, err => {
      alert(err.message);
    })
  }
</code>```

hopefully, I put all the information needed, if any information needed just let me know

Body:
I am trying to make every user has his own data , but I have my users saved on firebase and my data saved on JSON server, is there a way to connect them? to make every time a user register and login have his own data separated from the other users.
I hope you got what I am trying to do :)

here is my service for storing the data on json server
.service.ts:

import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class ApiService {

  constructor(private http : HttpClient,) { }
// order Table
 postOrder(data : any){
  return this.http.post<any>("http://localhost:3000/OrderList/",data);
 }
 getOrder(){
  return this.http.get<any>("http://localhost:3000/OrderList/");
 }
// order detials

 postOrderDetials(data : any){
  return this.http.post<any>("http://localhost:3000/OrderDetials/",data);
 }
 getOrderDetials(){
  return this.http.get<any>("http://localhost:3000/OrderDetials/");
 }
// item table

 postItemTable(data : any){
  return this.http.post<any>("http://localhost:3000/itemTable/",data);
 }

 getItemTable(){
  return this.http.get<any>("http://localhost:3000/itemTable/");
 }
// delete a row in the order table
 DeleteOrder(id : number){
  return this.http.delete<any>("http://localhost:3000/OrderList/"+id)
 }
// to edit the item table
 PutItem(data : any , id : number){
  return this.http.put<any>("http://localhost:3000/itemTable/"+id,data);
 }
//  to add to the operation table
postOperation(data : any){
  return this.http.post<any>("http://localhost:3000/OperationTable/",data);
}
getOperation(){
  return this.http.get<any>("http://localhost:3000/OperationTable/");
}
}

and here is my service.ts for saving the user into firebase :

interface authResponeData {
  kind: string;
  idToken: string;
  email : string;
  refreshToken : string;
  expiresIn: string;
  localId:string;
}

@Injectable({
  providedIn: 'root'
})
export class AuthService {
  userData: any;

  constructor(
    private fireAuth : AngularFireAuth, private router : Router,
    public angularFireAuth: AngularFireAuth,
    private api : ApiService) {}

    login(email : string , password : string) {
      this.fireAuth.signInWithEmailAndPassword(email,password).then( ()=> {
        localStorage.setItem('AIzaSyC6Y3IuqNUMfEe-xQFpmviAD2dWeBCuztI' , 'true');
        this.router.navigate(['Order-table']);
        this.angularFireAuth.currentUser.then( data  => {
          console.log(data?.uid);
      })
      },err => {
        alert(err.message);
        this.router.navigate(['/login']);
      })
    }

  register(email : string , password : string){
    this.fireAuth.createUserWithEmailAndPassword(email , password).then( () => {
      alert("registration successful")
      this.router.navigate(['/login']);
    }, err => {
      alert(err.message);
      this.router.navigate(['/register']);
    })
  }

  SignOff() {
    this.fireAuth.signOut().then( () => {
      localStorage.removeItem('AIzaSyC6Y3IuqNUMfEe-xQFpmviAD2dWeBCuztI');
      this.router.navigate(['/login']);
    }, err => {
      alert(err.message);
    })
  }

hopefully, I put all the information needed, if any information needed just let me know


问:
AWS IPsec Site-to-Site VPN Certificate Authentication - Certificate Request signatures don't match
I am having issues with certificate authentication using AWS Site-to-Site VPN. I created a new VPN connection in AWS using the same configuration that worked for shared secret. However, when I inspect the traffic, the Certificate Request in the IKE_SA_INIT response has two Certificate Authorities that I do not recognize (and only two). These are not the SHA1 hashes of any of the configured certificates or CAs in their chain. I deleted the connection, customer gateway, and certificates and started from scratch. The new IKA_SA_INIT Certificate Request has the same exact CA hashes...

Can anyone help me understand what is happening here? It is my understanding the two Certificate Authorities in the Certificate Request should be my AWS Private Certificate Authority Root CA and the Subordinate CA. There is so little documentation out there for implementing certificate authentication with AWS Site-to-Site VPN. (probably because it is so expensive) I've resorted to reading RFC documents to understand the nuts and bolts which is how I discovered the above issue.

AWS Private Certificate Authority Root CA: 6b cd 12 84 77 b1 38 45 02 48 04 6d a7 89 3c a2 82 52 39 e7
AWS Private Certificate Authority Subordinate CA: 40 2c 4b 0e 66 06 98 28 e0 3b a4 61 8b 12 fd ba a2 44 41 73

ISAKMP IKE_SA_INIT Response from AWS - limited to Certificate Request

```<code>Payload: Certificate Request (38)
    Next payload: Notify (41)
    0... .... = Critical Bit: Not critical
    .000 0000 = Reserved: 0x00
    Payload length: 45
    Certificate Type: X.509 Certificate - Signature (4)
    Certificate Authority Data: e75394041957b0ec0433caaee301ad3ad0361355
    Certificate Authority Data: 0252df87079a8a5cd49c05afd1845482d1ba1448
</code>```

Body:
I am having issues with certificate authentication using AWS Site-to-Site VPN. I created a new VPN connection in AWS using the same configuration that worked for shared secret. However, when I inspect the traffic, the Certificate Request in the IKE_SA_INIT response has two Certificate Authorities that I do not recognize (and only two). These are not the SHA1 hashes of any of the configured certificates or CAs in their chain. I deleted the connection, customer gateway, and certificates and started from scratch. The new IKA_SA_INIT Certificate Request has the same exact CA hashes...

Can anyone help me understand what is happening here? It is my understanding the two Certificate Authorities in the Certificate Request should be my AWS Private Certificate Authority Root CA and the Subordinate CA. There is so little documentation out there for implementing certificate authentication with AWS Site-to-Site VPN. (probably because it is so expensive) I've resorted to reading RFC documents to understand the nuts and bolts which is how I discovered the above issue.

AWS Private Certificate Authority Root CA: 6b cd 12 84 77 b1 38 45 02 48 04 6d a7 89 3c a2 82 52 39 e7
AWS Private Certificate Authority Subordinate CA: 40 2c 4b 0e 66 06 98 28 e0 3b a4 61 8b 12 fd ba a2 44 41 73

ISAKMP IKE_SA_INIT Response from AWS - limited to Certificate Request

Payload: Certificate Request (38)
    Next payload: Notify (41)
    0... .... = Critical Bit: Not critical
    .000 0000 = Reserved: 0x00
    Payload length: 45
    Certificate Type: X.509 Certificate - Signature (4)
    Certificate Authority Data: e75394041957b0ec0433caaee301ad3ad0361355
    Certificate Authority Data: 0252df87079a8a5cd49c05afd1845482d1ba1448


问:
Gitlab in docker on windows
I want to run Gitlab using docker on windows 10, but cannot access the service.

I am using docker composer with the configuration file

```<code>version: '3.6'
services:
  web:
    image: 'gitlab/gitlab-ce'
    restart: always
    hostname: 'mygitlab.local'
    container_name: gitlab-ce
    environment:
      GITLAB_OMNIBUS_CONFIG: |
          external_url 'https://mygitlab.local'
    ports:
      - '80:80'
      - '443:443'
      - '22:22'
    volumes:
      - F:/gitlab/docker_data/config:/etc/gitlab
      - F:/gitlab/docker_data/logs:/var/log/gitlab
      - F:/gitlab/docker_data/data:/var/opt/gitlab
    shm_size: '256m'
    networks:
      - gitlab

  gitlab-runner:
    image: gitlab/gitlab-runner:alpine
    container_name: gitlab-runner
    restart: always
    depends_on:
      - web
    volumes:
      - 'F:/gitlab/docker_data/docker.sock:/var/run/docker.sock'
      - 'F:/gitlab/docker_data/gitlab-runner:/etc/gitlab-runner'
    networks:
      - gitlab

networks:
  gitlab:
    name: gitlab-network
</code>```

Gitlab is started running docker compose up -d. Looking at docker desktop the container are running. But I cannot access the server using firefox.

The file C:\WINDOWS\System32\drivers\etc\hosts also contains 127.0.0.1  mygitlab.local .

Title: Gitlab in docker on windows

Body:
I want to run Gitlab using docker on windows 10, but cannot access the service.

I am using docker composer with the configuration file

version: '3.6'
services:
  web:
    image: 'gitlab/gitlab-ce'
    restart: always
    hostname: 'mygitlab.local'
    container_name: gitlab-ce
    environment:
      GITLAB_OMNIBUS_CONFIG: |
          external_url 'https://mygitlab.local'
    ports:
      - '80:80'
      - '443:443'
      - '22:22'
    volumes:
      - F:/gitlab/docker_data/config:/etc/gitlab
      - F:/gitlab/docker_data/logs:/var/log/gitlab
      - F:/gitlab/docker_data/data:/var/opt/gitlab
    shm_size: '256m'
    networks:
      - gitlab

  gitlab-runner:
    image: gitlab/gitlab-runner:alpine
    container_name: gitlab-runner
    restart: always
    depends_on:
      - web
    volumes:
      - 'F:/gitlab/docker_data/docker.sock:/var/run/docker.sock'
      - 'F:/gitlab/docker_data/gitlab-runner:/etc/gitlab-runner'
    networks:
      - gitlab

networks:
  gitlab:
    name: gitlab-network

Gitlab is started running docker compose up -d. Looking at docker desktop the container are running. But I cannot access the server using firefox.

The file C:\WINDOWS\System32\drivers\etc\hosts also contains 127.0.0.1  mygitlab.local .


问:
How to set up a multi-file Node.js/Mocha/Selenium model?
We want to run tests locally using Mocha and Selenium (JavaScript) under node.js.
We want to define classes and functions that are shared amongst all test modules (and therefore can be imported).
All of the examples I've found online show everything in one file, but that is impractical.

Here is a simple example of what we need to do:

```<code>// file: testreport.js:
export function Report(message) {
    console.log(message)
}

</code>```
```<code>// file: test.js:
import { Report } from 'testreport.js'

const { Builder } = require("selenium-webdriver")

var driver

describe('External Files', function () {

    beforeEach(async function () {
        driver = await new Builder().forBrowser("chrome").build()
    })

    afterEach(async function () {
        await driver.quit()
    })

    it('log success', function () {
        Report('If you can read this, the import worked')
        // of course once we get this far we'll do things with Selenium too
    })

})

</code>```

command line: mocha test.js

The above doesn't work because my package.js doesn't specify type, so it defaults to commonjs, and the declaration form of import cannot be used there.

If I add "type": "module" to package.json or change the extension to .mjs, the above doesn't work because require() is not supported in ES modules.

If I then change require() to import(), I get an error that Builder is not defined.
Similarly, if I change the import line to import('testreport.js'), I get an error that Report is not defined.

I've tried various combinations of moving the require() to an external file and include()ing it, but I get essentially the same errors as above.
Either I can't use the import declaration, or I can't use require(), or I can't access functions/classes from import()ed files.

Can somebody help me get off this merry-go-round?

Body:
We want to run tests locally using Mocha and Selenium (JavaScript) under node.js.
We want to define classes and functions that are shared amongst all test modules (and therefore can be imported).
All of the examples I've found online show everything in one file, but that is impractical.

Here is a simple example of what we need to do:

// file: testreport.js:
export function Report(message) {
    console.log(message)
}

// file: test.js:
import { Report } from 'testreport.js'

const { Builder } = require("selenium-webdriver")

var driver

describe('External Files', function () {

    beforeEach(async function () {
        driver = await new Builder().forBrowser("chrome").build()
    })

    afterEach(async function () {
        await driver.quit()
    })

    it('log success', function () {
        Report('If you can read this, the import worked')
        // of course once we get this far we'll do things with Selenium too
    })

})

command line: mocha test.js

The above doesn't work because my package.js doesn't specify type, so it defaults to commonjs, and the declaration form of import cannot be used there.

If I add "type": "module" to package.json or change the extension to .mjs, the above doesn't work because require() is not supported in ES modules.

If I then change require() to import(), I get an error that Builder is not defined.
Similarly, if I change the import line to import('testreport.js'), I get an error that Report is not defined.

I've tried various combinations of moving the require() to an external file and include()ing it, but I get essentially the same errors as above.
Either I can't use the import declaration, or I can't use require(), or I can't access functions/classes from import()ed files.

Can somebody help me get off this merry-go-round?


问:
Preventing repeated values in magic squares
So I wanted to create a 3x3 magic square generator with certain parameters the problem can be solved using recursion as demonstrated by the following code:

```<code>#include <stdio.h>

void magic_square(int *grid, int next_slot, int max_value)
{
    // Maybe recurse
    if (next_slot < 9)
    {
        for (int i = 1; i < max_value; i++)
        {
            grid[next_slot] = i;
            magic_square(grid, next_slot + 1, max_value);
        }
        // Test magic square.
    }
    else
    {
        const int sum = grid[0] + grid[1] + grid[2];
        // Horizontal lines
        if (grid[3] + grid[4] + grid[5] != sum) return;
        if (grid[6] + grid[7] + grid[8] != sum) return;
        // Vertical lines
        if (grid[0] + grid[3] + grid[6] != sum) return;
        if (grid[1] + grid[4] + grid[7] != sum) return;
        if (grid[2] + grid[5] + grid[8] != sum) return;
        // Diagonal lines
        if (grid[0] + grid[4] + grid[8] != sum) return;
        if (grid[2] + grid[4] + grid[6] != sum) return;
        // Guess it works
        printf("%3d %3d %3d\n%3d %3d %3d\n%3d %3d %3d\n\n",
        grid[0], grid[1], grid[2],
        grid[3], grid[4], grid[5],
        grid[6], grid[7], grid[8]);
    }
}

int main(void)
{
    int grid[9];
    int max_value = 9;
    magic_square(grid, 0, max_value);
}
</code>```

The problem with the code is that the squares it generates contains repeated numbers and I only want magic squares with non-repeated numbers. What I tried to do is introduce a flag at the end and print the grid only if it does not have repeated values but for some reason it did not work.

How do I solve the problem? (Please excuse my rudimentary knowledge of C)
Let us assume the max value is always $9$ as otherwise it can cause problems as mentioned in the comments.

Body:
So I wanted to create a 3x3 magic square generator with certain parameters the problem can be solved using recursion as demonstrated by the following code:

#include <stdio.h>

void magic_square(int *grid, int next_slot, int max_value)
{
    // Maybe recurse
    if (next_slot < 9)
    {
        for (int i = 1; i < max_value; i++)
        {
            grid[next_slot] = i;
            magic_square(grid, next_slot + 1, max_value);
        }
        // Test magic square.
    }
    else
    {
        const int sum = grid[0] + grid[1] + grid[2];
        // Horizontal lines
        if (grid[3] + grid[4] + grid[5] != sum) return;
        if (grid[6] + grid[7] + grid[8] != sum) return;
        // Vertical lines
        if (grid[0] + grid[3] + grid[6] != sum) return;
        if (grid[1] + grid[4] + grid[7] != sum) return;
        if (grid[2] + grid[5] + grid[8] != sum) return;
        // Diagonal lines
        if (grid[0] + grid[4] + grid[8] != sum) return;
        if (grid[2] + grid[4] + grid[6] != sum) return;
        // Guess it works
        printf("%3d %3d %3d\n%3d %3d %3d\n%3d %3d %3d\n\n",
        grid[0], grid[1], grid[2],
        grid[3], grid[4], grid[5],
        grid[6], grid[7], grid[8]);
    }
}

int main(void)
{
    int grid[9];
    int max_value = 9;
    magic_square(grid, 0, max_value);
}

The problem with the code is that the squares it generates contains repeated numbers and I only want magic squares with non-repeated numbers. What I tried to do is introduce a flag at the end and print the grid only if it does not have repeated values but for some reason it did not work.

How do I solve the problem? (Please excuse my rudimentary knowledge of C)
Let us assume the max value is always $9$ as otherwise it can cause problems as mentioned in the comments.


问:
How to trace the code of kubernetes scheduler?
I want to developed a custom kubernetes scheduler plugin. To have an initial idea for implemention, I checked another plugin like node affinity from here,
but checking code alone is not enough.
My main question is that, is there any approach for tracing the code to better undrestand the input and output of each method or function?
One idea came to my mind is forcing the source code to print the output like:

```<code>fmt.print(s.requiredNodeSelectorAndAffinity.Match(node))
</code>```

But after recompiling scheduler, I am not sure if the output will be printed.

Body:
I want to developed a custom kubernetes scheduler plugin. To have an initial idea for implemention, I checked another plugin like node affinity from here,
but checking code alone is not enough.
My main question is that, is there any approach for tracing the code to better undrestand the input and output of each method or function?
One idea came to my mind is forcing the source code to print the output like:

fmt.print(s.requiredNodeSelectorAndAffinity.Match(node))

But after recompiling scheduler, I am not sure if the output will be printed.


问:
There is remaining space in container from wrapped multi line text
There is chat app I am creating and there is the first message is 1 line and working great but the last message is multi line and there is space

```<code>Column(
  crossAxisAlignment: crossAxisAlignment,
  children: [
    Container(
        margin: EdgeInsets.only(right:39),
        padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 9),
        decoration: BoxDecoration(
            borderRadius: const BorderRadius.all(Radius.circular(19)),
            ),
        child: Wrap(
          alignment: WrapAlignment.end,
          crossAxisAlignment: WrapCrossAlignment.end,
          children: [
            Text(
              widget.msg['content'].trim(),
              maxLines: 39,
              style: TextStyle(color: Colors.white.withOpacity(0.79), fontSize: 17),
            ),
            Padding(
              padding: const EdgeInsets.symmetric(horizontal: 7),
              child: Text(
                DateFormat('HH:mm').format(widget.sendTime),
                style: TextStyle(color: Colors.white.withOpacity(0.4), fontSize: 12),
              ),
            ),

          ],
        )),
  ],
)
</code>```

Expected result

My result

Body:
There is chat app I am creating and there is the first message is 1 line and working great but the last message is multi line and there is space

Column(
  crossAxisAlignment: crossAxisAlignment,
  children: [
    Container(
        margin: EdgeInsets.only(right:39),
        padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 9),
        decoration: BoxDecoration(
            borderRadius: const BorderRadius.all(Radius.circular(19)),
            ),
        child: Wrap(
          alignment: WrapAlignment.end,
          crossAxisAlignment: WrapCrossAlignment.end,
          children: [
            Text(
              widget.msg['content'].trim(),
              maxLines: 39,
              style: TextStyle(color: Colors.white.withOpacity(0.79), fontSize: 17),
            ),
            Padding(
              padding: const EdgeInsets.symmetric(horizontal: 7),
              child: Text(
                DateFormat('HH:mm').format(widget.sendTime),
                style: TextStyle(color: Colors.white.withOpacity(0.4), fontSize: 12),
              ),
            ),

          ],
        )),
  ],
)

Expected result

My result


问:
Microsoft HTML Help and Internet Explorer retirement
Does anyone know how Microsoft HTML Help is affected by the ongoing retirement of Internet Explorer?

To browse .chm files, hh.exe is used, which internally uses hhctrl.ocx, which in turn uses old MSHTML (Trident) Internet Explorer rendering engine.


问:
I want x and y mouse position my gui is tkinter i have tried to use lisner (tread ?)
I use visual studio code and the code is python.

I want to read the mouse's pointers position on the screen and the position of the mouse must be able to be read on the entire screen.

I need two variables, mouse x and y position. They should be used
to write to 2 entries in tkinter. I hope you can come with a
good bid for how to do it. The most of the code I have found a
elsewhere on your side.

```<code># this code tkinter work

import tkinter as tk
from pynput import mouse

def onMouseClick(*args):
    print(args)

def on_start(): # can not see x and y from mouse
    global listener

    if not listener:
        print("Start listener...")
        listener = mouse.Listener(on_click=onMouseClick)
        print("hgj fhgggg") # min
        entry.delete(0,40) # min its work well

        listener.start()  # start thread

    else:
        print("listener already running")

def on_stop():
    global listener

    if listener:
        print("Stop listener...")
        listener.stop()  # stop thread
        listener.join()  # wait till thread really ends its job
        listener = None  # to inform that listener doesn't exist
    else:
        print("listener not running")

if __name__ == "__main__":
    print("Starting...")
    listener = None  # to keep listener
    root = tk.Tk()
    btn = tk.Button(root, command=on_start, text="Star Mouse Listener")
    btn.pack()

    btn = tk.Button(root, command=on_stop, text="Stop Mouse Listener")
    btn.pack()
    bum=tk.StringVar()

    entry = tk.Entry(root, textvariable=bum)
    entry.pack()
    entry.insert(0,"Indstil slider")
    root.mainloop()

    # stop listener if it was created
    if listener:  # if listener is not None:
        print("Stop listener...")
        listener.stop()  # stop thread
        listener.join()  # wait till thread really ends its job

# In this code tkinter dont work

"""def on_click(x, y, button, pressed):
        print(x)
        print(y)
        global entry1
        # global are
        print(testy_entry)
        entry1.delete(0,40) # dur ikke
        testy_entry.destroy()
        testy_entry.insert(0,"end")
        testy_var.set("jfffrrrrhhhhd")
        print(testy_entry)
        testx=str(y)
        testy_entry.delete(0,100)    dont work

        #entry4.delete(0,40)           dont work
        #entry4.insert(0, testx)

        # name=name_var.get() name_var.set("test")

        # set(testx)
        # testy=testy_var.get()
        testy_var.set(testx)

        #entry4.insert(0,"end")

        #entry4.insert(0, testx)

        if not pressed:
            # Stop listener
            return False
        print("test")
        return listener.stop()

        # Collect events until released
    with mouse.Listener(

            on_click=on_click
    ) as listener:
        listener.join()

    # ...or, in a non-blocking fashion:
    # global listener
    listener = mouse.Listener(

        on_click=on_click
    )
    # global listener
    listener.start()

        """
</code>```

My project is to make a game alarm. I almost all MULTI PLAYER ONLINE GAMES
change the game showing places color when the game starts it's these color change on the screen Game alarm should keep an eye on.
Such a .but till vide I have not found anyone who has made anything there
Looks like this. I intend to the alarm that is given by my computer speaker starting to play a loud sound or a piece of music. When I program have I have always a clear idea of what it should be used for.

Body:
I use visual studio code and the code is python.

I want to read the mouse's pointers position on the screen and the position of the mouse must be able to be read on the entire screen.

I need two variables, mouse x and y position. They should be used
to write to 2 entries in tkinter. I hope you can come with a
good bid for how to do it. The most of the code I have found a
elsewhere on your side.

# this code tkinter work

import tkinter as tk
from pynput import mouse

def onMouseClick(*args):
    print(args)

def on_start(): # can not see x and y from mouse
    global listener

    if not listener:
        print("Start listener...")
        listener = mouse.Listener(on_click=onMouseClick)
        print("hgj fhgggg") # min
        entry.delete(0,40) # min its work well

        listener.start()  # start thread

    else:
        print("listener already running")

def on_stop():
    global listener

    if listener:
        print("Stop listener...")
        listener.stop()  # stop thread
        listener.join()  # wait till thread really ends its job
        listener = None  # to inform that listener doesn't exist
    else:
        print("listener not running")

if __name__ == "__main__":
    print("Starting...")
    listener = None  # to keep listener
    root = tk.Tk()
    btn = tk.Button(root, command=on_start, text="Star Mouse Listener")
    btn.pack()

    btn = tk.Button(root, command=on_stop, text="Stop Mouse Listener")
    btn.pack()
    bum=tk.StringVar()

    entry = tk.Entry(root, textvariable=bum)
    entry.pack()
    entry.insert(0,"Indstil slider")
    root.mainloop()

    # stop listener if it was created
    if listener:  # if listener is not None:
        print("Stop listener...")
        listener.stop()  # stop thread
        listener.join()  # wait till thread really ends its job

# In this code tkinter dont work

"""def on_click(x, y, button, pressed):
        print(x)
        print(y)
        global entry1
        # global are
        print(testy_entry)
        entry1.delete(0,40) # dur ikke
        testy_entry.destroy()
        testy_entry.insert(0,"end")
        testy_var.set("jfffrrrrhhhhd")
        print(testy_entry)
        testx=str(y)
        testy_entry.delete(0,100)    dont work

        #entry4.delete(0,40)           dont work
        #entry4.insert(0, testx)

        # name=name_var.get() name_var.set("test")

        # set(testx)
        # testy=testy_var.get()
        testy_var.set(testx)

        #entry4.insert(0,"end")

        #entry4.insert(0, testx)

        if not pressed:
            # Stop listener
            return False
        print("test")
        return listener.stop()

        # Collect events until released
    with mouse.Listener(

            on_click=on_click
    ) as listener:
        listener.join()

    # ...or, in a non-blocking fashion:
    # global listener
    listener = mouse.Listener(

        on_click=on_click
    )
    # global listener
    listener.start()

        """

My project is to make a game alarm. I almost all MULTI PLAYER ONLINE GAMES
change the game showing places color when the game starts it's these color change on the screen Game alarm should keep an eye on.
Such a .but till vide I have not found anyone who has made anything there
Looks like this. I intend to the alarm that is given by my computer speaker starting to play a loud sound or a piece of music. When I program have I have always a clear idea of what it should be used for.


问:
Conflict in PATH variable between R and Python
I have the following in my .bash_profile.

```<code># Setting PATH for R 4.2.1
PATH="/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/bin:${PATH}"
export PATH
# Setting PATH for Python 3.8
PATH="/Users/RhaenyraTargaryen/opt/miniconda3/bin:${PATH}"
export PATH
</code>```

This allows me to load the correct version of python in the miniconda3/bin folder, which is necessary. However, now instead of R loading from the Resources/bin folder, it's also being loaded from miniconda3/bin and causing errors, since this version doesn't have all the libraries installed. How do I make it so the python is loaded from one path and R from the other, without confusion between the paths in my .bash_profile? I haven't been able to find any blogs or tutorials that address this issue, so any advice here is greatly appreciated :)

Body:
I have the following in my .bash_profile.

# Setting PATH for R 4.2.1
PATH="/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/bin:${PATH}"
export PATH
# Setting PATH for Python 3.8
PATH="/Users/RhaenyraTargaryen/opt/miniconda3/bin:${PATH}"
export PATH

This allows me to load the correct version of python in the miniconda3/bin folder, which is necessary. However, now instead of R loading from the Resources/bin folder, it's also being loaded from miniconda3/bin and causing errors, since this version doesn't have all the libraries installed. How do I make it so the python is loaded from one path and R from the other, without confusion between the paths in my .bash_profile? I haven't been able to find any blogs or tutorials that address this issue, so any advice here is greatly appreciated :)


问:
Scrapy with Playwright using a Proxy does not work in Docker container
So basically, I'm using Scrapy with Playwright so that I can access some Javascript sites (in a Docker container). It works perfectly on my local machine, but when I push it up to run in AWS, some sites are blocked because the IP address is not a residential IP address. To get around this, I set up a Squid Proxy on an old windows computer that I had lying around. I opened up the port and I'm able to connect without an issue.

The problem is the following: When I run my Scrapy project inside of a Docker container, it cannot connect to my Squid Proxy from Playwright. If I run it outside of Docker container though (as a standalone scrapyd server), it connects without a problem and the scrape is able to complete.

Does anyone know how I can get this working inside of my Docker container?

Here is how I have the proxy set up:

```<code>custom_settings = {
    "PLAYWRIGHT_LAUNCH_OPTIONS": {
        "proxy": {
            "server": "http://<my-ipv6-address>:<my-open-port>",
            "username": <username>,
            "password": <password>,
        },
    }
}
</code>```

Body:
So basically, I'm using Scrapy with Playwright so that I can access some Javascript sites (in a Docker container). It works perfectly on my local machine, but when I push it up to run in AWS, some sites are blocked because the IP address is not a residential IP address. To get around this, I set up a Squid Proxy on an old windows computer that I had lying around. I opened up the port and I'm able to connect without an issue.

The problem is the following: When I run my Scrapy project inside of a Docker container, it cannot connect to my Squid Proxy from Playwright. If I run it outside of Docker container though (as a standalone scrapyd server), it connects without a problem and the scrape is able to complete.

Does anyone know how I can get this working inside of my Docker container?

Here is how I have the proxy set up:

custom_settings = {
    "PLAYWRIGHT_LAUNCH_OPTIONS": {
        "proxy": {
            "server": "http://<my-ipv6-address>:<my-open-port>",
            "username": <username>,
            "password": <password>,
        },
    }
}


问:
Fixing the display properties
I am building a new, mobile-friendly site, but need to keep my very old site up until that’s completed. I want my current site to display all of the content on top of the background and not lined up along the left side. Most importantly, this is how I want it to display on mobile devices, as well. Maybe if I knew what caused it to change behaviors, I'd know how to fix it. Thank you for your help. http://www.twinbeaksaviary.com/herbsalad.html.[mobile display](https://i.stack.imgur.com/cx20T.jpg)

Don't know what to try or where to start.

Title: Fixing the display properties


问:
scala migration backward compatibility issue
I am facing serialisation issue when trying to read the binary object file which is stored using scala 2.11.11 with scala 2.12.17.
We're migrating our MLpipeline from Spark 2.4(scala 2.11.11) &to Spark 3.3.0(scala 2.12.17) we were not able to read the existing objects with spark 3. This is also because scala won’t support BC with major release upgrade. Seems this is not a Spark issue, As I was able to load the PipelineModel. The issue that I am facing now is we're storing a case class as binary object which is having Map datatype in scala 2.11.11 and trying to read that object file back with scala 2.12.17. While doing that I am getting the below exception,

```<code>java.io.InvalidClassException: scala.collection.immutable.Map$Map4; local class incompatible: stream classdesc serialVersionUID = -7746713615561179240, local class serialVersionUID = -7992135791595275193
</code>```

Sample case class(just adding one column here): case class LearningModelOutput( transformerState: Map[String, Any])

The object that we're storing is like

```<code>_1 =transformerState
_2= {Map$Map4}
    0 = {Tuple2@8285} (targetColumn,)
    1 = {Tuple2@8286} (consideredColumns, [Ljava.lang.String;@35b49c11)
    2 = {Tuple2@8287}(schema,StructType(StructField(col1,IntegerType,true),StructField(col2,LongType,true))
    3 = {Tuple2@8288} (transformerStages,Map())
</code>```

When trying to read this objectfile using spark.sparkcontext.objectfileMap[String, Any] getting the above mentioned serialization error.

Body:
I am facing serialisation issue when trying to read the binary object file which is stored using scala 2.11.11 with scala 2.12.17.
We're migrating our MLpipeline from Spark 2.4(scala 2.11.11) &to Spark 3.3.0(scala 2.12.17) we were not able to read the existing objects with spark 3. This is also because scala won’t support BC with major release upgrade. Seems this is not a Spark issue, As I was able to load the PipelineModel. The issue that I am facing now is we're storing a case class as binary object which is having Map datatype in scala 2.11.11 and trying to read that object file back with scala 2.12.17. While doing that I am getting the below exception,

java.io.InvalidClassException: scala.collection.immutable.Map$Map4; local class incompatible: stream classdesc serialVersionUID = -7746713615561179240, local class serialVersionUID = -7992135791595275193

Sample case class(just adding one column here): case class LearningModelOutput( transformerState: Map[String, Any])

The object that we're storing is like

_1 =transformerState
_2= {Map$Map4}
    0 = {Tuple2@8285} (targetColumn,)
    1 = {Tuple2@8286} (consideredColumns, [Ljava.lang.String;@35b49c11)
    2 = {Tuple2@8287}(schema,StructType(StructField(col1,IntegerType,true),StructField(col2,LongType,true))
    3 = {Tuple2@8288} (transformerStages,Map())

When trying to read this objectfile using spark.sparkcontext.objectfileMap[String, Any] getting the above mentioned serialization error.


问:
How to get the value of the user's balance from a text file then use it to substract or add an amount then replace it with the current amount?
I'm creating a simple pseudo banking app system using methods where the user, if it doesn't have any existing account, will create a new one, putting the user's account name, pin number, and deposit amount which after that, the code will generate user's account number and also will be the name of the text file being created and will be placed inside the directory I have chosen.
The example of the text inside the file I've created:

After the user logged in the system, the user can choose to withdraw and deposit. The problem is, I don't have an idea on how to get the balance inside the text file and add or subtract the amount of it and replace its previous with the current amount. This is the sample of my code.

```<code>String typeSelection = null;
while(typeSelection != "F" || typeSelection != "f") {

        System.out.println("Type Selection:\n");
        System.out.println("A. Withdraw");
        System.out.println("B. Deposit");

switch(typeSelection) {
        case "a", "A":
            getWithdraw(accountNumber, accountBalance);
            break;
        case "b", "B":
            getDeposit(accountNumber, accountBalance);
            break;
            }

public static void getWithdraw(int accountNumber, int accountBalance) {
    /* code to go to the directory and get the user's balance and substract the amount of how
much the user withdraw then replace the old amount with the current value */

}

public static void getDeposit(int accountNumber, int depositAmount) {
    //same with withdraw method except it will add user's balance
}
</code>```

The reason why I'm including accountNumber inside the method's parameter because I'm using it to locate the directory and my text file.

```<code>FileInputStream fis = new FileInputStream(directory + accountNumber + ".txt");
</code>```

I'm also using try-catch statement and when I created the file as well. I just only have started and learning this project few days ago, hitting few dead ends here and there but this time I'm kinda stuck for several hours, so I decided to ask for help here. I hope you understand what I mean since English is not my native language :p and thank you.

Body:
I'm creating a simple pseudo banking app system using methods where the user, if it doesn't have any existing account, will create a new one, putting the user's account name, pin number, and deposit amount which after that, the code will generate user's account number and also will be the name of the text file being created and will be placed inside the directory I have chosen.
The example of the text inside the file I've created:

After the user logged in the system, the user can choose to withdraw and deposit. The problem is, I don't have an idea on how to get the balance inside the text file and add or subtract the amount of it and replace its previous with the current amount. This is the sample of my code.

String typeSelection = null;
while(typeSelection != "F" || typeSelection != "f") {

        System.out.println("Type Selection:\n");
        System.out.println("A. Withdraw");
        System.out.println("B. Deposit");

switch(typeSelection) {
        case "a", "A":
            getWithdraw(accountNumber, accountBalance);
            break;
        case "b", "B":
            getDeposit(accountNumber, accountBalance);
            break;
            }

public static void getWithdraw(int accountNumber, int accountBalance) {
    /* code to go to the directory and get the user's balance and substract the amount of how
much the user withdraw then replace the old amount with the current value */

}

public static void getDeposit(int accountNumber, int depositAmount) {
    //same with withdraw method except it will add user's balance
}

The reason why I'm including accountNumber inside the method's parameter because I'm using it to locate the directory and my text file.

FileInputStream fis = new FileInputStream(directory + accountNumber + ".txt");

I'm also using try-catch statement and when I created the file as well. I just only have started and learning this project few days ago, hitting few dead ends here and there but this time I'm kinda stuck for several hours, so I decided to ask for help here. I hope you understand what I mean since English is not my native language :p and thank you.


问:
How can I determine the order of files/sub-folders within user-generated folders in Django?
I am building a Django web app where users can upload files into a folder structure that they also create/control. I know how to facilitate uploading of files and understand the solution proposed in this question about how to "assign" files (or sub-folders) to their parent folders, without having to create actual folders in the underlying file storage.

However, in my web-app I would also like to allow users to determine the order of files and sub-folders within each folder without relying on the actual filenames.

I know I can set the order of the returned one-to-many model instances by setting the index variable in a meta class (see this question). In my case I could thus insert an "order" field into the file/folder models and then set this value appropriately for each file/sub-folder in a given parent folder.
However, this would mean that when a user moves a file from the bottom to the top of the parent folder, for example, every single one of the parent folder's file/sub-folder model instances would need to be edited to reflect their new position in the folder. Maybe my lack of coding experience is misleading me, but this setup looks to me to be error prone and expensive.

Is there a different solution to this problem that is a bit "cleaner"?


问:
Webdriver io appium hooks and cucumber
I’m new to appium and JavaScript,
I’m using cucumber as part of the bdd and trying to find a way for tests to stop and reset when a scenario ends rather than proceed to the next scenario in the same session. In other similar  frameworks like Java, cucumber-junit runner treats each scenario in isolation, how do I do that for wdio, cucumber appium

How do I configure that in the wdio.conf.js

Title: Webdriver io appium hooks and cucumber