问:
How many times method GenerateClaimsAsync invokes?
I have a problem with understanding how UserClaimsPrincipalFactory<TUser, TRole> class works.
In my situation the method GenerateClaimsAsync invokes three times and I don't know why.
I use IdentityServer 4 and .NET 6 MVC as a client. Also I use UserClaimsPrincipalFactory<TUser, TRole> to extend user's claims by calling an API method to retrieve specific information and make some DB calls. I worry about optimization of my application.
Take a look at my code:

```<code>public class ApplicationClaimsPrincipalFactory : UserClaimsPrincipalFactory<ApplicationUser, IdentityRole>
{
    private readonly IApplicationUserRepository _applicationUserRepository;
    private readonly IPageUserAccessRepository _pageUserAccessRepository;
    private readonly IMapper _mapper;
    private readonly IMediator _mediator;

    public ApplicationClaimsPrincipalFactory(UserManager<ApplicationUser> userManager,
        RoleManager<IdentityRole> roleManager,
        IOptions<IdentityOptions> options,
        IApplicationUserRepository applicationUserRepository,
        IPageUserAccessRepository pageUserAccessRepository,
        IMapper mapper, IMediator mediator) : base(userManager, roleManager, options)
    {
        _applicationUserRepository = applicationUserRepository;
        _pageUserAccessRepository = pageUserAccessRepository;
        _mapper = mapper;
        _mediator = mediator;
    }

    protected override async Task<ClaimsIdentity> GenerateClaimsAsync(ApplicationUser user)
    {
        var identity = await base.GenerateClaimsAsync(user);

        var userDto = await _applicationUserRepository.GetUserAsync(user.Id);
        var cabinetUserAccesses = await _applicationUserRepository.GetCabinetUserAccessesAsync(user.Id);
        var pageUserAccesses = await _pageUserAccessRepository.GetPageUserAccessesAsync(user.Id);

        var mappedCabinetUserAccesses = _mapper.Map<IList<UserPermission.CabinetPermission>>(cabinetUserAccesses);
        var mappedPageUserAccesses = _mapper.Map<IList<UserPermission.PagePermission>>(pageUserAccesses);

        var pharmacyPermissions = await Task.WhenAll(userDto.Pharmacies.Select(GetPharmacyPermission));
        var userPermission = new UserPermission(user.Id)
        {
            Cabinets = mappedCabinetUserAccesses,
            Pages = mappedPageUserAccesses,
            Pharmacies = pharmacyPermissions
        };

        identity.AddClaims(new List<Claim>
        {
            new (ClaimConstants.UserPermission, JsonConvert.SerializeObject(userPermission)),
            new (ClaimConstants.ClientId, user.ClientId.ToString()),
            new (ClaimConstants.FullName, userDto.Name ?? string.Empty),
            new (ClaimConstants.Login, user.Login)
        });

        return identity;
    }

    private async Task<UserPermission.PharmacyPermission> GetPharmacyPermission(string pharmacyId)
    {
        // make API call
        var response = await _mediator.Send(new GetBranchSettingsQuery(pharmacyId));

        //other code

        return //some result
    }
}
</code>```

How can I actually decrease amount of invoking this method (GenerateClaimsAsync). Does it matter where it's used in ConfigureServices method of Startup class, I mean the order where it's included.

Body:
I have a problem with understanding how UserClaimsPrincipalFactory<TUser, TRole> class works.
In my situation the method GenerateClaimsAsync invokes three times and I don't know why.
I use IdentityServer 4 and .NET 6 MVC as a client. Also I use UserClaimsPrincipalFactory<TUser, TRole> to extend user's claims by calling an API method to retrieve specific information and make some DB calls. I worry about optimization of my application.
Take a look at my code:

public class ApplicationClaimsPrincipalFactory : UserClaimsPrincipalFactory<ApplicationUser, IdentityRole>
{
    private readonly IApplicationUserRepository _applicationUserRepository;
    private readonly IPageUserAccessRepository _pageUserAccessRepository;
    private readonly IMapper _mapper;
    private readonly IMediator _mediator;

    public ApplicationClaimsPrincipalFactory(UserManager<ApplicationUser> userManager,
        RoleManager<IdentityRole> roleManager,
        IOptions<IdentityOptions> options,
        IApplicationUserRepository applicationUserRepository,
        IPageUserAccessRepository pageUserAccessRepository,
        IMapper mapper, IMediator mediator) : base(userManager, roleManager, options)
    {
        _applicationUserRepository = applicationUserRepository;
        _pageUserAccessRepository = pageUserAccessRepository;
        _mapper = mapper;
        _mediator = mediator;
    }

    protected override async Task<ClaimsIdentity> GenerateClaimsAsync(ApplicationUser user)
    {
        var identity = await base.GenerateClaimsAsync(user);

        var userDto = await _applicationUserRepository.GetUserAsync(user.Id);
        var cabinetUserAccesses = await _applicationUserRepository.GetCabinetUserAccessesAsync(user.Id);
        var pageUserAccesses = await _pageUserAccessRepository.GetPageUserAccessesAsync(user.Id);

        var mappedCabinetUserAccesses = _mapper.Map<IList<UserPermission.CabinetPermission>>(cabinetUserAccesses);
        var mappedPageUserAccesses = _mapper.Map<IList<UserPermission.PagePermission>>(pageUserAccesses);

        var pharmacyPermissions = await Task.WhenAll(userDto.Pharmacies.Select(GetPharmacyPermission));
        var userPermission = new UserPermission(user.Id)
        {
            Cabinets = mappedCabinetUserAccesses,
            Pages = mappedPageUserAccesses,
            Pharmacies = pharmacyPermissions
        };

        identity.AddClaims(new List<Claim>
        {
            new (ClaimConstants.UserPermission, JsonConvert.SerializeObject(userPermission)),
            new (ClaimConstants.ClientId, user.ClientId.ToString()),
            new (ClaimConstants.FullName, userDto.Name ?? string.Empty),
            new (ClaimConstants.Login, user.Login)
        });

        return identity;
    }

    private async Task<UserPermission.PharmacyPermission> GetPharmacyPermission(string pharmacyId)
    {
        // make API call
        var response = await _mediator.Send(new GetBranchSettingsQuery(pharmacyId));

        //other code

        return //some result
    }
}

How can I actually decrease amount of invoking this method (GenerateClaimsAsync). Does it matter where it's used in ConfigureServices method of Startup class, I mean the order where it's included.


来源: stackexchange

问:
Java Scanner skipping on next 2nd loop
I'm creating a Calculator Object based on our topic OOP now I created the Class but it somehow skipped the scanner in userInputOp() method on the second call from the loop.

```<code>    Calculator() {
        System.out.println("Calculator Created");
        while(!ifExit){
            showInstructions();
            userInputOp();
            ifExit();
            if(this.ifExit) {
                break;
            }
            userInputNum();
            compute(this.n1,this.n2);
            printResults();
            this.op = null;
        }
    }
    private void userInputOp() {
        System.out.println("userInputOp");
        System.out.print("Enter operator symbol: ");
        this.op = sc.nextLine();
    }
    private void ifExit() {
        System.out.println("ifExit");
        if(this.op.equals("0"))
            this.ifExit = true;
    }
}
</code>```

Output

```<code>**Below is the 2nd output of the loop**
====================================
      | BASIC CALCULATOR |
      ADDITION -       ( + )
      SUBTRACTION -    ( - )
      MULTIPLICATION - ( x )
      DIVISION -       ( / )
      MODULO -         ( % )
      EXIT -           ( 0 )
====================================
userInputOp
Enter operator symbol: ifExit
Enter first number:
</code>```

I expected it to not skip the scanner in userInputOp() method.

Solution
Related Problem Link
TL:DR
Adding nextLine() on every nextInt/Double fixed the issue.

```<code> System.out.print("Enter first number: ");
    this.n1 = sc.nextDouble();
    sc.nextLine();
    System.out.print("Enter second number: ");
    this.n2 = sc.nextDouble();
    sc.nextLine();
</code>```

ContentLicense: CC BY-SA 4.0

Title: Java Scanner skipping on next 2nd loop

Body:
I'm creating a Calculator Object based on our topic OOP now I created the Class but it somehow skipped the scanner in userInputOp() method on the second call from the loop.

    Calculator() {
        System.out.println("Calculator Created");
        while(!ifExit){
            showInstructions();
            userInputOp();
            ifExit();
            if(this.ifExit) {
                break;
            }
            userInputNum();
            compute(this.n1,this.n2);
            printResults();
            this.op = null;
        }
    }
    private void userInputOp() {
        System.out.println("userInputOp");
        System.out.print("Enter operator symbol: ");
        this.op = sc.nextLine();
    }
    private void ifExit() {
        System.out.println("ifExit");
        if(this.op.equals("0"))
            this.ifExit = true;
    }
}

Output

**Below is the 2nd output of the loop**
====================================
      | BASIC CALCULATOR |
      ADDITION -       ( + )
      SUBTRACTION -    ( - )
      MULTIPLICATION - ( x )
      DIVISION -       ( / )
      MODULO -         ( % )
      EXIT -           ( 0 )
====================================
userInputOp
Enter operator symbol: ifExit
Enter first number:

I expected it to not skip the scanner in userInputOp() method.

Solution
Related Problem Link
TL:DR
Adding nextLine() on every nextInt/Double fixed the issue.

 System.out.print("Enter first number: ");
    this.n1 = sc.nextDouble();
    sc.nextLine();
    System.out.print("Enter second number: ");
    this.n2 = sc.nextDouble();
    sc.nextLine();


问:
PyTorch group feature mean by coordinates
In my code I have a lot of duplicate coordinates with features each, where i would like to group those coordinates by x,y,z and take the mean of each feature.

Example:

```<code>import torch
coords = torch.randint(0,3,(5,3)).repeat(2,1)
features = torch.rand(10, 4)
data = torch.cat([coords, features], dim=1)
</code>```

As there is every coordinate twice now, they should get combined to one where their feature values should be the mean value. I know that could by quite easy in Pandas, but i would like to stay in Torch to no convert back an forth.

I came up with following solution, based on other ideas combined:

Numpy: Average of values corresponding to unique coordinate positions

https://discuss.pytorch.org/t/numpy-lexsort-equivalent-in-pytorch/47850/2

```<code>    def group_coo_mean(data: torch.Tensor) -> torch.Tensor:
        """Group by unique coordinates and calculate the mean of feature values of it.
        With N_FEAT = number of features

        Args:
            data (torch.Tensor): (n,3+N_FEAT) Coordinates and feature values.

        Returns:
            torch.Tensor: (m, 3+N_FEAT) Unique coordinates and mean feature values.
        """
        points = data[:,:3]
        features = data[:,3:]

        # equivalent to numpy lexsort, sort by coordinates x,y,z
        a_unq, inv = torch.unique(points.T.flip(0), dim=1, sorted=True, return_inverse=True)
        sortidx = torch.argsort(inv)
        sorted_coo = points[sortidx]

        # Get mask of start of each unique coo XYZ
        unqID_mask = torch.cat((torch.Tensor([True]),torch.any(torch.diff(sorted_coo,axis=0),axis=1))).bool()

        # Tag/ID each coo XYZ based on their uniqueness among others
        ID = torch.cumsum(unqID_mask, dim=0)-1

        # Get unique coo XYZ's
        unq_coo = sorted_coo[unqID_mask]

        # Finally use bincount to get the summation of all coo within same IDs
        # and their counts and thus the average values of one xyz position
        # for each feature column
        for i in range(features.shape[1]):
            values = features[:,i]
            average_values = torch.bincount(ID,values[sortidx])/torch.bincount(ID)
            unq_coo = torch.cat((unq_coo, torch.unsqueeze(average_values, dim=1)), dim=1)
        return unq_coo
</code>```

What is bothering me is the loop over the features... Is there a smart way to vectorize that?
Or in general a better approach?

Body:
In my code I have a lot of duplicate coordinates with features each, where i would like to group those coordinates by x,y,z and take the mean of each feature.

Example:

import torch
coords = torch.randint(0,3,(5,3)).repeat(2,1)
features = torch.rand(10, 4)
data = torch.cat([coords, features], dim=1)

As there is every coordinate twice now, they should get combined to one where their feature values should be the mean value. I know that could by quite easy in Pandas, but i would like to stay in Torch to no convert back an forth.

I came up with following solution, based on other ideas combined:

Numpy: Average of values corresponding to unique coordinate positions

https://discuss.pytorch.org/t/numpy-lexsort-equivalent-in-pytorch/47850/2

    def group_coo_mean(data: torch.Tensor) -> torch.Tensor:
        """Group by unique coordinates and calculate the mean of feature values of it.
        With N_FEAT = number of features

        Args:
            data (torch.Tensor): (n,3+N_FEAT) Coordinates and feature values.

        Returns:
            torch.Tensor: (m, 3+N_FEAT) Unique coordinates and mean feature values.
        """
        points = data[:,:3]
        features = data[:,3:]

        # equivalent to numpy lexsort, sort by coordinates x,y,z
        a_unq, inv = torch.unique(points.T.flip(0), dim=1, sorted=True, return_inverse=True)
        sortidx = torch.argsort(inv)
        sorted_coo = points[sortidx]

        # Get mask of start of each unique coo XYZ
        unqID_mask = torch.cat((torch.Tensor([True]),torch.any(torch.diff(sorted_coo,axis=0),axis=1))).bool()

        # Tag/ID each coo XYZ based on their uniqueness among others
        ID = torch.cumsum(unqID_mask, dim=0)-1

        # Get unique coo XYZ's
        unq_coo = sorted_coo[unqID_mask]

        # Finally use bincount to get the summation of all coo within same IDs
        # and their counts and thus the average values of one xyz position
        # for each feature column
        for i in range(features.shape[1]):
            values = features[:,i]
            average_values = torch.bincount(ID,values[sortidx])/torch.bincount(ID)
            unq_coo = torch.cat((unq_coo, torch.unsqueeze(average_values, dim=1)), dim=1)
        return unq_coo

What is bothering me is the loop over the features... Is there a smart way to vectorize that?
Or in general a better approach?


问:
How to set time and date in calender class in Java?
```<code>import java.util.*;

enum CITY{ROME,BUDAPEST,PARIS,GREECE,TALIN,AMSTREDAM,VIENNA;}

class Flight{
    private String flightName = "AirBus";
    private int ticketPrice = 50;
    private CITY Destination = CITY.ROME;
    private int numberOfTravellers = 83;
    private int flightDuration = 2;
    Calendar flightTime = Calendar.getInstance();
    Calendar flightDate = Calendar.getInstance();
    flightDate.set(Calendar.YEAR, 2002);
    flightDate.set(Calendar.MONTH, 2);
    flightDate.set(Calendar.DAY, 20);
    flightTime.set(Calendar.HOUR,10);
    flightTime.set(Calendar.MINUTE, 0);
    flightTime.set(Calendar.SECOND, 0);

    private static int goalTicketPrice = 35;
}
</code>```

I am tring to set the Date and time of the flight.
but getting these types of 18 errors.

It gives this error ....

```<code><identifier> expected
    flightDate.set(Calendar.YEAR, 2002);

</code>```

Body:
import java.util.*;

enum CITY{ROME,BUDAPEST,PARIS,GREECE,TALIN,AMSTREDAM,VIENNA;}

class Flight{
    private String flightName = "AirBus";
    private int ticketPrice = 50;
    private CITY Destination = CITY.ROME;
    private int numberOfTravellers = 83;
    private int flightDuration = 2;
    Calendar flightTime = Calendar.getInstance();
    Calendar flightDate = Calendar.getInstance();
    flightDate.set(Calendar.YEAR, 2002);
    flightDate.set(Calendar.MONTH, 2);
    flightDate.set(Calendar.DAY, 20);
    flightTime.set(Calendar.HOUR,10);
    flightTime.set(Calendar.MINUTE, 0);
    flightTime.set(Calendar.SECOND, 0);

    private static int goalTicketPrice = 35;
}

I am tring to set the Date and time of the flight.
but getting these types of 18 errors.

It gives this error ....

<identifier> expected
    flightDate.set(Calendar.YEAR, 2002);


问:
Getting binary/octet datatype for an image/jpeg file
I want to upload my file to S3 as an image/jpeg but it is uploaded as a binary/octet-stream . I have done trial and error on many different ways (http,request,filereader,fs,etc..) with no success .

```<code>  const image = "http://nodejs.org/static/legacy/images/logo.png"
  let data = new FormData();

# http.request(image, function(response) {
    data.append('image', response);
    console.log(response)

  });

  let config = {
    method: 'put',
    url: 'https://aqc04t49bj.execute-api.us-east-1.amazonaws.com/prod/myarrowbucket/IMG_07323.jpg',
    headers: {
      "Content-Type": "image/jpeg",
    },
    data : data
  };
    axios(config)
  .then((response) => {
    console.log(JSON.stringify(response.data));
  })
  .catch((error) => {
    console.log(error);
  });
})
</code>```

I was thinking the problem with http.request which is why i commented it out . Regardless , it is still showing the same error even when i upload the empty formdata and change the content-type to mulitpart form

Body:
I want to upload my file to S3 as an image/jpeg but it is uploaded as a binary/octet-stream . I have done trial and error on many different ways (http,request,filereader,fs,etc..) with no success .

  const image = "http://nodejs.org/static/legacy/images/logo.png"
  let data = new FormData();

# http.request(image, function(response) {
    data.append('image', response);
    console.log(response)

  });

  let config = {
    method: 'put',
    url: 'https://aqc04t49bj.execute-api.us-east-1.amazonaws.com/prod/myarrowbucket/IMG_07323.jpg',
    headers: {
      "Content-Type": "image/jpeg",
    },
    data : data
  };
    axios(config)
  .then((response) => {
    console.log(JSON.stringify(response.data));
  })
  .catch((error) => {
    console.log(error);
  });
})

I was thinking the problem with http.request which is why i commented it out . Regardless , it is still showing the same error even when i upload the empty formdata and change the content-type to mulitpart form


问:
How to Build Open DNP3 Library?
I need to Build the  Open DNP3 Lib
but the problem coz  there is a lot of .cpp and .h files in the  library and I don't know how the add the lib to a Console C++ Project and build it

Iam a beginner in C++ and any thing will help me ; so fell free to leave any comment if you don't know the exact answer

Title: How to Build Open DNP3 Library?


问:
How i can use latest mui with preact?
I wanna use mui with preact but preact does not support mui.Is there a way to use mui with preact.

I used a package called preact-mui but it is also out dated and not functioning properly.
Is there any way to use mui with preact? I dont wanna use material design.

Title: How i can use latest mui with preact?


问:
inotifywait moniter /etc/shadow file for password change is working only for the first time
I am trying to monitor the changes in the /etc/shadow file continuously using inotifywait. But, it is only detecting only the first event.

```<code>  sudo inotifywait -m -e attrib /etc/shadow |
  while read E; do
    echo "File modified"
  done
</code>```

This is the code snippet. When I change the password for a user, while loop echo statement gets executed. But when I change the password for the second time, it is not getting executed.

NOTE:  I am using the -m flag for inotifywait to continue execution.

Body:
I am trying to monitor the changes in the /etc/shadow file continuously using inotifywait. But, it is only detecting only the first event.

  sudo inotifywait -m -e attrib /etc/shadow |
  while read E; do
    echo "File modified"
  done

This is the code snippet. When I change the password for a user, while loop echo statement gets executed. But when I change the password for the second time, it is not getting executed.

NOTE:  I am using the -m flag for inotifywait to continue execution.


问:
traefik always send traffic via tcp to middleware not over TLS
We are trying to encrypt communication between traefik ingress and middleware (forwardauth) & ingress to backend server also.
Forwardauth redirects traffic to authentication server which is running over https and used selfsinged certificate.

In the wireshark i can see that ingress is communicating with authentication server using TCP insted TLS, but the communication between ingress and backend server using tls.
Please help how to enable tls communication between traefik ingress and middleware .

```<code>apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  annotations:
    kubernetes.io/ingress.class: traefik
  name: traefik-tls-1
  namespace: sample-domain1-ns
spec:
  entryPoints:
   - websecure
  routes:
  - kind: Rule
    match: PathPrefix(`/api`)
    middlewares:
    - name: test-auth-https
      namespace: sample-domain1-ns
    - name: test-auth
      namespace: sample-domain1-ns
    services:
    - kind: Service
      name: sample-svc
      port: 8002
      scheme: "https"
      serversTransport: mytransport
  tls:
     secretName: domain1-tls-cert
     options:
       name: mtlsoption-ecprt
       namespace: sample-domain1-ns

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: test-auth-https
  namespace: sample-domain1-ns
spec:
  redirectScheme:
    scheme: https
    permanent: true

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: test-auth
  namespace: sample-domain1-ns
spec:
  forwardAuth:
    address:  https://s-lb.sample-ns.svc.cluster.local:8080/auth
    tls:
       insecureSkipVerify: true

</code>```

communication between traefik ingress and middleware as well as backend server should be on TLS.

Body:
We are trying to encrypt communication between traefik ingress and middleware (forwardauth) & ingress to backend server also.
Forwardauth redirects traffic to authentication server which is running over https and used selfsinged certificate.

In the wireshark i can see that ingress is communicating with authentication server using TCP insted TLS, but the communication between ingress and backend server using tls.
Please help how to enable tls communication between traefik ingress and middleware .

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  annotations:
    kubernetes.io/ingress.class: traefik
  name: traefik-tls-1
  namespace: sample-domain1-ns
spec:
  entryPoints:
   - websecure
  routes:
  - kind: Rule
    match: PathPrefix(`/api`)
    middlewares:
    - name: test-auth-https
      namespace: sample-domain1-ns
    - name: test-auth
      namespace: sample-domain1-ns
    services:
    - kind: Service
      name: sample-svc
      port: 8002
      scheme: "https"
      serversTransport: mytransport
  tls:
     secretName: domain1-tls-cert
     options:
       name: mtlsoption-ecprt
       namespace: sample-domain1-ns

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: test-auth-https
  namespace: sample-domain1-ns
spec:
  redirectScheme:
    scheme: https
    permanent: true

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: test-auth
  namespace: sample-domain1-ns
spec:
  forwardAuth:
    address:  https://s-lb.sample-ns.svc.cluster.local:8080/auth
    tls:
       insecureSkipVerify: true

communication between traefik ingress and middleware as well as backend server should be on TLS.


问:
Is it possible to use sed instead of Grep -oP to extract a word?
I have a bunch of data from an API that I'm trying to extract the words "cloudy" or rainy", I've used grep -oP, but was wondering if it's possible to use sed for it.

My code:

```<code> grep "symbol id=" | grep -oP '(?<=code=").*?(?=")'
</code>```

The API data:

```<code><time datatype="forecast" from="2022-12-07T12:00:00Z" to="2022-12-07T13:00:00Z">
  <location altitude="585" latitude="60.8941" longitude="10.5001">
    <precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0">.
</precipitation>
    <symbol id="Cloud" number="4" code="cloudy"></symbol>
  </location>
</time>
    <symbol id="Cloud" number="4" code="cloudy"></symbol>
--
<time datatype="forecast" from="2022-12-07T12:00:00Z" to="2022-12-07T18:00:00Z">
  <location altitude="585" latitude="60.8941" longitude="10.5001">
    <precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0">.
 </precipitation>
    <minTemperature id="TTT" unit="celsius" value="-9.8"></minTemperature>
    <maxTemperature id="TTT" unit="celsius" value="-7.6"></maxTemperature>
    <symbol id="PartlyCloud" number="3" code="partlycloudy_day"></symbol>
  </location>
 </time>
</code>```

Body:
I have a bunch of data from an API that I'm trying to extract the words "cloudy" or rainy", I've used grep -oP, but was wondering if it's possible to use sed for it.

My code:

 grep "symbol id=" | grep -oP '(?<=code=").*?(?=")'

The API data:

<time datatype="forecast" from="2022-12-07T12:00:00Z" to="2022-12-07T13:00:00Z">
  <location altitude="585" latitude="60.8941" longitude="10.5001">
    <precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0">.
</precipitation>
    <symbol id="Cloud" number="4" code="cloudy"></symbol>
  </location>
</time>
    <symbol id="Cloud" number="4" code="cloudy"></symbol>
--
<time datatype="forecast" from="2022-12-07T12:00:00Z" to="2022-12-07T18:00:00Z">
  <location altitude="585" latitude="60.8941" longitude="10.5001">
    <precipitation unit="mm" value="0.0" minvalue="0.0" maxvalue="0.0">.
 </precipitation>
    <minTemperature id="TTT" unit="celsius" value="-9.8"></minTemperature>
    <maxTemperature id="TTT" unit="celsius" value="-7.6"></maxTemperature>
    <symbol id="PartlyCloud" number="3" code="partlycloudy_day"></symbol>
  </location>
 </time>


问:
Saving Compose State in Android Service
We have an Android App(say App-A) which also has a bound Service(say Service-A) running. The bound Service is started by another Service(say Service-B) in the device during device boot-up. Both Services are up and running until the device is shutdown. Recently we re-implemented App-A using Compose following MVVM. Most of the compose states are observed from the ViewModel. But there are some cases where Service-B communicates with Service-A using Messenger. Then Service-A does some function on receiving the message and the result should we updated in the UI. In this case is it architecturally fine  to store the states in the Service and the Composables observe the state directly from the UI ?

In short, can a Service act as a StateHolder for the Composables just like a Viewmodel ?

Title: Saving Compose State in Android Service


问:
how to import the HttpClientModule in the root module of the application using ng-add schematics
I have a project in angular and I need to add the HttpClientModule, how do I do this using schematics ng-add ?

I believe it is the change in shema.json

```<code>{
  "$schema": "http://json-schema.org/schema",
  "$id": "SchematicsNgAdd",
  "title": "Ng Add Options Schema",
  "type": "object",
  "properties": {
    "project": {
      "type": "string",
      "description": "Name of the project.",
      "$default": {
        "$source": "projectName"
      }
    },
    "configSideMenu": {
      "type": "boolean",
      "description": "When true create a app.component with po-toolbar and po-menu configured.",
      "default": true,
      "x-prompt": "Would you like to configure Sidemenu?",
      "x-user-analytics": 17
    }
  },
  "required": []
}
</code>```

Body:
I have a project in angular and I need to add the HttpClientModule, how do I do this using schematics ng-add ?

I believe it is the change in shema.json

{
  "$schema": "http://json-schema.org/schema",
  "$id": "SchematicsNgAdd",
  "title": "Ng Add Options Schema",
  "type": "object",
  "properties": {
    "project": {
      "type": "string",
      "description": "Name of the project.",
      "$default": {
        "$source": "projectName"
      }
    },
    "configSideMenu": {
      "type": "boolean",
      "description": "When true create a app.component with po-toolbar and po-menu configured.",
      "default": true,
      "x-prompt": "Would you like to configure Sidemenu?",
      "x-user-analytics": 17
    }
  },
  "required": []
}


问:
How to parsing rdf xml in Java
I used java dom to parsing rdf xml in java, but I couldn't parsing rdf xml in the direction I wanted. Here is my code :

```<code>String[] arr = new String[100];

    DocumentBuilderFactory factory_parsing = DocumentBuilderFactory.newInstance();

    try {
        DocumentBuilder builder_parsing = factory_parsing.newDocumentBuilder();
        Document document = builder_parsing.parse("D://Test/dog_test.xml");

        Element root = document.getDocumentElement();
        System.out.println(root.getNodeName());

        Node firstNode = root.getFirstChild();
        Node next = firstNode.getNextSibling();

        NodeList childList = next.getChildNodes();

        System.out.println(childList.getLength());
        for(i=0; i<childList.getLength(); i++){
            Node item = childList.item(i);
            if(item.getNodeType() == Node.ELEMENT_NODE){
                System.out.println(item.getNodeName());
                arr[i] = item.getNodeName();
                System.out.println(item.getTextContent());
            }else {
                System.out.println("blank node.");
            }
        }
</code>```

The result :

```<code>rdf:RDF
5
blank node.
test:Animal.Name
Jeck
blank node.
test:Dog.breed
Akita
blank node.
</code>```

dog_test.xml :

```<code><rdf:RDF
xmlns:test="http://www.test/2022#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base="http://www.desktop-eqkvgq5.net/2022#">
<test:Dog rdf:ID="_100">
<test:Animal.Name>Jeck</test:Animal.Name>
<test:Dog.breed>Akita</test:Dog.breed>
</test:Dog>
<test:Cat rdf:ID="_101">
<test:Animal.Name>Tom</test:Animal.Name>
<test:Cat.breed>Munchkin</test:Cat.breed>
</test:Cat>
</rdf:RDF>
</code>```

So I analyzed it hard to use the Jena method, but I don't know how to use it. I'm exhausted.
My question is two.

Is my java dom code wrong? The result is a mess. Even information on the cat is completely missing. Is java dome unable to parsing rdf xml?

I'd like to use the RDFXMLParser provided by Jena, but I'd like to know an example of using it.

What I want is to store data corresponding to s, p, and o as a string and change the final result to triple.

The results I want are as follows :

```<code>100 rdf:type test:Dog
100 test:Animal.Name Jeck
100 test:Dog.breed Akita
101 rdf:type test:Cat
101 test:Animal.Name Tom
101 test:Cat.breed Munchkin
</code>```

Thank you for any advice

Title: How to parsing rdf xml in Java

Body:
I used java dom to parsing rdf xml in java, but I couldn't parsing rdf xml in the direction I wanted. Here is my code :

String[] arr = new String[100];

    DocumentBuilderFactory factory_parsing = DocumentBuilderFactory.newInstance();

    try {
        DocumentBuilder builder_parsing = factory_parsing.newDocumentBuilder();
        Document document = builder_parsing.parse("D://Test/dog_test.xml");

        Element root = document.getDocumentElement();
        System.out.println(root.getNodeName());

        Node firstNode = root.getFirstChild();
        Node next = firstNode.getNextSibling();

        NodeList childList = next.getChildNodes();

        System.out.println(childList.getLength());
        for(i=0; i<childList.getLength(); i++){
            Node item = childList.item(i);
            if(item.getNodeType() == Node.ELEMENT_NODE){
                System.out.println(item.getNodeName());
                arr[i] = item.getNodeName();
                System.out.println(item.getTextContent());
            }else {
                System.out.println("blank node.");
            }
        }

The result :

rdf:RDF
5
blank node.
test:Animal.Name
Jeck
blank node.
test:Dog.breed
Akita
blank node.

dog_test.xml :

<rdf:RDF
xmlns:test="http://www.test/2022#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base="http://www.desktop-eqkvgq5.net/2022#">
<test:Dog rdf:ID="_100">
<test:Animal.Name>Jeck</test:Animal.Name>
<test:Dog.breed>Akita</test:Dog.breed>
</test:Dog>
<test:Cat rdf:ID="_101">
<test:Animal.Name>Tom</test:Animal.Name>
<test:Cat.breed>Munchkin</test:Cat.breed>
</test:Cat>
</rdf:RDF>

So I analyzed it hard to use the Jena method, but I don't know how to use it. I'm exhausted.
My question is two.

Is my java dom code wrong? The result is a mess. Even information on the cat is completely missing. Is java dome unable to parsing rdf xml?

I'd like to use the RDFXMLParser provided by Jena, but I'd like to know an example of using it.

What I want is to store data corresponding to s, p, and o as a string and change the final result to triple.

The results I want are as follows :

100 rdf:type test:Dog
100 test:Animal.Name Jeck
100 test:Dog.breed Akita
101 rdf:type test:Cat
101 test:Animal.Name Tom
101 test:Cat.breed Munchkin

Thank you for any advice


问:
Transition from one scene to another scene in animation using OpenGL?
I tried to change from one scene to another scene using glutSwapBuffers(), but if i run this code, all i can get is a blue background. Can someone help me pinpoint where is the problem and provide simple solution to this problem?

```<code>#include <Windows.h>
#include <stdlib.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glut.h>
#include <io.h>
#include <math.h>
#include <iostream>

#define SCREEN_HEIGHT 10
#define SCREEN_WIDTH 10
#define PI 3.1415926535897932384626433832795
#define FPS 30

int x = 30;
int y = 50;
int dx = 10;//velocity
int dy = 15;

int winWidth = 1200, winHeight = 1000, counter = 0;
time_t t;

void init() {
    glClearColor(0.0, 0.0, 0.0, 0.0);
    glMatrixMode(GL_PROJECTION);
    gluOrtho2D(0.0, winWidth, 0.0, winHeight);
}

float elapsedTime = 0, base_time = 0, fps = 0, frames;

void calcFPS() {
    elapsedTime = glutGet(GLUT_ELAPSED_TIME);
    if ((elapsedTime - base_time) > 1000.0) {
        fps = frames * 1000.0 / (elapsedTime - base_time);
        printf("fps: %f", fps);
        base_time = elapsedTime;
        frames = 0;
    }
    frames++;
}

void r_idle() {}

void MyTimerFunc(int value);

/*======================
********INITIALIZE******
*======================*/
void circle(int x, int y, int r);
void rectangle(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
void triangle(int x1, int y1, int x2, int y2, int x3, int y3);
void line(float a, float b, float c, float d);
void car();
void road();
void cloud();
void lightning();
void ghost2();
void ghost2_move();

/*======================
********SHAPES**********
*======================*/

void circle(int x, int y, int r) // r = radius
{
    //draw a circle
    float theta;
    glBegin(GL_TRIANGLE_FAN);
    for (int i = 0; i < 360; i++)
    {
        theta = i * PI / 180;
        glVertex2f(x + r * cos(theta), y + r * sin(theta)); //x-axis , y-axis, 196 = radius
    }
    glEnd();
}

void rectangle(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
{
    glBegin(GL_QUADS);
    glVertex2f(x1, y1);
    glVertex2f(x2, y2);
    glVertex2f(x3, y3);
    glVertex2f(x4, y4);
    glEnd();
}

void triangle(int x1, int y1, int x2, int y2, int x3, int y3)
{
    glBegin(GL_TRIANGLES);
    glVertex2f(x1, y1);
    glVertex2f(x2, y2);
    glVertex2f(x3, y3);
    glEnd();
}

void line(float a, float b, float c, float d)
{
    glBegin(GL_LINES);
    glVertex2f(a, b);
    glVertex2f(c, d);
    glEnd();
}

/*===========================
********BACKGROUND**********
*===========================*/
void car()
{
    //upper car body
    glColor3f(0.0, 0.0, 0.5); //blue
    rectangle(0, 280, 1120, 280, 1400, -140, -560, -140);
    //bottom car body
    rectangle(-840, -140, 1400, -140, 1400, -700, -840, -700);

    //front- window (window 1)
    glColor3f(0.51, 0.47, 0.47); //lightest grey
    triangle(-476, -140, -28, 196, -28, -140);
    rectangle(28, 196, 560, 196, 560, -140, 28, -140);
    rectangle(644, 196, 1120, 196, 1120, -140, 644, -140);

    //wheel
    glColor3f(0.0, 0.0, 0.0); //black
    circle(-420, -798, 196); //front wheel
    circle(1036, -798, 196); // back wheel
}

void road()
{
    //road
    glColor3f(0.2, 0.21, 0.2); //light grey
    rectangle(-1400, -980, 1400, -980, 1400, -1400, -1400, -1400);
}

void cloud()
{
    glColor3f(0.17, 0.19, 0.21); //grey
    rectangle(-1400, 1400, 1400, 1400, 1400, 1260, -1400, 1260);
    circle(-1316, 1316, 140);
    circle(-1120, 1260, 196);
    circle(-840, 1260, 140);
    circle(-560, 1260, 252);
    circle(-280, 1260, 112);
    circle(0, 1260, 196);
    circle(280, 1260, 112);
    circle(420, 1260, 84);
    circle(560, 1260, 196);
    circle(700, 1260, 84);
    circle(840, 1260, 112);
    circle(980, 1260, 112);
    circle(1120, 1260, 196);
    circle(1260, 1260, 140);
}

void lightning()
{
    glColor3f(0.88, 0.90, 0.93);
    rectangle(-644, 1260, -560, 1260, -840, 616, -980, 560);
    rectangle(-980, 560, -840, 616, -588, 616, -700, 560);
    triangle(-700, 560, -588, 616, -840, 0);
}

/*===========================
***********GHOST 2**********
*===========================*/

void ghost2()
{
    // hair
    glColor3f(0.0, 0.0, 0.0); //black
    circle(-980, -420, 112);
    circle(-700, -420, 112);
    triangle(-1092, -420, -980, -532, -1092, -532);
    triangle(-588, -420, -588, -532, -700, -532);
    rectangle(-1092, -532, -980, -532, -980, -616, -1092, -616);
    rectangle(-700, -532, -588, -532, -588, -616, -700, -616);
    rectangle(-1092, -616, -980, -616, -924, -672, -1092, -672);
    rectangle(-700, -616, -588, -616, -588, -672, -756, -672);
    rectangle(-1092, -672, -924, -672, -924, -980, -1092, -980);
    rectangle(-756, -672, -588, -672, -588, -980, -756, -980);

    //face
    glColor3f(0.8, 0.8, 0.8); //light grey
    rectangle(-980, -532, -700, -532, -700, -616, -980, -616);
    rectangle(-980, -616, -700, -616, -812, -700, -868, -700);

    //mouth 1
    glColor3f(1.0, 0.0, 0.0); //red
    circle(-840, -560, 112);
    //mouth 2
    glColor3f(0.8, 0.8, 0.8); //light grey
    triangle(-952, -532, -728, -532, -840, -616);
    // hair 1
    glColor3f(0.0, 0.0, 0.0); //black
    rectangle(-980, -308, -700, -308, -700, -532, -980, -532);

    //cloth
    glColor3f(1.0, 0.0, 0.0); //red
    rectangle(-924, -672, -868, -700, -868, -896, -924, -868);
    rectangle(-868, -700, -812, -700, -812, -896, -868, -896);
    rectangle(-812, -700, -756, -672, -756, -868, -812, -896);
    rectangle(-1176, -700, -1092, -700, -1092, -812, -1176, -728);
    rectangle(-588, -700, -560, -700, -532, -756, -588, -812);

    //left leg
    glColor3f(0.91, 0.90, 0.89); //darker light grey
    rectangle(-1316, -476, -1176, -560, -1260, -672, -1344, -644);
    rectangle(-1400, -560, -1316, -476, -1344, -644, -1400, -728);

    //right leg
    glColor3f(0.91, 0.90, 0.89); //darker light grey
    rectangle(-504, -560, -392, -476, -392, -672, -448, -728);
    rectangle(-392, -476, -140, -1008, -224, -1092, -392, -672);
    rectangle(-140, -1008, -84, -1008, -84, -1092, -224, -1092);

    //left arm
    glColor3f(0.8, 0.8, 0.8); //light grey
    rectangle(-1260, -560, -1092, -560, -1092, -700, -1176, -700);
    rectangle(-1260, -560, -1176, -700, -1288, -1176, -1372, -1092);
    rectangle(-1400, -1092, -1372, -1092, -1288, -1176, -1400, -1176);

    //right arm
    glColor3f(0.8, 0.8, 0.8); //light grey
    rectangle(-588, -560, -448, -560, -560, -700, -588, -700);
    rectangle(-560, -700, -448, -560, -392, -1092, -476, -1176);
    rectangle(-392, -1092, -336, -1092, -336, -1176, -476, -1176);
}

/*===========================
**********MOVEMENTS *********
*===========================*/

void ghost2_move()
{
    // hair
    glColor3f(0.0, 0.0, 0.0); //black
    rectangle(-280, 700, 280, 700, 280, 420, -280, 420);
    circle(-280, 560, 140);
    circle(280, 560, 140);
    triangle(-420, 560, -280, 420, -420, 420);
    triangle(280, 420, 420, 560, 420, 420);
    rectangle(-420, 420, -280, 420, -280, 140, -420, 140);
    rectangle(280, 420, 420, 420, 420, 140, 280, 140);
    rectangle(-420, 140, -280, 140, -140, 56, -420, 56);
    rectangle(280, 140, 420, 140, 420, 84, 168, 84);
    rectangle(-420, 56, -140, 56, -140, -560, -420, -560);
    rectangle(168, 84, 420, 84, 420, -560, 168, -560);

    //cloth
    glColor3f(1.0, 0.0, 0.0); //red
    rectangle(-140, 56, -28, 0, -28, -420, -140, -364);
    rectangle(-28, 0, 28, 0, 28, -420, -28, -420);
    rectangle(28, 0, 168, 84, 168, -364, 28, -420);
    triangle(-700, -28, -420, -28, -420, -280);
    triangle(420, -28, 700, -28, 420, -280);

    //face
    glColor3f(0.8, 0.8, 0.8); //light grey
    rectangle(-280, 420, 280, 420, 280, 140, -280, 140);
    rectangle(-280, 140, 280, 140, 28, 0, -28, 0);

    //eye
    glColor3f(0.0, 0.0, 0.0); //black
    circle(-140, 336, 56);
    circle(140, 336, 56);
    glColor3f(1.0, 0.0, 0.0); //red
    circle(-140, 336, 14);
    circle(140, 336, 14);

    //mouth
    glColor3f(1.0, 0.0, 0.0); //red
    triangle(-224, 196, 224, 196, 0, 28);

    //left leg
    glColor3f(0.91, 0.90, 0.89); //darker light grey
    rectangle(-924, 364, -616, 140, -700, -56, -980, 168);
    rectangle(-1400, 0, -924, 364, -980, 168, -1400, -252);
    //right leg
    rectangle(560, 140, 784, 364, 868, 168, 700, -56);
    rectangle(784, 364, 1400, 56, 1400, -196, 868, 168);

    //left arm
    glColor3f(0.8, 0.8, 0.8); //light grey
    rectangle(-840, 140, -420, 140, -420, -56, -700, -56);
    rectangle(-1232, -560, -840, 140, -700, -56, -1232, -728);
    rectangle(-1400, -560, -1232, -560, -1232, -728, -1400, -728);
    //right arm
    rectangle(420, 140, 840, 140, 700, -56, 420, -56);
    rectangle(840, 140, 1260, -644, 1260, -812, 700, -56);
    rectangle(1260, -644, 1400, -644, 1400, -812, 1260, -812);
}

/*===========================
******DISPLAY FUNCTION*******
*===========================*/

void display1() //scene 1 with the ghost in front of the car (before lightning)
{
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.12, 0.13, 0.12, 1.0); //background color - black
    glLoadIdentity();
    gluOrtho2D(-SCREEN_WIDTH, SCREEN_WIDTH, -SCREEN_HEIGHT, SCREEN_HEIGHT);

    road();
    car();
    cloud();
    ghost2();

    glutSwapBuffers();

}

void display2() //scene 2 - first lightning
{
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.12, 0.13, 0.12, 1.0); //background color - black
    glLoadIdentity();
    gluOrtho2D(-SCREEN_WIDTH, SCREEN_WIDTH, -SCREEN_HEIGHT, SCREEN_HEIGHT);

    road();
    car();
    cloud();
    ghost2();
    glColor3f(0.88, 0.90, 0.93);
    rectangle(-644, 1260, -560, 1260, -840, 616, -980, 560);

    glutSwapBuffers();

}

void display3() //scene 3 - second lightning
{
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.12, 0.13, 0.12, 1.0); //background color - black
    glLoadIdentity();
    gluOrtho2D(-SCREEN_WIDTH, SCREEN_WIDTH, -SCREEN_HEIGHT, SCREEN_HEIGHT);

    road();
    car();
    cloud();
    ghost2();
    glColor3f(0.88, 0.90, 0.93);
    rectangle(-644, 1260, -560, 1260, -840, 616, -980, 560);
    rectangle(-980, 560, -840, 616, -588, 616, -700, 560);

    glutSwapBuffers();

}

void display4() //scene 4 - third or full lightning
{
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.12, 0.13, 0.12, 1.0); //background color - black
    glLoadIdentity();
    gluOrtho2D(-SCREEN_WIDTH, SCREEN_WIDTH, -SCREEN_HEIGHT, SCREEN_HEIGHT);

    road();
    car();
    cloud();
    ghost2();
    lightning();

    glutSwapBuffers();

}

void display5() //scene 5 - lightning strike -> blinding Lily's eye
{
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.9, 0.89, 0.88, 1.0); //background color - black
    glLoadIdentity();
    gluOrtho2D(-SCREEN_WIDTH, SCREEN_WIDTH, -SCREEN_HEIGHT, SCREEN_HEIGHT);

    glColor3f(0.91, 0.96, 0.93);
    road();
    //car
    //upper car body
    glColor3f(0.85, 0.8, 0.9); //blue
    rectangle(0, 280, 1120, 280, 1400, -140, -560, -140);
    //bottom car body
    rectangle(-840, -140, 1400, -140, 1400, -700, -840, -700);
    //front- window (window 1)
    glColor3f(0.9, 0.89, 0.88); //white
    triangle(-476, -140, -28, 196, -28, -140);
    rectangle(28, 196, 560, 196, 560, -140, 28, -140);
    rectangle(644, 196, 1120, 196, 1120, -140, 644, -140);
    //wheel
    circle(-420, -798, 196); //front wheel
    circle(1036, -798, 196); // back wheel

    glColor3f(0.91, 0.96, 0.93);
    cloud();
    lightning();

    glutSwapBuffers();

}

void display6() //scene 6 - after lightning
{
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.12, 0.13, 0.12, 1.0); //background color - black
    glLoadIdentity();
    gluOrtho2D(-SCREEN_WIDTH, SCREEN_WIDTH, -SCREEN_HEIGHT, SCREEN_HEIGHT);

    road();
    car();
    cloud();

    glutSwapBuffers();

}

void display7() //last scene- ghost suddenly appeared right in front of Lily out of nowhere
{
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.12, 0.13, 0.12, 1.0); //background color - black
    glLoadIdentity();
    gluOrtho2D(-SCREEN_WIDTH, SCREEN_WIDTH, -SCREEN_HEIGHT, SCREEN_HEIGHT);

    //objects / background
    road();
    car();
    cloud();
    ghost2_move();

    glutSwapBuffers();
}

void idle() {
    DWORD start = GetTickCount64();
    while (GetTickCount64() - start < 1000 / FPS);
    x += dx;
    y += dy;
    if (x < 0 || x > SCREEN_WIDTH) dx *= -1;
    if (y < 0 || y > SCREEN_HEIGHT) dy *= -1;
    glutPostRedisplay();
}

void initGL() {
    glClearColor(0.0, 0.0, 0.0, 0.0);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluOrtho2D(0, SCREEN_WIDTH, 0, SCREEN_HEIGHT);
    glPointSize(10.0);
    glPointSize(10.0);
    glLineWidth(10.0);
}

/*===========================
***********MAIN**************
*===========================*/

int main(int argc, char** argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
    glutCreateWindow("Outside Window");
    glutDisplayFunc(display1);
    glutReshapeWindow(1200, 1000);
    //glutTimerFunc(2000, timer, 0);

    glutIdleFunc(idle);
    glutTimerFunc(1000, MyTimerFunc, 0);
    srand(1);

    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    initGL();
    glutMainLoop();
}

void MyTimerFunc(int value)
{
    if (value == 0)
    {
        glutDisplayFunc(display1);
        glutIdleFunc(display1);
        glutTimerFunc(1000, MyTimerFunc, 1);
    }

    if (value == 1)
    {
        glutDisplayFunc(display2);
        glutIdleFunc(display2);
        glutTimerFunc(1000, MyTimerFunc, 2);
    }

    if (value == 2)
    {
        glutDisplayFunc(display3);
        glutIdleFunc(display3);
        glutTimerFunc(1000, MyTimerFunc, 2);
    }

    if (value == 3)
    {
        glutDisplayFunc(display4);
        glutIdleFunc(display4);
        glutTimerFunc(1000, MyTimerFunc, 2);
    }

    if (value == 4)
    {
        glutDisplayFunc(display5);
        glutIdleFunc(display5);
        glutTimerFunc(1000, MyTimerFunc, 2);
    }

    if (value == 5)
    {
        glutDisplayFunc(display6);
        glutIdleFunc(display6);
        glutTimerFunc(1000, MyTimerFunc, 2);
    }

    if (value == 6)
    {
        glutDisplayFunc(display7);
        glutIdleFunc(display7);
        glutTimerFunc(1000, MyTimerFunc, 2);
    }

}
</code>```

Body:
I tried to change from one scene to another scene using glutSwapBuffers(), but if i run this code, all i can get is a blue background. Can someone help me pinpoint where is the problem and provide simple solution to this problem?

#include <Windows.h>
#include <stdlib.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glut.h>
#include <io.h>
#include <math.h>
#include <iostream>

#define SCREEN_HEIGHT 10
#define SCREEN_WIDTH 10
#define PI 3.1415926535897932384626433832795
#define FPS 30

int x = 30;
int y = 50;
int dx = 10;//velocity
int dy = 15;

int winWidth = 1200, winHeight = 1000, counter = 0;
time_t t;

void init() {
    glClearColor(0.0, 0.0, 0.0, 0.0);
    glMatrixMode(GL_PROJECTION);
    gluOrtho2D(0.0, winWidth, 0.0, winHeight);
}

float elapsedTime = 0, base_time = 0, fps = 0, frames;

void calcFPS() {
    elapsedTime = glutGet(GLUT_ELAPSED_TIME);
    if ((elapsedTime - base_time) > 1000.0) {
        fps = frames * 1000.0 / (elapsedTime - base_time);
        printf("fps: %f", fps);
        base_time = elapsedTime;
        frames = 0;
    }
    frames++;
}

void r_idle() {}

void MyTimerFunc(int value);

/*======================
********INITIALIZE******
*======================*/
void circle(int x, int y, int r);
void rectangle(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
void triangle(int x1, int y1, int x2, int y2, int x3, int y3);
void line(float a, float b, float c, float d);
void car();
void road();
void cloud();
void lightning();
void ghost2();
void ghost2_move();

/*======================
********SHAPES**********
*======================*/

void circle(int x, int y, int r) // r = radius
{
    //draw a circle
    float theta;
    glBegin(GL_TRIANGLE_FAN);
    for (int i = 0; i < 360; i++)
    {
        theta = i * PI / 180;
        glVertex2f(x + r * cos(theta), y + r * sin(theta)); //x-axis , y-axis, 196 = radius
    }
    glEnd();
}

void rectangle(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
{
    glBegin(GL_QUADS);
    glVertex2f(x1, y1);
    glVertex2f(x2, y2);
    glVertex2f(x3, y3);
    glVertex2f(x4, y4);
    glEnd();
}

void triangle(int x1, int y1, int x2, int y2, int x3, int y3)
{
    glBegin(GL_TRIANGLES);
    glVertex2f(x1, y1);
    glVertex2f(x2, y2);
    glVertex2f(x3, y3);
    glEnd();
}

void line(float a, float b, float c, float d)
{
    glBegin(GL_LINES);
    glVertex2f(a, b);
    glVertex2f(c, d);
    glEnd();
}

/*===========================
********BACKGROUND**********
*===========================*/
void car()
{
    //upper car body
    glColor3f(0.0, 0.0, 0.5); //blue
    rectangle(0, 280, 1120, 280, 1400, -140, -560, -140);
    //bottom car body
    rectangle(-840, -140, 1400, -140, 1400, -700, -840, -700);

    //front- window (window 1)
    glColor3f(0.51, 0.47, 0.47); //lightest grey
    triangle(-476, -140, -28, 196, -28, -140);
    rectangle(28, 196, 560, 196, 560, -140, 28, -140);
    rectangle(644, 196, 1120, 196, 1120, -140, 644, -140);

    //wheel
    glColor3f(0.0, 0.0, 0.0); //black
    circle(-420, -798, 196); //front wheel
    circle(1036, -798, 196); // back wheel
}

void road()
{
    //road
    glColor3f(0.2, 0.21, 0.2); //light grey
    rectangle(-1400, -980, 1400, -980, 1400, -1400, -1400, -1400);
}

void cloud()
{
    glColor3f(0.17, 0.19, 0.21); //grey
    rectangle(-1400, 1400, 1400, 1400, 1400, 1260, -1400, 1260);
    circle(-1316, 1316, 140);
    circle(-1120, 1260, 196);
    circle(-840, 1260, 140);
    circle(-560, 1260, 252);
    circle(-280, 1260, 112);
    circle(0, 1260, 196);
    circle(280, 1260, 112);
    circle(420, 1260, 84);
    circle(560, 1260, 196);
    circle(700, 1260, 84);
    circle(840, 1260, 112);
    circle(980, 1260, 112);
    circle(1120, 1260, 196);
    circle(1260, 1260, 140);
}

void lightning()
{
    glColor3f(0.88, 0.90, 0.93);
    rectangle(-644, 1260, -560, 1260, -840, 616, -980, 560);
    rectangle(-980, 560, -840, 616, -588, 616, -700, 560);
    triangle(-700, 560, -588, 616, -840, 0);
}

/*===========================
***********GHOST 2**********
*===========================*/

void ghost2()
{
    // hair
    glColor3f(0.0, 0.0, 0.0); //black
    circle(-980, -420, 112);
    circle(-700, -420, 112);
    triangle(-1092, -420, -980, -532, -1092, -532);
    triangle(-588, -420, -588, -532, -700, -532);
    rectangle(-1092, -532, -980, -532, -980, -616, -1092, -616);
    rectangle(-700, -532, -588, -532, -588, -616, -700, -616);
    rectangle(-1092, -616, -980, -616, -924, -672, -1092, -672);
    rectangle(-700, -616, -588, -616, -588, -672, -756, -672);
    rectangle(-1092, -672, -924, -672, -924, -980, -1092, -980);
    rectangle(-756, -672, -588, -672, -588, -980, -756, -980);

    //face
    glColor3f(0.8, 0.8, 0.8); //light grey
    rectangle(-980, -532, -700, -532, -700, -616, -980, -616);
    rectangle(-980, -616, -700, -616, -812, -700, -868, -700);

    //mouth 1
    glColor3f(1.0, 0.0, 0.0); //red
    circle(-840, -560, 112);
    //mouth 2
    glColor3f(0.8, 0.8, 0.8); //light grey
    triangle(-952, -532, -728, -532, -840, -616);
    // hair 1
    glColor3f(0.0, 0.0, 0.0); //black
    rectangle(-980, -308, -700, -308, -700, -532, -980, -532);

    //cloth
    glColor3f(1.0, 0.0, 0.0); //red
    rectangle(-924, -672, -868, -700, -868, -896, -924, -868);
    rectangle(-868, -700, -812, -700, -812, -896, -868, -896);
    rectangle(-812, -700, -756, -672, -756, -868, -812, -896);
    rectangle(-1176, -700, -1092, -700, -1092, -812, -1176, -728);
    rectangle(-588, -700, -560, -700, -532, -756, -588, -812);

    //left leg
    glColor3f(0.91, 0.90, 0.89); //darker light grey
    rectangle(-1316, -476, -1176, -560, -1260, -672, -1344, -644);
    rectangle(-1400, -560, -1316, -476, -1344, -644, -1400, -728);

    //right leg
    glColor3f(0.91, 0.90, 0.89); //darker light grey
    rectangle(-504, -560, -392, -476, -392, -672, -448, -728);
    rectangle(-392, -476, -140, -1008, -224, -1092, -392, -672);
    rectangle(-140, -1008, -84, -1008, -84, -1092, -224, -1092);

    //left arm
    glColor3f(0.8, 0.8, 0.8); //light grey
    rectangle(-1260, -560, -1092, -560, -1092, -700, -1176, -700);
    rectangle(-1260, -560, -1176, -700, -1288, -1176, -1372, -1092);
    rectangle(-1400, -1092, -1372, -1092, -1288, -1176, -1400, -1176);

    //right arm
    glColor3f(0.8, 0.8, 0.8); //light grey
    rectangle(-588, -560, -448, -560, -560, -700, -588, -700);
    rectangle(-560, -700, -448, -560, -392, -1092, -476, -1176);
    rectangle(-392, -1092, -336, -1092, -336, -1176, -476, -1176);
}

/*===========================
**********MOVEMENTS *********
*===========================*/

void ghost2_move()
{
    // hair
    glColor3f(0.0, 0.0, 0.0); //black
    rectangle(-280, 700, 280, 700, 280, 420, -280, 420);
    circle(-280, 560, 140);
    circle(280, 560, 140);
    triangle(-420, 560, -280, 420, -420, 420);
    triangle(280, 420, 420, 560, 420, 420);
    rectangle(-420, 420, -280, 420, -280, 140, -420, 140);
    rectangle(280, 420, 420, 420, 420, 140, 280, 140);
    rectangle(-420, 140, -280, 140, -140, 56, -420, 56);
    rectangle(280, 140, 420, 140, 420, 84, 168, 84);
    rectangle(-420, 56, -140, 56, -140, -560, -420, -560);
    rectangle(168, 84, 420, 84, 420, -560, 168, -560);

    //cloth
    glColor3f(1.0, 0.0, 0.0); //red
    rectangle(-140, 56, -28, 0, -28, -420, -140, -364);
    rectangle(-28, 0, 28, 0, 28, -420, -28, -420);
    rectangle(28, 0, 168, 84, 168, -364, 28, -420);
    triangle(-700, -28, -420, -28, -420, -280);
    triangle(420, -28, 700, -28, 420, -280);

    //face
    glColor3f(0.8, 0.8, 0.8); //light grey
    rectangle(-280, 420, 280, 420, 280, 140, -280, 140);
    rectangle(-280, 140, 280, 140, 28, 0, -28, 0);

    //eye
    glColor3f(0.0, 0.0, 0.0); //black
    circle(-140, 336, 56);
    circle(140, 336, 56);
    glColor3f(1.0, 0.0, 0.0); //red
    circle(-140, 336, 14);
    circle(140, 336, 14);

    //mouth
    glColor3f(1.0, 0.0, 0.0); //red
    triangle(-224, 196, 224, 196, 0, 28);

    //left leg
    glColor3f(0.91, 0.90, 0.89); //darker light grey
    rectangle(-924, 364, -616, 140, -700, -56, -980, 168);
    rectangle(-1400, 0, -924, 364, -980, 168, -1400, -252);
    //right leg
    rectangle(560, 140, 784, 364, 868, 168, 700, -56);
    rectangle(784, 364, 1400, 56, 1400, -196, 868, 168);

    //left arm
    glColor3f(0.8, 0.8, 0.8); //light grey
    rectangle(-840, 140, -420, 140, -420, -56, -700, -56);
    rectangle(-1232, -560, -840, 140, -700, -56, -1232, -728);
    rectangle(-1400, -560, -1232, -560, -1232, -728, -1400, -728);
    //right arm
    rectangle(420, 140, 840, 140, 700, -56, 420, -56);
    rectangle(840, 140, 1260, -644, 1260, -812, 700, -56);
    rectangle(1260, -644, 1400, -644, 1400, -812, 1260, -812);
}

/*===========================
******DISPLAY FUNCTION*******
*===========================*/

void display1() //scene 1 with the ghost in front of the car (before lightning)
{
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.12, 0.13, 0.12, 1.0); //background color - black
    glLoadIdentity();
    gluOrtho2D(-SCREEN_WIDTH, SCREEN_WIDTH, -SCREEN_HEIGHT, SCREEN_HEIGHT);

    road();
    car();
    cloud();
    ghost2();

    glutSwapBuffers();

}

void display2() //scene 2 - first lightning
{
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.12, 0.13, 0.12, 1.0); //background color - black
    glLoadIdentity();
    gluOrtho2D(-SCREEN_WIDTH, SCREEN_WIDTH, -SCREEN_HEIGHT, SCREEN_HEIGHT);

    road();
    car();
    cloud();
    ghost2();
    glColor3f(0.88, 0.90, 0.93);
    rectangle(-644, 1260, -560, 1260, -840, 616, -980, 560);

    glutSwapBuffers();

}

void display3() //scene 3 - second lightning
{
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.12, 0.13, 0.12, 1.0); //background color - black
    glLoadIdentity();
    gluOrtho2D(-SCREEN_WIDTH, SCREEN_WIDTH, -SCREEN_HEIGHT, SCREEN_HEIGHT);

    road();
    car();
    cloud();
    ghost2();
    glColor3f(0.88, 0.90, 0.93);
    rectangle(-644, 1260, -560, 1260, -840, 616, -980, 560);
    rectangle(-980, 560, -840, 616, -588, 616, -700, 560);

    glutSwapBuffers();

}

void display4() //scene 4 - third or full lightning
{
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.12, 0.13, 0.12, 1.0); //background color - black
    glLoadIdentity();
    gluOrtho2D(-SCREEN_WIDTH, SCREEN_WIDTH, -SCREEN_HEIGHT, SCREEN_HEIGHT);

    road();
    car();
    cloud();
    ghost2();
    lightning();

    glutSwapBuffers();

}

void display5() //scene 5 - lightning strike -> blinding Lily's eye
{
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.9, 0.89, 0.88, 1.0); //background color - black
    glLoadIdentity();
    gluOrtho2D(-SCREEN_WIDTH, SCREEN_WIDTH, -SCREEN_HEIGHT, SCREEN_HEIGHT);

    glColor3f(0.91, 0.96, 0.93);
    road();
    //car
    //upper car body
    glColor3f(0.85, 0.8, 0.9); //blue
    rectangle(0, 280, 1120, 280, 1400, -140, -560, -140);
    //bottom car body
    rectangle(-840, -140, 1400, -140, 1400, -700, -840, -700);
    //front- window (window 1)
    glColor3f(0.9, 0.89, 0.88); //white
    triangle(-476, -140, -28, 196, -28, -140);
    rectangle(28, 196, 560, 196, 560, -140, 28, -140);
    rectangle(644, 196, 1120, 196, 1120, -140, 644, -140);
    //wheel
    circle(-420, -798, 196); //front wheel
    circle(1036, -798, 196); // back wheel

    glColor3f(0.91, 0.96, 0.93);
    cloud();
    lightning();

    glutSwapBuffers();

}

void display6() //scene 6 - after lightning
{
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.12, 0.13, 0.12, 1.0); //background color - black
    glLoadIdentity();
    gluOrtho2D(-SCREEN_WIDTH, SCREEN_WIDTH, -SCREEN_HEIGHT, SCREEN_HEIGHT);

    road();
    car();
    cloud();

    glutSwapBuffers();

}

void display7() //last scene- ghost suddenly appeared right in front of Lily out of nowhere
{
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.12, 0.13, 0.12, 1.0); //background color - black
    glLoadIdentity();
    gluOrtho2D(-SCREEN_WIDTH, SCREEN_WIDTH, -SCREEN_HEIGHT, SCREEN_HEIGHT);

    //objects / background
    road();
    car();
    cloud();
    ghost2_move();

    glutSwapBuffers();
}

void idle() {
    DWORD start = GetTickCount64();
    while (GetTickCount64() - start < 1000 / FPS);
    x += dx;
    y += dy;
    if (x < 0 || x > SCREEN_WIDTH) dx *= -1;
    if (y < 0 || y > SCREEN_HEIGHT) dy *= -1;
    glutPostRedisplay();
}

void initGL() {
    glClearColor(0.0, 0.0, 0.0, 0.0);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluOrtho2D(0, SCREEN_WIDTH, 0, SCREEN_HEIGHT);
    glPointSize(10.0);
    glPointSize(10.0);
    glLineWidth(10.0);
}

/*===========================
***********MAIN**************
*===========================*/

int main(int argc, char** argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
    glutCreateWindow("Outside Window");
    glutDisplayFunc(display1);
    glutReshapeWindow(1200, 1000);
    //glutTimerFunc(2000, timer, 0);

    glutIdleFunc(idle);
    glutTimerFunc(1000, MyTimerFunc, 0);
    srand(1);

    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    initGL();
    glutMainLoop();
}

void MyTimerFunc(int value)
{
    if (value == 0)
    {
        glutDisplayFunc(display1);
        glutIdleFunc(display1);
        glutTimerFunc(1000, MyTimerFunc, 1);
    }

    if (value == 1)
    {
        glutDisplayFunc(display2);
        glutIdleFunc(display2);
        glutTimerFunc(1000, MyTimerFunc, 2);
    }

    if (value == 2)
    {
        glutDisplayFunc(display3);
        glutIdleFunc(display3);
        glutTimerFunc(1000, MyTimerFunc, 2);
    }

    if (value == 3)
    {
        glutDisplayFunc(display4);
        glutIdleFunc(display4);
        glutTimerFunc(1000, MyTimerFunc, 2);
    }

    if (value == 4)
    {
        glutDisplayFunc(display5);
        glutIdleFunc(display5);
        glutTimerFunc(1000, MyTimerFunc, 2);
    }

    if (value == 5)
    {
        glutDisplayFunc(display6);
        glutIdleFunc(display6);
        glutTimerFunc(1000, MyTimerFunc, 2);
    }

    if (value == 6)
    {
        glutDisplayFunc(display7);
        glutIdleFunc(display7);
        glutTimerFunc(1000, MyTimerFunc, 2);
    }

}


问:
LTI 1.3 - Access token - Error validating assertion: Unknown validation exception
I'm trying to create a lti 1.3 integration in Brightspace (POC), and I was able to get to the point where the tool endpoint is launch. At this endpoint I'm trying to get access token in order to get the membership data, so I send the request (for the access token) with the relevant scope and all the credentials with no success. I also added to the url address the relevant parameters as the documentation shows.

I think that at this point I should get the access token with no problems, because when I was trying to integrate with moodle I successfully received the access token back. I know there is a standard in all LMSs but Is there any specific adjustment to integrate with Brightspace.


问:
How to rollback changes if error into chain celery django task?
The scheme is: chain(group | result_task). How can I rollback changes in database if error?

Is it possible to use database transactions in this situation?


问:
How to optimize? HackerRank: Time limit exceeded Allowed time limit:10 secs Your code did not execute in time. When trying python
How can I optmize this interactions? I'm getting timeout on just a few test cases on HackerRank

```<code>import math
#
# Complete the 'nearlySimilarRectangles' function below.
#
# The function is expected to return a LONG_INTEGER.
# The function accepts 2D_LONG_INTEGER_ARRAY sides as parameter.
#
def nearlySimilarRectangles(sides):
    # Write your code here
    leng = len(sides)
    i = 0
    rectan = 0
    #print('Sides ' + str(sides))
    if len(sides)>10**5:
        return
    while len(sides)>0:
        i = sides[0]
        sides.remove(i)
        #print('Sides Inter ' + str(sides))
        for z in sides:
            if i[0]/z[0] == i[1]/z[1]:
                rectan = rectan +1
            print(str(i[0]) +' ' +str(z[0])+ ' '+ str(i[1]) +' ' +str(z[1]))
    print('Sum ' + str(rectan))
    return(rectan)
</code>```

And:

```<code>def mostActive(customers):
    # Write your code here
    unique=[]
    cont = []
    n = len(customers)
    for i in customers:
        if i not in unique:
            unique.append(i)
            cont.append([i,1])
        else:
            sd = unique.index(i)
            cont[sd][1]=cont[sd][1]+1

    unique.sort()
    for i in cont:
        if i[1]/n < 0.05:
            unique.remove(i[0])
    return(unique)
</code>```

Tried HackerRank test, passed 10/15, the rest were triggered due to:

Time limit exceeded
Allowed time limit:10 secs
Your code did not execute in time. Please optimize your code. For more details on runtime environment, click the “Info” button

Body:
How can I optmize this interactions? I'm getting timeout on just a few test cases on HackerRank

import math
#
# Complete the 'nearlySimilarRectangles' function below.
#
# The function is expected to return a LONG_INTEGER.
# The function accepts 2D_LONG_INTEGER_ARRAY sides as parameter.
#
def nearlySimilarRectangles(sides):
    # Write your code here
    leng = len(sides)
    i = 0
    rectan = 0
    #print('Sides ' + str(sides))
    if len(sides)>10**5:
        return
    while len(sides)>0:
        i = sides[0]
        sides.remove(i)
        #print('Sides Inter ' + str(sides))
        for z in sides:
            if i[0]/z[0] == i[1]/z[1]:
                rectan = rectan +1
            print(str(i[0]) +' ' +str(z[0])+ ' '+ str(i[1]) +' ' +str(z[1]))
    print('Sum ' + str(rectan))
    return(rectan)

And:

def mostActive(customers):
    # Write your code here
    unique=[]
    cont = []
    n = len(customers)
    for i in customers:
        if i not in unique:
            unique.append(i)
            cont.append([i,1])
        else:
            sd = unique.index(i)
            cont[sd][1]=cont[sd][1]+1

    unique.sort()
    for i in cont:
        if i[1]/n < 0.05:
            unique.remove(i[0])
    return(unique)

Tried HackerRank test, passed 10/15, the rest were triggered due to:

Time limit exceeded
Allowed time limit:10 secs
Your code did not execute in time. Please optimize your code. For more details on runtime environment, click the “Info” button


问:
openssl pkcs12 -export : unable to load private key
I'm trying to convert a .cer certificate (from Sectigo) to a .pfx, to use with an Electron App.

i'm using this command line :

```<code>openssl pkcs12 -export -inkey votre_clef_privee.key -in resultat.pem -name mon_nom -out resultat_final.pfx
</code>```

I've got this error :
unable to load Private Key
4540540588:error:0DFFF0A8:asn1 encoding routines:CRYPTO_internal:wrong

My key is with this format :

```<code>-----BEGIN NEW CERTIFICATE REQUEST-----
MIIEyTXXX...
-----END NEW CERTIFICATE REQUEST-----
</code>```

What could be the problem ?

Thank you very much for your help.

Body:
I'm trying to convert a .cer certificate (from Sectigo) to a .pfx, to use with an Electron App.

i'm using this command line :

openssl pkcs12 -export -inkey votre_clef_privee.key -in resultat.pem -name mon_nom -out resultat_final.pfx

I've got this error :
unable to load Private Key
4540540588:error:0DFFF0A8:asn1 encoding routines:CRYPTO_internal:wrong

My key is with this format :

-----BEGIN NEW CERTIFICATE REQUEST-----
MIIEyTXXX...
-----END NEW CERTIFICATE REQUEST-----

What could be the problem ?

Thank you very much for your help.


问:
Adding CSS pseudo elements to reorder CSS elements
Using a mobile theme optimized from AMP, I need to add custom CSS to a theme to display a custom banner in a different position. For the purposes of this post, the banner is already in place using:

```<code><div class="td-a-rec td-a-rec-id-header_mob "><div class="td-all-devices">
</code>```

What I would like to do is place this below the elements with class:

```<code><div class="td_module_mob_2 td_module_wrap td-animation-stack ">
</code>```

But above the elements with class:

```<code><div class="td-container td-pb-article-list td-main-content" role="main">
</code>```

The ad needs rendering above the 'LATEST ARTICLES' block title, WITHOUT the ad being displayed in its current position. For a clearer picture of the amp version and CSS modification required see here TBM.

I've tried a few custom CSS snippets using freecodecamp.org/news/css-pseudo-elements-before-and-after-selectors-explained/, but it doesn't appear to be working, since the ad is rendered dynamically using current entries in the theme panel will this be possible, as per the link above the following is currently being rendered:

```<code><div class="td-a-rec td-a-rec-id-header_mob ">
  <div class="td-all-devices">
    <a href="https://inplayguru.com?r=31289" target="_blank">
      <amp-anim src="https://thebetmatrix.win/wp-content/uploads/2022/12/InPlayGuru-Design1-LM-320x100-1.gif" width="320" height="100" alt="InPlay Guru - Inplay Football Stats Scanner" class="amp-wp-enforced-sizes amp-wp-31d994b i-amphtml-layout-intrinsic i-amphtml-layout-size-defined" layout="intrinsic" data-amp-original-style="border:15px" i-amphtml-layout="intrinsic">
        <i-amphtml-sizer slot="i-amphtml-svc" class="i-amphtml-sizer">
          <img alt="" aria-hidden="true" class="i-amphtml-intrinsic-sizer" role="presentation" src="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEwMCIgd2lkdGg9IjMyMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=">
        </i-amphtml-sizer><noscript>
        <img src="https://thebetmatrix.win/wp-content/uploads/2022/12/InPlayGuru-Design1-LM-320x100-1.gif.pagespeed.ce.WeGzAscmrw.gif" width="320" height="100" alt="InPlay Guru - Inplay Football Stats Scanner">
        </noscript>
      </amp-anim>
    </a>
  </div>
</div>
</code>```

Thanks

Pseudo elements selectors, requiring as detailed in the post, but expected template output isn't as desired and requires some additional CSS input to render the ad in the position detailed above.

Body:
Using a mobile theme optimized from AMP, I need to add custom CSS to a theme to display a custom banner in a different position. For the purposes of this post, the banner is already in place using:

What I would like to do is place this below the elements with class:

But above the elements with class:

The ad needs rendering above the 'LATEST ARTICLES' block title, WITHOUT the ad being displayed in its current position. For a clearer picture of the amp version and CSS modification required see here TBM.

I've tried a few custom CSS snippets using freecodecamp.org/news/css-pseudo-elements-before-and-after-selectors-explained/, but it doesn't appear to be working, since the ad is rendered dynamically using current entries in the theme panel will this be possible, as per the link above the following is currently being rendered:

      <amp-anim src="https://thebetmatrix.win/wp-content/uploads/2022/12/InPlayGuru-Design1-LM-320x100-1.gif" width="320" height="100" alt="InPlay Guru - Inplay Football Stats Scanner" class="amp-wp-enforced-sizes amp-wp-31d994b i-amphtml-layout-intrinsic i-amphtml-layout-size-defined" layout="intrinsic" data-amp-original-style="border:15px" i-amphtml-layout="intrinsic">

      </amp-anim>

Thanks

Pseudo elements selectors, requiring as detailed in the post, but expected template output isn't as desired and requires some additional CSS input to render the ad in the position detailed above.


问:
Is it possible to add linter for Google Chrome extension project?
I would like to add a linter for an existing Google Chrome extension project, is there any chance to add a linter for this kind of project?

Instead of package.json I have manifest.json, so when I run npm init @eslint/config, I have an error saying I need to have package.json.


问:
Host ping failed Virt-Management failed to get a response
I installed ubuntu-server in Virt-Management.

I cannot get a response using the following command

ubuntu-server ip: 10.0.2.15

my host ip :  192.168.124.10

```<code>ping 10.0.2.15
PING 10.0.2.15 (10.0.2.15) 56(84) 字节的数据。

</code>```

But ubuntu can get a response

Please see the picture below

Body:
I installed ubuntu-server in Virt-Management.

I cannot get a response using the following command

ubuntu-server ip: 10.0.2.15

my host ip :  192.168.124.10

ping 10.0.2.15
PING 10.0.2.15 (10.0.2.15) 56(84) 字节的数据。

But ubuntu can get a response

Please see the picture below


问:
postman ECONNRESET error with async method (even though I have my return model)
```<code>public async Task<BillerResp> BillerRespAsync(BillerReq data)
{
    string sessionID = await sp.GetUserSessionID(\*\*\*\*\*"*", "**", "***\*");

    BillerResp resp = new BillerResp();
    Connectpr connector = sp[sessionID];
    BillDetails bill = await connector.GetBill(data.acNumber, data.billerId);

    if (bill != null)
    {
        resp.name = bill.BillerName;
        resp.accountNumber = bill.accountNumber;
        resp.currency = bill.currency;
        resp.balanceAmount = (int)bill.balanceAmount;
    }
    else
    {
        resp.ErrorCode = -1;
        resp.ErrorMsg = "Bill not found.";
    }
    return resp;
}
</code>```

When I send a request from postman, I get ECONNRESET error from postman, even though my return model is filled in VS.
I wonder if is caused by async method?

SSL is disabled, I have tried to disable request header connection keep-alive, I've reboot IIS and several things but it didnt work.

```<code>Request Headers
Content-Type: application/json
User-Agent: PostmanRuntime/7.29.2
Accept: */*
Postman-Token: de07373f-b339-41f7-9ae7-649591bb32ed
Host: localhost:44327
Accept-Encoding: gzip, deflate, br

{
    "data":{
     "prijava": "*******",
        "signature": "*******",
        "acNumber":"*******",
        "billerId":"*******"
    }
}
</code>```

my request data is above

Body:
public async Task<BillerResp> BillerRespAsync(BillerReq data)
{
    string sessionID = await sp.GetUserSessionID(\*\*\*\*\*"*", "**", "***\*");

    BillerResp resp = new BillerResp();
    Connectpr connector = sp[sessionID];
    BillDetails bill = await connector.GetBill(data.acNumber, data.billerId);

    if (bill != null)
    {
        resp.name = bill.BillerName;
        resp.accountNumber = bill.accountNumber;
        resp.currency = bill.currency;
        resp.balanceAmount = (int)bill.balanceAmount;
    }
    else
    {
        resp.ErrorCode = -1;
        resp.ErrorMsg = "Bill not found.";
    }
    return resp;
}

When I send a request from postman, I get ECONNRESET error from postman, even though my return model is filled in VS.
I wonder if is caused by async method?

SSL is disabled, I have tried to disable request header connection keep-alive, I've reboot IIS and several things but it didnt work.

Request Headers
Content-Type: application/json
User-Agent: PostmanRuntime/7.29.2
Accept: */*
Postman-Token: de07373f-b339-41f7-9ae7-649591bb32ed
Host: localhost:44327
Accept-Encoding: gzip, deflate, br

{
    "data":{
     "prijava": "*******",
        "signature": "*******",
        "acNumber":"*******",
        "billerId":"*******"
    }
}

my request data is above


问:
Float values are sometimes altered
When I insert the 667289685 value in a float32 field, ClickHouse round it to 667289660. Why does ClickHouse do that?

My example table

CREATE TABLE mytable (id Int32, valor Float32)
ENGINE = MergeTree PRIMARY KEY (id)
```
<p>Insert</p>
```INSERT INTO mytable values (1, 667289685)
```
<p>Query</p>
```SELECT * FROM mytable
```

The result

id
valor

1
667289660

I am using the HTTP API to insert the records.

Title: Float values are sometimes altered

Body:
When I insert the 667289685 value in a float32 field, ClickHouse round it to 667289660. Why does ClickHouse do that?

My example table

CREATE TABLE mytable (id Int32, valor Float32)
ENGINE = MergeTree PRIMARY KEY (id)

Insert

INSERT INTO mytable values (1, 667289685)

Query

SELECT * FROM mytable

The result

id
valor

1
667289660

I am using the HTTP API to insert the records.


问:
VBA Code to copy and paste(add) cells values to the row above and below IF weekend day
Example table

My story is:

I open the file attached as png here

Conditional formatting already automatically formats weekend days to blue color

Where the weekend days are, I need the VBA macro to copy the values from each Saturday (separately) and paste(add) them to the day before (Friday); I want the macro to copy the values from each Sunday (separately) and paste(add) to the next day (Monday); I want the code to delete the values from Saturday and Sunday once previous copy/paste action are completed.

Relevantly for each country column to happen.
NOTE: weekend days will change from month to month, so vba macro should be universal.

Tried formulas with loops in the code, but unfortunately cannot get what i want.


问:
No adapter attached; skipping layout with Fragments and Compose
In my project I use Compose in Fragments.

My FirstScreenFragment:

```<code>class FirstScreenFragment : Fragment() {
    @SuppressLint("InflateParams")
    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
    ): View {
        val viewPager = activity?.findViewById<ViewPager2>(R.id.viewPager)
        return ComposeView(requireContext()).apply {
            setContent {
                OnBoardingPage(
                    viewPager = viewPager,
                    backgroundColor = R.color.light_green,
                    fragmentPicture = R.drawable.first_fragment_picture,
                    title = "Fitness Client Tracker",
                    textContent = "Welcome",
                    currentPage = 1
                )
            }
        }
    }
}
</code>```

I got error:

E/RecyclerView: No adapter attached; skipping layout

And after second fragment:

W/ssclienttracke: Class
androidx.compose.runtime.snapshots.SnapshotStateList failed lock
verification and will run slower.
Common causes for lock verification issues are non-optimized dex code
and incorrect proguard optimizations.

I don't see any fragments skipped but why is this happening?

EDIT:
ViewPagerFragment:

```<code>return ComposeView(requireContext()).apply {
    setContent {
        val fragmentList = arrayListOf(
            FirstScreenFragment(),
            SecondScreenFragment(),
            ThirdScreenFragment()
        )
        val adapter = ViewPagerAdapter(
            fragmentList,
            requireActivity().supportFragmentManager,
            lifecycle
        )
        AndroidView(factory = { context ->
            val view = LayoutInflater.from(context)
                .inflate(R.layout.fragment_view_pager, null, false)
            val viewPager = view.findViewById<ViewPager2>(R.id.viewPager)
            viewPager.adapter = adapter
            view
        })
    }
}
</code>```

ViewPagerAdapter:

```<code>class ViewPagerAdapter(
    list: ArrayList<Fragment>,
    fm: FragmentManager,
    lifecycle: Lifecycle
) :
    FragmentStateAdapter(fm, lifecycle) {
    private val fragmentList = list
    override fun getItemCount(): Int {
        return fragmentList.size
    }

    override fun createFragment(position: Int): Fragment {
        return fragmentList[position]
    }
}
</code>```

Still didn't find the right solution, so if u know write it.

Body:
In my project I use Compose in Fragments.

My FirstScreenFragment:

class FirstScreenFragment : Fragment() {
    @SuppressLint("InflateParams")
    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
    ): View {
        val viewPager = activity?.findViewById<ViewPager2>(R.id.viewPager)
        return ComposeView(requireContext()).apply {
            setContent {
                OnBoardingPage(
                    viewPager = viewPager,
                    backgroundColor = R.color.light_green,
                    fragmentPicture = R.drawable.first_fragment_picture,
                    title = "Fitness Client Tracker",
                    textContent = "Welcome",
                    currentPage = 1
                )
            }
        }
    }
}

I got error:

E/RecyclerView: No adapter attached; skipping layout

And after second fragment:

W/ssclienttracke: Class
androidx.compose.runtime.snapshots.SnapshotStateList failed lock
verification and will run slower.
Common causes for lock verification issues are non-optimized dex code
and incorrect proguard optimizations.

I don't see any fragments skipped but why is this happening?

EDIT:
ViewPagerFragment:

return ComposeView(requireContext()).apply {
    setContent {
        val fragmentList = arrayListOf(
            FirstScreenFragment(),
            SecondScreenFragment(),
            ThirdScreenFragment()
        )
        val adapter = ViewPagerAdapter(
            fragmentList,
            requireActivity().supportFragmentManager,
            lifecycle
        )
        AndroidView(factory = { context ->
            val view = LayoutInflater.from(context)
                .inflate(R.layout.fragment_view_pager, null, false)
            val viewPager = view.findViewById<ViewPager2>(R.id.viewPager)
            viewPager.adapter = adapter
            view
        })
    }
}

ViewPagerAdapter:

class ViewPagerAdapter(
    list: ArrayList<Fragment>,
    fm: FragmentManager,
    lifecycle: Lifecycle
) :
    FragmentStateAdapter(fm, lifecycle) {
    private val fragmentList = list
    override fun getItemCount(): Int {
        return fragmentList.size
    }

    override fun createFragment(position: Int): Fragment {
        return fragmentList[position]
    }
}

Still didn't find the right solution, so if u know write it.


问:
ABAP: how to compare three internal tables
I've recently started an apprenticeship and I've received a small project to help checking tables.

The request is that I am supposed to write a report that compares a table to our profit center's standard hierarchy and tells you which entries are the same and which ones are not.

Now, I've only started getting into ABAP and while I've had SQL prior, i'm not exactly good in it. My colleagues are nice but I fear that I'd look like an idiot if I kept asking them how to do this.

What i've done so far is giving the table some records to check in our development system, selecting all records in it and also selecting everything I need from SETLEAF and SETNODE.

```<code>
SELECT * FROM Y_TABLE
  INTO TABLE @DATA(lt_compare).

SELECTION-SCREEN BEGIN OF BLOCK set_leaf.
  CONSTANTS:
            SET_CLASS TYPE SETLEAF-SETCLASS VALUE '0102',
            SUB_CLASS TYPE SETLEAF-SUBCLASS VALUE 'D100'.
  PARAMETERS:
   lv_pcnr TYPE SETLEAF-VALFROM,
   setname TYPE SETLEAF-SETNAME.

SELECTION-SCREEN END OF BLOCK set_leaf.

TYPES:
BEGIN OF lt_ausgabe,
  SETCLASS TYPE SETLEAF-SETCLASS,
  SUBCLASS TYPE SETLEAF-SUBCLASS,
  VALFROM TYPE SETLEAF-VALFROM,
  SETNAME TYPE SETLEAF-SETNAME,
  END OF lt_ausgabe.

DATA:
      gt_setleaf TYPE STANDARD TABLE OF lt_ausgabe,
      gt_setnode TYPE STANDARD TABLE OF lt_ausgabe.

SETNODE-SUBSETNAME = SETLEAF-SETNAME.
SETNODE-SETNAME = SETNODE-SUBSETNAME.

FORM build_table_setleaf.
  SELECT *
  FROM SETLEAF
  INTO CORRESPONDING FIELDS OF TABLE @gt_setleaf
    WHERE SETCLASS = @set_class AND SUBCLASS = @sub_class AND VALFROM = @lv_pcnr AND SETNAME = @setname.
ENDFORM.

FORM build_table_setnode.
  SELECT *
  FROM SETNODE
  INTO CORRESPONDING FIELDS OF TABLE @gt_setnode
    WHERE SETCLASS = @set_class AND SUBCLASS = @sub_class AND SUBSETNAME = @setname.
ENDFORM.
</code>```

I've changed the table name and the constant values because I don't know how much of them I can share.
Now I want to compare these tables and well, do what the request asked for. But I don't really understand how to do this. The code above may not be the way to solve this at all..

I'm sorry in advance if any of this sounds off, I would ask in my own language if.. my people weren't known for being unhelpful and rude when asking code-related stuff.
Thank you in advance.

```<code></code>```

Body:
I've recently started an apprenticeship and I've received a small project to help checking tables.

The request is that I am supposed to write a report that compares a table to our profit center's standard hierarchy and tells you which entries are the same and which ones are not.

Now, I've only started getting into ABAP and while I've had SQL prior, i'm not exactly good in it. My colleagues are nice but I fear that I'd look like an idiot if I kept asking them how to do this.

What i've done so far is giving the table some records to check in our development system, selecting all records in it and also selecting everything I need from SETLEAF and SETNODE.

SELECT * FROM Y_TABLE
  INTO TABLE @DATA(lt_compare).

SELECTION-SCREEN BEGIN OF BLOCK set_leaf.
  CONSTANTS:
            SET_CLASS TYPE SETLEAF-SETCLASS VALUE '0102',
            SUB_CLASS TYPE SETLEAF-SUBCLASS VALUE 'D100'.
  PARAMETERS:
   lv_pcnr TYPE SETLEAF-VALFROM,
   setname TYPE SETLEAF-SETNAME.

SELECTION-SCREEN END OF BLOCK set_leaf.

TYPES:
BEGIN OF lt_ausgabe,
  SETCLASS TYPE SETLEAF-SETCLASS,
  SUBCLASS TYPE SETLEAF-SUBCLASS,
  VALFROM TYPE SETLEAF-VALFROM,
  SETNAME TYPE SETLEAF-SETNAME,
  END OF lt_ausgabe.

DATA:
      gt_setleaf TYPE STANDARD TABLE OF lt_ausgabe,
      gt_setnode TYPE STANDARD TABLE OF lt_ausgabe.

SETNODE-SUBSETNAME = SETLEAF-SETNAME.
SETNODE-SETNAME = SETNODE-SUBSETNAME.

FORM build_table_setleaf.
  SELECT *
  FROM SETLEAF
  INTO CORRESPONDING FIELDS OF TABLE @gt_setleaf
    WHERE SETCLASS = @set_class AND SUBCLASS = @sub_class AND VALFROM = @lv_pcnr AND SETNAME = @setname.
ENDFORM.

FORM build_table_setnode.
  SELECT *
  FROM SETNODE
  INTO CORRESPONDING FIELDS OF TABLE @gt_setnode
    WHERE SETCLASS = @set_class AND SUBCLASS = @sub_class AND SUBSETNAME = @setname.
ENDFORM.

I've changed the table name and the constant values because I don't know how much of them I can share.
Now I want to compare these tables and well, do what the request asked for. But I don't really understand how to do this. The code above may not be the way to solve this at all..

I'm sorry in advance if any of this sounds off, I would ask in my own language if.. my people weren't known for being unhelpful and rude when asking code-related stuff.
Thank you in advance.


问:
System.Web.Security.Membership increase Command Timeout to Membership DB
I work on a legacy application that uses the System.Web.Security.Membership methods from C# to maintain its users.

Bad system design causes a huge number of reads and updates in the Membership database.

Occasionally new users are being created in the Membership DB without a Role.
The error that manifests is the same as we've seen previously due to timeouts in our main app DB.

The SQL Server is set to 10 mins.
We've managed to increase the Entity Framework command timeout.

But is there any way to increase the Command Timeout of System.Web.Security.Membership?

Any leads would be much appreciated.


问:
Is it possible to render class with list in single pass?
I am using the mustache templates package and I'm trying to render the following templates

```<code>import 'package:level_generator/level.dart';
import 'package:mustache_template/mustache_template.dart';

class LevelGenerator {
  final Level _level;

  LevelGenerator({
    required Level level,
  }) : _level = level;

  String render() {
    return _renderPickupGroups();
  }

  String _renderPickupGroups() {
    final source = '''
    final groups = [
      {{# pickupGroups}}
      PickupGroup(
        weight: {{ weight }},
        pickups: [
          {{ pickups }}
        ],
      ),
      {{/ pickupGroups}}
    ];
      ''';

    var template = Template(source, name: 'pickup_groups');

    return template.renderString(
      {
        'pickupGroups': _level.pickupGroups.map((e) {
          return {
            'weight': e.weight,
            'pickups': _renderPickups(
              pickups: e.pickups,
            ),
          };
        }).toList(growable: false),
      },
    );
  }

  String _renderPickups({
    required List<Pickup> pickups,
  }) {
    final source = '''
     {{# pickups}}
      Pickup(
        id: {{ id }},
        position: Vector2(
          {{ positionX }},
          {{ positionY }},
        ),
      ),
      {{/ pickups}}
    ''';

    var template = Template(source, name: 'pickups');
    return template.renderString({
      'pickups': pickups.map((e) {
        return {
          'id': e.id,
          'positionX': e.position.x,
          'positionY': e.position.y,
        };
      }).toList(growable: false)
    });
  }
}
</code>```

But I noticed that doing this in multiple passes causes indenting issues in the output string. This mainly causes issues with the tests I'm running. And I don't want to create a file each time I run a test just so I can use the dart formatter.

Is there a way I can do this in one pass? I looked at the documentation but I don't think I can use Lambda since I need to know what iteration of the loop I'm in.

Body:
I am using the mustache templates package and I'm trying to render the following templates

import 'package:level_generator/level.dart';
import 'package:mustache_template/mustache_template.dart';

class LevelGenerator {
  final Level _level;

  LevelGenerator({
    required Level level,
  }) : _level = level;

  String render() {
    return _renderPickupGroups();
  }

  String _renderPickupGroups() {
    final source = '''
    final groups = [
      {{# pickupGroups}}
      PickupGroup(
        weight: {{ weight }},
        pickups: [
          {{ pickups }}
        ],
      ),
      {{/ pickupGroups}}
    ];
      ''';

    var template = Template(source, name: 'pickup_groups');

    return template.renderString(
      {
        'pickupGroups': _level.pickupGroups.map((e) {
          return {
            'weight': e.weight,
            'pickups': _renderPickups(
              pickups: e.pickups,
            ),
          };
        }).toList(growable: false),
      },
    );
  }

  String _renderPickups({
    required List<Pickup> pickups,
  }) {
    final source = '''
     {{# pickups}}
      Pickup(
        id: {{ id }},
        position: Vector2(
          {{ positionX }},
          {{ positionY }},
        ),
      ),
      {{/ pickups}}
    ''';

    var template = Template(source, name: 'pickups');
    return template.renderString({
      'pickups': pickups.map((e) {
        return {
          'id': e.id,
          'positionX': e.position.x,
          'positionY': e.position.y,
        };
      }).toList(growable: false)
    });
  }
}

But I noticed that doing this in multiple passes causes indenting issues in the output string. This mainly causes issues with the tests I'm running. And I don't want to create a file each time I run a test just so I can use the dart formatter.

Is there a way I can do this in one pass? I looked at the documentation but I don't think I can use Lambda since I need to know what iteration of the loop I'm in.


问:
Why global has type "typeof globalThis" in TypeScript?
We access different global objects depending on the runtime environment.

window - for the browser

global - for nodeJs

globalThis - for all environments

But for some reason typescript defines global as typeof globalThis.
So I can write

```<code>global.localStorage
</code>```

and not get typescript error.

It looks weird, why was it done that way?

Body:
We access different global objects depending on the runtime environment.

window - for the browser

global - for nodeJs

globalThis - for all environments

But for some reason typescript defines global as typeof globalThis.
So I can write

global.localStorage

and not get typescript error.

It looks weird, why was it done that way?


问:
Error 400: INVALID SCOPE: Chronicle Security Seach APi
I'm trying to integrate Chronicle Security with salesforce. I'm using 'OAUTH 2.0 CLIENT Id' authorization method to generate credential. But upon adding the scope provided in the chronicle Api documentation, it is showing error 400 [INVALID Scope]. Chronicle API is already enabled and the scope which is given in the documentation is not listed in the search section of add/remove scopes.

Here is the documentation link - https://cloud.google.com/chronicle/docs/reference/search-api

Here is the Scope provided in the documentation- https://www.googleapis.com/auth/chronicle-backstory

Please refer the image given for more clarity.

enter image description here

Any help is highly appreciated.


问:
xampp fails to start with 'unsupported HTTP response code'
I was setting up my xampp server, specifically the ErrorDocuments

the configuration is as follows ("private information will be marked out)

```<code><VirtualHost 127.0.0.1:80>
 ServerAdmin ****@****.com
 DocumentRoot "D:/xampp/****"
 ServerName int.****.com
 ServerAlias int.****.com
 ErrorLog "logs/int.****.com-error.log"
 CustomLog "logs/int.****.com-access.log" common
 <Directory "D:/xampp/****">
  Options FollowSymLinks
  AllowOverride none
  Order deny,allow
  Allow from All
  ErrorDocument 403 "error/403.php"
  ErrorDocument 404 "error/404.php"
  ErrorDocument 518 "error/518.php" # This code is unsupported, and not in official use (I'm intending for it to be returned when a database returns an unexpected result)
 </Directory>
</VirtualHost>
</code>```

Is there a way to get xampp to ignore the "unsupported" nature of the code, or am I limited to repurposing a different unrelated code?

Body:
I was setting up my xampp server, specifically the ErrorDocuments

the configuration is as follows ("private information will be marked out)

<VirtualHost 127.0.0.1:80>
 ServerAdmin ****@****.com
 DocumentRoot "D:/xampp/****"
 ServerName int.****.com
 ServerAlias int.****.com
 ErrorLog "logs/int.****.com-error.log"
 CustomLog "logs/int.****.com-access.log" common
 <Directory "D:/xampp/****">
  Options FollowSymLinks
  AllowOverride none
  Order deny,allow
  Allow from All
  ErrorDocument 403 "error/403.php"
  ErrorDocument 404 "error/404.php"
  ErrorDocument 518 "error/518.php" # This code is unsupported, and not in official use (I'm intending for it to be returned when a database returns an unexpected result)
 </Directory>
</VirtualHost>

Is there a way to get xampp to ignore the "unsupported" nature of the code, or am I limited to repurposing a different unrelated code?