问:
How should I resolve this: "Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))"
I got this error when I open a software on my computer.

```<code>Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

Details:
   at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
   at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
   at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
   at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
   at System.Windows.Forms.AxHost.CreateInstance()
   at System.Windows.Forms.AxHost.GetOcxCreate()
   at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
   at System.Windows.Forms.AxHost.CreateHandle()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.AxHost.EndInit()
   at VirtualMux.Form1.InitializeComponent()
   at VirtualMux.Form1..ctor(Boolean b_isMinimized)
   at VirtualMux.Program.Main(String[] args)
</code>```

I already tried various methods but haven't found a working solution. Please help how can I resolve this?

Tried on different desktops and laptops, reset my default apps, register dll from Component Services

Body:
I got this error when I open a software on my computer.

Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

Details:
   at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
   at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
   at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
   at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
   at System.Windows.Forms.AxHost.CreateInstance()
   at System.Windows.Forms.AxHost.GetOcxCreate()
   at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
   at System.Windows.Forms.AxHost.CreateHandle()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.AxHost.EndInit()
   at VirtualMux.Form1.InitializeComponent()
   at VirtualMux.Form1..ctor(Boolean b_isMinimized)
   at VirtualMux.Program.Main(String[] args)

I already tried various methods but haven't found a working solution. Please help how can I resolve this?

Tried on different desktops and laptops, reset my default apps, register dll from Component Services


来源: stackexchange

问:
I tried to download the file with Spring boot and React
When React sends data, I tried to make a code to read and download files based on the data, but an error occurred.

Code for sending data from react.

It was created to render the object list containing the path to download, and it worked normally.

```<code>function MyComponent(props) {
    return (
      <div style={{ display: "flex", flexWrap: "wrap" }}>
        {selectFileList.map((object) => (
          <div key={object.index} className={classes.fileDown}>
            <label htmlFor="file_down" className={classes.fileLabel}>
              <FileDownloadIcon />
              <div className={classes.fileDownSmall}>
                <a
                  id="file_down"
                  style={{
                    fontSize: "20px",
                    textDecoration: "none",
                    color: "white",
                  }}
                  onClick={() =>
                    fileDownload(object.bd_file_path, object.bd_file_nm)
                  }
                >
                  {object.bd_file_nm}
                </a>
              </div>
            </label>
          </div>
        ))}
      </div>
    );
  }
</code>```

I confirmed that all the data are normally included.

```<code>const fileDownload = async (path, name) => {
    const sendData = {
      file_path: path,
      file_nm: name,
    };
    await dispatch(fileAction.fileDownload(sendData))
      .then((response) => response.blob())
      .then((blob) => {
        const url = window.URL.createObjectURL(new Blob([blob]));
        const link = document.createElement("a");
        link.href = url;
        link.setAttribute("download", name);
        document.body.appendChild(link);
        link.click();
        link.parentNode.removeChild(link);
      });
  };
</code>```

This is the code of Spring Boot that reads the file through the path and sends the data.

```<code>    @PostMapping("/fileDownload")
    public void fileDownload(@RequestBody BoardFileDTO dto ,HttpServletResponse response) throws Exception {
        Path path = Paths.get(dto.getFile_path()).toAbsolutePath();
        File file = path.toFile();
        response.addHeader("Content-Type", Files.probeContentType(path));
        response.addHeader("Content-Disposition", "attachment; filename=" + dto.getFile_nm());

        InputStream inputStream = new FileInputStream(file);
        StreamUtils.copy(inputStream, response.getOutputStream());
        response.flushBuffer();
    }
</code>```

Uncaught (in promise) TypeError: response.blob is not a function

This error has occurred

There was no error in SpringBoot, and it was not possible to verify that the data was successful.

I'm using a translator, so the way I talk may be awkward.

Where did it go wrong? Was it a problem with the repetitive rendering? At least it didn't happen there, but I don't know where it started.

ContentLicense: CC BY-SA 4.0

Body:
When React sends data, I tried to make a code to read and download files based on the data, but an error occurred.

Code for sending data from react.

It was created to render the object list containing the path to download, and it worked normally.

function MyComponent(props) {
    return (

        {selectFileList.map((object) => (

              <FileDownloadIcon />

                    fileDownload(object.bd_file_path, object.bd_file_nm)
                  }
                >
                  {object.bd_file_nm}

        ))}

    );
  }

I confirmed that all the data are normally included.

const fileDownload = async (path, name) => {
    const sendData = {
      file_path: path,
      file_nm: name,
    };
    await dispatch(fileAction.fileDownload(sendData))
      .then((response) => response.blob())
      .then((blob) => {
        const url = window.URL.createObjectURL(new Blob([blob]));
        const link = document.createElement("a");
        link.href = url;
        link.setAttribute("download", name);
        document.body.appendChild(link);
        link.click();
        link.parentNode.removeChild(link);
      });
  };

This is the code of Spring Boot that reads the file through the path and sends the data.

    @PostMapping("/fileDownload")
    public void fileDownload(@RequestBody BoardFileDTO dto ,HttpServletResponse response) throws Exception {
        Path path = Paths.get(dto.getFile_path()).toAbsolutePath();
        File file = path.toFile();
        response.addHeader("Content-Type", Files.probeContentType(path));
        response.addHeader("Content-Disposition", "attachment; filename=" + dto.getFile_nm());

        InputStream inputStream = new FileInputStream(file);
        StreamUtils.copy(inputStream, response.getOutputStream());
        response.flushBuffer();
    }

Uncaught (in promise) TypeError: response.blob is not a function

This error has occurred

There was no error in SpringBoot, and it was not possible to verify that the data was successful.

I'm using a translator, so the way I talk may be awkward.

Where did it go wrong? Was it a problem with the repetitive rendering? At least it didn't happen there, but I don't know where it started.


问:
Sonar multi language project with non compiled code
I'm trying to setup a sonar scan for a project. This projects uses a free framework (Apache OFBiz) which is a multi language framework (java, JavaScript, xml, groovy, freemarker)
It is also a multi module projects with several subprojects.
I used the gradle sonar task with a local setup and sonarqube.

```<code>// build.gradle
sonar {
    properties {
        property "sonar.exclusions", "**/bin/**, **/org/apache/**"
        property "sonar.test.exclusions", "**/src/test/**"
        property "sonar.scm.disabled", true
    }
}

subprojects {
    apply plugin: 'org.sonarqube'
    sonar {
        skipProject = false
        properties {
            property "sonar.inclusions", "**/src/**"
        }
    }
}
</code>```

Sonaqube gradle plugin is used in the version 3.5.0.2730 and i have the groovy plugin locally installed and running.
Sonarqube locally is version 9.7

So far, I've managed to run a Java scan that suits me in terms of coverage (ignore standard framework and scan client specific java code).
There is also some groovy analysis, but only in the compiled code.

What I would like to do is the following:

I would like to know if it is possible to scan non-compiled groovy code (that uses domain specific syntax)

I couldn't find any topic relevant to that question

I would like to know if it is possible to scan all the languages in the project, and if so, what would be the best way to do it? In a single run? one run per language?

I managed to find some topics, but nothing that is less than one or two years old.

Body:
I'm trying to setup a sonar scan for a project. This projects uses a free framework (Apache OFBiz) which is a multi language framework (java, JavaScript, xml, groovy, freemarker)
It is also a multi module projects with several subprojects.
I used the gradle sonar task with a local setup and sonarqube.

// build.gradle
sonar {
    properties {
        property "sonar.exclusions", "**/bin/**, **/org/apache/**"
        property "sonar.test.exclusions", "**/src/test/**"
        property "sonar.scm.disabled", true
    }
}

subprojects {
    apply plugin: 'org.sonarqube'
    sonar {
        skipProject = false
        properties {
            property "sonar.inclusions", "**/src/**"
        }
    }
}

Sonaqube gradle plugin is used in the version 3.5.0.2730 and i have the groovy plugin locally installed and running.
Sonarqube locally is version 9.7

So far, I've managed to run a Java scan that suits me in terms of coverage (ignore standard framework and scan client specific java code).
There is also some groovy analysis, but only in the compiled code.

What I would like to do is the following:

I would like to know if it is possible to scan non-compiled groovy code (that uses domain specific syntax)

I couldn't find any topic relevant to that question

I would like to know if it is possible to scan all the languages in the project, and if so, what would be the best way to do it? In a single run? one run per language?

I managed to find some topics, but nothing that is less than one or two years old.


问:
How to install Java in Dockerfile
I tried to install java in dockerfile with reference image centos:latest but getting an error:

```<code>Step 1/11 : FROM centos:latest
 ---> 5d0da3dc9764
Step 2/11 : RUN yum -y update
 ---> Running in 597c6b6cf3f4
CentOS Linux 8 - AppStream                      963  B/s |  38  B     00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
The command '/bin/sh -c yum -y update' returned a non-zero code: 1
</code>```

Title: How to install Java in Dockerfile

Body:
I tried to install java in dockerfile with reference image centos:latest but getting an error:

Step 1/11 : FROM centos:latest
 ---> 5d0da3dc9764
Step 2/11 : RUN yum -y update
 ---> Running in 597c6b6cf3f4
CentOS Linux 8 - AppStream                      963  B/s |  38  B     00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
The command '/bin/sh -c yum -y update' returned a non-zero code: 1


问:
In angular, when a page is opened in edit mode using query params, value in dropdown is not coming in mat select
customer_name is not displayed in dropdown.

In .ts file, in ngOnInit() I have used query params to open a page in edit mode.

```<code>ngOnInit(): void {
    this.addInvoiceItem();
    this.route.queryParams.subscribe((params) => {
      if (params._id === undefined) {
        this.isEdit = true;
        console.log(this.isEdit);
      } else {
        this._id = params._id;
        this.service.fetchInvoiceById(this._id).subscribe((data) => {
          this.invoice = data;
          console.log(this.invoice.customer_details);

          this.customerService
            .fetchCustomerById(this.invoice.customer_details)
            .subscribe((data) => {
              this.invoice.customer_details = data;
              console.log(this.invoice.customer_details);
            });
        });
      }
      this.customerService.fetchAllCustomers().subscribe((data) => {
        this.custList = data;
        console.table(this.custList);
      });
      this.availService.fetchAllCustomers().subscribe((data) => {
        this.servicesList = data;
        console.table(this.servicesList);
      });
    });
  }
</code>```

In console.log(this.invoice.customer_details) I can see customer_name in debug. But in display customer_name is not coming.

In html file,

```<code>            <mat-select
              name="customer_details"
              [(ngModel)]="invoice.customer_details"
              #customer_details="ngModel"
              (selectionChange)="updateAddress()"
              required
              [displayWith]="displayCustomer"
            >
              <mat-option
                *ngFor="let cust of custList"
                [value]="cust"
                required
              >
                {{ cust.customer_name }}
              </mat-option>
            </mat-select>
</code>```
```<code>
</code>```

Body:
customer_name is not displayed in dropdown.

In .ts file, in ngOnInit() I have used query params to open a page in edit mode.

ngOnInit(): void {
    this.addInvoiceItem();
    this.route.queryParams.subscribe((params) => {
      if (params._id === undefined) {
        this.isEdit = true;
        console.log(this.isEdit);
      } else {
        this._id = params._id;
        this.service.fetchInvoiceById(this._id).subscribe((data) => {
          this.invoice = data;
          console.log(this.invoice.customer_details);

          this.customerService
            .fetchCustomerById(this.invoice.customer_details)
            .subscribe((data) => {
              this.invoice.customer_details = data;
              console.log(this.invoice.customer_details);
            });
        });
      }
      this.customerService.fetchAllCustomers().subscribe((data) => {
        this.custList = data;
        console.table(this.custList);
      });
      this.availService.fetchAllCustomers().subscribe((data) => {
        this.servicesList = data;
        console.table(this.servicesList);
      });
    });
  }

In console.log(this.invoice.customer_details) I can see customer_name in debug. But in display customer_name is not coming.

In html file,

            <mat-select
              name="customer_details"
              [(ngModel)]="invoice.customer_details"
              #customer_details="ngModel"
              (selectionChange)="updateAddress()"
              required
              [displayWith]="displayCustomer"
            >
              <mat-option
                *ngFor="let cust of custList"
                [value]="cust"
                required
              >
                {{ cust.customer_name }}
              </mat-option>
            </mat-select>


问:
High pass filter using scipy and control
I'm trying to build some digital filter designs but I currently have a technical problem. I have narrowed it down to building the high-pass filter.
Here is a minimal example, building a 3rd order high pass Butterworth filter

```<code>    import numpy as np
    import scipy.signal as sig
    import control

    mydt = 0.25e-3
    hpfilter_signal = sig.butter(3, 2., btype="highpass", fs=1/mydt)
    hpfilter_control = control.tf(*hpfilter_signal, mydt)

    dump = control.bode(hpfilter_control,  Hz=True, label="", wrap_phase=True)
</code>```

On this bode plot, we can see what looks like a lot of "noise" in amplitude and phase at the low frequency end.
I don't know if this comes from scipy.signal.butter, or if it comes from the python control implementation of the transfer function. This looks like numerical quantization errors, but it seems to appear quite early.
In practice, when simulating a system (that has to work in conjunction to a double integrator) in the time domain, the system diverges.
Is this a fundamental limitation of such filters? Is this a bug? How can I go around it?
Thanks in advance.

The problem seems to arise mostly with band pass and high-pass filters of order 3 or more. Converting to a second order series of transfer functions seems to improve a little bit, but the problem remains.

Body:
I'm trying to build some digital filter designs but I currently have a technical problem. I have narrowed it down to building the high-pass filter.
Here is a minimal example, building a 3rd order high pass Butterworth filter

    import numpy as np
    import scipy.signal as sig
    import control

    mydt = 0.25e-3
    hpfilter_signal = sig.butter(3, 2., btype="highpass", fs=1/mydt)
    hpfilter_control = control.tf(*hpfilter_signal, mydt)

    dump = control.bode(hpfilter_control,  Hz=True, label="", wrap_phase=True)

On this bode plot, we can see what looks like a lot of "noise" in amplitude and phase at the low frequency end.
I don't know if this comes from scipy.signal.butter, or if it comes from the python control implementation of the transfer function. This looks like numerical quantization errors, but it seems to appear quite early.
In practice, when simulating a system (that has to work in conjunction to a double integrator) in the time domain, the system diverges.
Is this a fundamental limitation of such filters? Is this a bug? How can I go around it?
Thanks in advance.

The problem seems to arise mostly with band pass and high-pass filters of order 3 or more. Converting to a second order series of transfer functions seems to improve a little bit, but the problem remains.


问:
OpenIddict + postman: The specified 'redirect_uri' is not valid for this client application
Im unable to run an authentication flow with postman using openiddict

i get the error:

```<code>error:invalid_request
error_description:The specified 'redirect_uri' is not valid for this client application.
error_uri:https://documentation.openiddict.com/errors/ID2043
</code>```

Postman parameters:

```<code>grant_type:authorization
client_id:postman
client_secret:postman-secret
response_type:code
code_challenge:S256
code_challenge_method:S256
//response_mode:form_post
redirect_uri:https://oauth.pstmn.io/v1/callback
</code>```

Code:

Client (TestData.cs)

```<code>    public class TestData : IHostedService
    {
        private readonly IServiceProvider _serviceProvider;

        public TestData(IServiceProvider serviceProvider)
        {
            _serviceProvider = serviceProvider;
        }

        public async Task StartAsync(CancellationToken cancellationToken)
        {
            using var scope = _serviceProvider.CreateScope();

            var context = scope.ServiceProvider.GetRequiredService<FaDbContext>();
            await context.Database.EnsureCreatedAsync(cancellationToken);

            var manager = scope.ServiceProvider.GetRequiredService<IOpenIddictApplicationManager>();

            if (await manager.FindByClientIdAsync("postman", cancellationToken) is null)
            {
                await manager.CreateAsync(new OpenIddictApplicationDescriptor
                {
                    ClientId = "postman",
                    ClientSecret = "postman-secret",
                    DisplayName = "Postman",
                    RedirectUris = { new Uri("https://oauth.pstmn.io/v1/callback") },
                    Permissions =
                    {
                        OpenIddictConstants.Permissions.Endpoints.Authorization,
                        OpenIddictConstants.Permissions.Endpoints.Token,

                        OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode,
                        OpenIddictConstants.Permissions.GrantTypes.ClientCredentials,
                        OpenIddictConstants.Permissions.GrantTypes.RefreshToken,

                        OpenIddictConstants.Permissions.Prefixes.Scope + "api",
                        OpenIddictConstants.Permissions.ResponseTypes.Code
                    }
                }, cancellationToken);
            }
        }

        public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
    }
</code>```

Program.cs (I'm trying to set up multiple flows)

builder.Services.AddOpenIddict().AddCore(options =>
{
    options.UseEntityFrameworkCore().UseDbContext<FaDbContext>();
})
    .AddServer(options =>
    {
        options
            .AllowClientCredentialsFlow()
            .AllowAuthorizationCodeFlow()
                .RequireProofKeyForCodeExchange()
            .AllowRefreshTokenFlow()
            .AllowPasswordFlow();
        options.SetTokenEndpointUris("/token")
        .SetAuthorizationEndpointUris("/connect/authorize");
        options.SetUserinfoEndpointUris("/connect/userinfos");

        X509Certificate2 privateKey;
        var bytes = File.ReadAllBytes(builder.Configuration["Auth:PrivateKeyPath"]);
        privateKey = new X509Certificate2(bytes, "test");
        X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
        store.Open(OpenFlags.ReadOnly);

        X509Certificate2 encryptionKey;
        var bytes2 = File.ReadAllBytes(builder.Configuration["Auth:EncryptionkeyPath"]);
        encryptionKey = new X509Certificate2(bytes2, "test");
        X509Store store2 = new X509Store(StoreName.My, StoreLocation.LocalMachine);
        store.Open(OpenFlags.ReadOnly);

        options
        .AddSigningCertificate(privateKey)
        .AddEncryptionCertificate(encryptionKey).DisableAccessTokenEncryption();
        //options.AddSigningKey(new SymmetricSecurityKey(
        //    Convert.FromBase64String("DRjd/GnduI3Efzen9V9BvbNUfc/VKgXltV7Kbk9sMkY=")));

        options.RegisterScopes("api"); //register permissions

        options
                .UseAspNetCore()
                .EnableTokenEndpointPassthrough()
                .EnableAuthorizationEndpointPassthrough();
        options.AcceptAnonymousClients(); //NOT FOR PRODUCTION
    }
).AddValidation(options =>
{
    options.UseLocalServer();
    options.UseAspNetCore();
});

builder.Services.AddAuthentication(options =>
{
    options.DefaultScheme = OpenIddictConstants.Schemes.Bearer;
    options.DefaultChallengeScheme = OpenIddictConstants.Schemes.Bearer;
}).AddOAuthValidation();

builder.Services.AddHostedService<DummyClient>();
builder.Services.AddHostedService<TestData>();
```

Body:
Im unable to run an authentication flow with postman using openiddict

i get the error:

error:invalid_request
error_description:The specified 'redirect_uri' is not valid for this client application.
error_uri:https://documentation.openiddict.com/errors/ID2043

Postman parameters:

grant_type:authorization
client_id:postman
client_secret:postman-secret
response_type:code
code_challenge:S256
code_challenge_method:S256
//response_mode:form_post
redirect_uri:https://oauth.pstmn.io/v1/callback

Code:

Client (TestData.cs)

    public class TestData : IHostedService
    {
        private readonly IServiceProvider _serviceProvider;

        public TestData(IServiceProvider serviceProvider)
        {
            _serviceProvider = serviceProvider;
        }

        public async Task StartAsync(CancellationToken cancellationToken)
        {
            using var scope = _serviceProvider.CreateScope();

            var context = scope.ServiceProvider.GetRequiredService<FaDbContext>();
            await context.Database.EnsureCreatedAsync(cancellationToken);

            var manager = scope.ServiceProvider.GetRequiredService<IOpenIddictApplicationManager>();

            if (await manager.FindByClientIdAsync("postman", cancellationToken) is null)
            {
                await manager.CreateAsync(new OpenIddictApplicationDescriptor
                {
                    ClientId = "postman",
                    ClientSecret = "postman-secret",
                    DisplayName = "Postman",
                    RedirectUris = { new Uri("https://oauth.pstmn.io/v1/callback") },
                    Permissions =
                    {
                        OpenIddictConstants.Permissions.Endpoints.Authorization,
                        OpenIddictConstants.Permissions.Endpoints.Token,

                        OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode,
                        OpenIddictConstants.Permissions.GrantTypes.ClientCredentials,
                        OpenIddictConstants.Permissions.GrantTypes.RefreshToken,

                        OpenIddictConstants.Permissions.Prefixes.Scope + "api",
                        OpenIddictConstants.Permissions.ResponseTypes.Code
                    }
                }, cancellationToken);
            }
        }

        public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
    }

Program.cs (I'm trying to set up multiple flows)

builder.Services.AddOpenIddict().AddCore(options =>
{
    options.UseEntityFrameworkCore().UseDbContext<FaDbContext>();
})
    .AddServer(options =>
    {
        options
            .AllowClientCredentialsFlow()
            .AllowAuthorizationCodeFlow()
                .RequireProofKeyForCodeExchange()
            .AllowRefreshTokenFlow()
            .AllowPasswordFlow();
        options.SetTokenEndpointUris("/token")
        .SetAuthorizationEndpointUris("/connect/authorize");
        options.SetUserinfoEndpointUris("/connect/userinfos");

        X509Certificate2 privateKey;
        var bytes = File.ReadAllBytes(builder.Configuration["Auth:PrivateKeyPath"]);
        privateKey = new X509Certificate2(bytes, "test");
        X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
        store.Open(OpenFlags.ReadOnly);

        X509Certificate2 encryptionKey;
        var bytes2 = File.ReadAllBytes(builder.Configuration["Auth:EncryptionkeyPath"]);
        encryptionKey = new X509Certificate2(bytes2, "test");
        X509Store store2 = new X509Store(StoreName.My, StoreLocation.LocalMachine);
        store.Open(OpenFlags.ReadOnly);

        options
        .AddSigningCertificate(privateKey)
        .AddEncryptionCertificate(encryptionKey).DisableAccessTokenEncryption();
        //options.AddSigningKey(new SymmetricSecurityKey(
        //    Convert.FromBase64String("DRjd/GnduI3Efzen9V9BvbNUfc/VKgXltV7Kbk9sMkY=")));

        options.RegisterScopes("api"); //register permissions

        options
                .UseAspNetCore()
                .EnableTokenEndpointPassthrough()
                .EnableAuthorizationEndpointPassthrough();
        options.AcceptAnonymousClients(); //NOT FOR PRODUCTION
    }
).AddValidation(options =>
{
    options.UseLocalServer();
    options.UseAspNetCore();
});

builder.Services.AddAuthentication(options =>
{
    options.DefaultScheme = OpenIddictConstants.Schemes.Bearer;
    options.DefaultChallengeScheme = OpenIddictConstants.Schemes.Bearer;
}).AddOAuthValidation();

builder.Services.AddHostedService<DummyClient>();
builder.Services.AddHostedService<TestData>();


问:
How do I make Expandable Table like this UI in Flutter? I spent hours to find it but I can't seem to find it

I tried Expandable Table Package but it seems too complicated


问:
Displaying the correct value on a Laravel blade upon date picker date change
In my laravel application's blade I have a div to show total sales of a given day.

```<code><div class="row mt-3" id="shopify_row1">
        <div class="col-md-2" id="shopify_widget1">
            <div class="jumbotron bg-dark text-white">
                <img class="img-fluid pull-left" src="https://cdn0.iconfinder.com/data/icons/social-media-2092/100/social-35-512.png" width="32" height="32">
                <h6 class="text-secondary mt-2 px-4">Shopify</h6>
                <hr class="border border-white">
                <h5 class="text-white">Total Orders</h5>
                <span class="tot_o" id="tot_o">{{ $tot_o }}</span>
            </div>
        </div>
</div>
</code>```

I get this $tot_o via controller.

Now I'm trying to implement a date picker, so does the value of $tot_o should be changed according to the picked date, on change.

This is my date picker.

```<code><td>
      <input id="date" class="date form-control" type="date">
</td>
</code>```

And this is my JavaScript.

```<code><script>
        $(document).on('change', '#date', function (e) {

        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });

        $.ajax({
            type: 'GET',
            dataType: "json",
            url : '/home',
            data : {selected_date : $('#date').val()},
            success:function(data){

            //$('#shopify_widget1').hide();
            console.log('rgfgfg');

            },
            timeout:10000
        });

    });
    </script>
</code>```

Following is in my controller's index()

```<code>//Total orders
            if($request->has('selected_date')){
                $selected_date=$request->selected_date;
                $url = "https://MYAPIKEY@MYSTORE.myshopify.com/admin/api/2022-10/orders/count.json?status=any&created_at_max=".$selected_date."";
            }else{
                $selected_date = date('Y-m-d');
                $url = "https://MYAPIKEY@MYSTORE.myshopify.com/admin/api/2022-10/orders/count.json?status=any&created_at_min=".$selected_date."";
            }
            $curl = curl_init( $url );
            curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
            curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
            $json_response = curl_exec($curl);
            curl_close($curl);
            $result_1 = json_decode($json_response, TRUE);
            $tot_o = $result_1['count'];
</code>```

but in my JavaScript, I'm struggling to complete this part... I want to clear existing $tot_o value and display the new value according to the selected date. Initially this is set to the current date value.

```<code> $.ajax({
            type: 'GET',
            dataType: "json",
            url : '/home',
            data : {selected_date : $('#date').val()},
            success:function(data){

            //$('#shopify_widget1').hide();
            console.log('rgfgfg');

            },
            timeout:10000
        });
</code>```

When I inspect my network tab, I can see my date is passing to controller correctly on every date change and it gives the correct $tot_o value as well in the response.

But it's not displaying on my blade's div...

My console.log also not printing....

UPDATE

As Sachin mentioned in the comments, I've removed the datatype and now I can print my console.log(this is not important.using this just to check my output.) and I can hide the previous value for $tot_o. My updated JS now looks like this..

```<code><script>
        $(document).on('change', '#date', function (e) {

        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });

        $.ajax({
            type: 'GET',
            url : '/home',
            data : {selected_date : $('#date').val()},
            success:function(data){

            $('#tot_o').empty();
            console.log('rgfgfg');

            },
            timeout:10000
        });

    });
    </script>
</code>```

But I'm yet to display the correct value on the blade...

Body:
In my laravel application's blade I have a div to show total sales of a given day.

Shopify

Total Orders

                {{ $tot_o }}

I get this $tot_o via controller.

Now I'm trying to implement a date picker, so does the value of $tot_o should be changed according to the picked date, on change.

This is my date picker.

      <input id="date" class="date form-control" type="date">

And this is my JavaScript.

Following is in my controller's index()

//Total orders
            if($request->has('selected_date')){
                $selected_date=$request->selected_date;
                $url = "https://MYAPIKEY@MYSTORE.myshopify.com/admin/api/2022-10/orders/count.json?status=any&created_at_max=".$selected_date."";
            }else{
                $selected_date = date('Y-m-d');
                $url = "https://MYAPIKEY@MYSTORE.myshopify.com/admin/api/2022-10/orders/count.json?status=any&created_at_min=".$selected_date."";
            }
            $curl = curl_init( $url );
            curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
            curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
            $json_response = curl_exec($curl);
            curl_close($curl);
            $result_1 = json_decode($json_response, TRUE);
            $tot_o = $result_1['count'];

but in my JavaScript, I'm struggling to complete this part... I want to clear existing $tot_o value and display the new value according to the selected date. Initially this is set to the current date value.

 $.ajax({
            type: 'GET',
            dataType: "json",
            url : '/home',
            data : {selected_date : $('#date').val()},
            success:function(data){

            //$('#shopify_widget1').hide();
            console.log('rgfgfg');

            },
            timeout:10000
        });

When I inspect my network tab, I can see my date is passing to controller correctly on every date change and it gives the correct $tot_o value as well in the response.

But it's not displaying on my blade's div...

My console.log also not printing....

UPDATE

As Sachin mentioned in the comments, I've removed the datatype and now I can print my console.log(this is not important.using this just to check my output.) and I can hide the previous value for $tot_o. My updated JS now looks like this..

But I'm yet to display the correct value on the blade...


问:
Is there a combination of state and template design patterns?
I was wondering, if there is a way to combine state and template design patterns with each other?

So that you are able to change the possible states by property. For example a testing algorithm with multiple test states and different characteristics of them based on the guidelines of each country.

Does a pattern exists for that purpose?
Does that make sense in any way?
Is it easy to combine them?


问:
Avoid value error in dataframe from for loop list
I’m using the extract_msg module to read thousands of emails from which I extract things like the sender, receiver, date and body.

I loop over my list of .msg files and save the relevant content to different lists. When I try to add the lists to a dataframe, I get an value error.

I turns out that the length of the body list is 3429 and all other lists are 3431 items long. It looks like perhabs 2 of the e-mails are empty resulting in this problem.

I can create a pd.Series of the body list, but the problem is that this simply adds to empty records at the end of the list, instead of on the spot where the list is actually empty.

What can I add to my for loop to either replace empty records with some sort of string or skip them completely?

This is how I extract the different components from the e-mails

```<code>#run for loop
for filename in f:
    try:
        msg = extract_msg.Message(filename)
        paths.append(filename)
        senders.append(msg.sender)
        recipients.append(msg.to)
        dates.append(msg.date)
        subjects.append(msg.subject)
        body.append(msg.body)
</code>```

and this is how I add them to a df

```<code>#create df
df= pd.DataFrame({'path':paths})
df['map'] = df['path'].str.split('\\').str[4]
df['bestand'] = df['path'].str.split('\\').str[-1]
df ['afzender']  = senders
df [ 'ontvanger'] = recipients
df['datum'] = dates
df['onderwerp'] = subjects
df ['tekst'] = body
</code>```

UPDATE:
I tried printing the length of each item and got a Nonetype error. I therefore assume that my problematic emails contain no content. I have checked this by printing a certain string (if msg.body is NONE: print ("error").

I figured I could solve my problem by including the following if-else statement, but the length of my body list remains 2 items too short.

```<code> if msg.body is None:
            body.append("empty")
        else:
            body.append(msg.body)
</code>```

Body:
I’m using the extract_msg module to read thousands of emails from which I extract things like the sender, receiver, date and body.

I loop over my list of .msg files and save the relevant content to different lists. When I try to add the lists to a dataframe, I get an value error.

I turns out that the length of the body list is 3429 and all other lists are 3431 items long. It looks like perhabs 2 of the e-mails are empty resulting in this problem.

I can create a pd.Series of the body list, but the problem is that this simply adds to empty records at the end of the list, instead of on the spot where the list is actually empty.

What can I add to my for loop to either replace empty records with some sort of string or skip them completely?

This is how I extract the different components from the e-mails

#run for loop
for filename in f:
    try:
        msg = extract_msg.Message(filename)
        paths.append(filename)
        senders.append(msg.sender)
        recipients.append(msg.to)
        dates.append(msg.date)
        subjects.append(msg.subject)
        body.append(msg.body)

and this is how I add them to a df

#create df
df= pd.DataFrame({'path':paths})
df['map'] = df['path'].str.split('\\').str[4]
df['bestand'] = df['path'].str.split('\\').str[-1]
df ['afzender']  = senders
df [ 'ontvanger'] = recipients
df['datum'] = dates
df['onderwerp'] = subjects
df ['tekst'] = body

UPDATE:
I tried printing the length of each item and got a Nonetype error. I therefore assume that my problematic emails contain no content. I have checked this by printing a certain string (if msg.body is NONE: print ("error").

I figured I could solve my problem by including the following if-else statement, but the length of my body list remains 2 items too short.

 if msg.body is None:
            body.append("empty")
        else:
            body.append(msg.body)


问:
excel export data file error in ag-grid-react
I am developing with ag-grid 26.2.0 version(react).
And making a function Excel Export.

When using gridApi.exportDataAsExcel(parameters) is there a value that should not be included in the parameter sheetName?

As a result of my testing, an error occurred in the downloaded file when the following characters were inserted into the sheet. String that causes an error: []<>&"/\*:?

```<code>    gridRef.current.api.exportDataAsExcel({
        onlySelected    : selRows.length > 0,
        sheetName       : `Test & my sheetName`,
        fileName        : `ExportedData_.xlsx`,
        author          : 'v1.0'
});
</code>```

Image when downloaded in the form above:

Body:
I am developing with ag-grid 26.2.0 version(react).
And making a function Excel Export.

When using gridApi.exportDataAsExcel(parameters) is there a value that should not be included in the parameter sheetName?

As a result of my testing, an error occurred in the downloaded file when the following characters were inserted into the sheet. String that causes an error: []<>&"/\*:?

    gridRef.current.api.exportDataAsExcel({
        onlySelected    : selRows.length > 0,
        sheetName       : `Test & my sheetName`,
        fileName        : `ExportedData_.xlsx`,
        author          : 'v1.0'
});

Image when downloaded in the form above:


问:
Provide --dangerous flag when installing a snap with Ansible
I'm trying to install Cider music player (https://download.cider.sh/) using the community.general.snap module in Ansible. This package apparently isn't signed, so to install it I need to pass the --dangerous flag to avoid the following signature verification error: error: cannot find signatures with metadata for snap .

The community.general.snap ansible module doesn't have a "dangerous" parameter https://docs.ansible.com/ansible/latest/collections/community/general/snap_module.html , so I tried passing the flag to the "options" parameter assuming it was a boolean option, but I get the same error: error: cannot find signatures with metadata for snap with this task:

```<code>- name: Get Cider Installer
  get_url:
    url: https://github.com/ciderapp/cider-releases/releases/download/v1.5.9/cider_1.5.9_amd64.snap
    dest: /tmp/cider_1.5.9_amd64.snap

- name: Install Cider
  become: true
  community.general.snap:
    name: /tmp/cider_1.5.9_amd64.snap
    options:
      dangerous=true
</code>```

Besides using the ansible.builtin.shell module & simply running snap install /tmp/cider_1.5.9_amd64.snap --dangerous as a shell command, is there a method for providing that --dangerous flag that I'm overlooking?

Body:
I'm trying to install Cider music player (https://download.cider.sh/) using the community.general.snap module in Ansible. This package apparently isn't signed, so to install it I need to pass the --dangerous flag to avoid the following signature verification error: error: cannot find signatures with metadata for snap .

The community.general.snap ansible module doesn't have a "dangerous" parameter https://docs.ansible.com/ansible/latest/collections/community/general/snap_module.html , so I tried passing the flag to the "options" parameter assuming it was a boolean option, but I get the same error: error: cannot find signatures with metadata for snap with this task:

- name: Get Cider Installer
  get_url:
    url: https://github.com/ciderapp/cider-releases/releases/download/v1.5.9/cider_1.5.9_amd64.snap
    dest: /tmp/cider_1.5.9_amd64.snap

- name: Install Cider
  become: true
  community.general.snap:
    name: /tmp/cider_1.5.9_amd64.snap
    options:
      dangerous=true

Besides using the ansible.builtin.shell module & simply running snap install /tmp/cider_1.5.9_amd64.snap --dangerous as a shell command, is there a method for providing that --dangerous flag that I'm overlooking?


问:
Java not installing custom folder "D:\Program Files\Java" through powershell
I am trying to install java on "D:\Program Files\Java" through powershell but it's not installing.
D:\Softwares\jdk-19_windows-x64_bin.msi INSTALLDIR="D:\Program Files\Java"

can any one help me to resole this issue

the package not installing in a "D:\Program Files\Java".
when i try with "D:\ProgramFiles\Java" without space between program files directory it's working, but when it has space between program files directory it's not working.


问:
How to fold values
I need to fold values in db:

```<code> update(ref(db, 'users/' + user.localId), {
      countTrains: + countTrain, // here
    }).then(() => {
      console.log('Обновление бд');
  })
      .catch((error) => {
          alert(error);
      });
</code>```

But it doesn't work, after refresh value become to standart, please, help

Title: How to fold values

Body:
I need to fold values in db:

 update(ref(db, 'users/' + user.localId), {
      countTrains: + countTrain, // here
    }).then(() => {
      console.log('Обновление бд');
  })
      .catch((error) => {
          alert(error);
      });

But it doesn't work, after refresh value become to standart, please, help


问:
How to Identify JLabel in a ArrayList on a Screen with a Mouse Click
how can i get the specific Information what JLabel i Mouse Clicked on the Screen.

Can i get Informations like Which JLabel it is?

My ArrayList Method

```<code>import java.util.ArrayList;

import javax.swing.JLabel;

public  class ArrayListenfuerAlleLabels {

    ArrayList<JLabel> allelabel = new ArrayList<JLabel>();

    public void addList(int ID, JLabel panel) {

        allelabel.add(ID, panel);
        return;
    }

    public JLabel getList(int dummy) {
        return allelabel.get(dummy);

    }

    public int getsize() {
        return allelabel.size();

    }

}
</code>```

My JLabel Generation

```<code>public class Labelerzeugungklasse extends JLabel {
    static ArrayListenfuerAlleLabels testlist = new ArrayListenfuerAlleLabels();

    public Labelerzeugungklasse(String name, int x, int y, ImageIcon icon, int ID) {

        this.setHorizontalTextPosition(JLabel.CENTER);
        this.setVerticalTextPosition(JLabel.BOTTOM);
        new JLabel(name);
        this.setText(name);
        this.setIcon(icon);
        DragListener drag = new DragListener();
        this.addMouseListener(drag);
        this.addMouseMotionListener(drag);
        this.setFont(new Font("Dialog", Font.BOLD, 14));
        this.setForeground(Color.RED);
        int xbounds = (int)this.getPreferredSize().getWidth();
        int ybounds = (int)this.getPreferredSize().getHeight();
        this.setBounds(x, y, xbounds, ybounds);
        testlist.addList(ID,this);

    }

}
</code>```

My Right click

```<code>private class rightclickscan extends MouseAdapter {
            @Override public void mousePressed(MouseEvent e) {
                if (e.getButton() == MouseEvent.BUTTON3) {
                    System.out.println(e.getSource());

                }
            }
        }
</code>```

My GUI

Best Regards

Justin

I Try to put a Mouse Listener on my Screen but i didnt find a Method where i can get specific Informations.

Body:
how can i get the specific Information what JLabel i Mouse Clicked on the Screen.

Can i get Informations like Which JLabel it is?

My ArrayList Method

import java.util.ArrayList;

import javax.swing.JLabel;

public  class ArrayListenfuerAlleLabels {

    ArrayList<JLabel> allelabel = new ArrayList<JLabel>();

    public void addList(int ID, JLabel panel) {

        allelabel.add(ID, panel);
        return;
    }

    public JLabel getList(int dummy) {
        return allelabel.get(dummy);

    }

    public int getsize() {
        return allelabel.size();

    }

}

My JLabel Generation

public class Labelerzeugungklasse extends JLabel {
    static ArrayListenfuerAlleLabels testlist = new ArrayListenfuerAlleLabels();

    public Labelerzeugungklasse(String name, int x, int y, ImageIcon icon, int ID) {

        this.setHorizontalTextPosition(JLabel.CENTER);
        this.setVerticalTextPosition(JLabel.BOTTOM);
        new JLabel(name);
        this.setText(name);
        this.setIcon(icon);
        DragListener drag = new DragListener();
        this.addMouseListener(drag);
        this.addMouseMotionListener(drag);
        this.setFont(new Font("Dialog", Font.BOLD, 14));
        this.setForeground(Color.RED);
        int xbounds = (int)this.getPreferredSize().getWidth();
        int ybounds = (int)this.getPreferredSize().getHeight();
        this.setBounds(x, y, xbounds, ybounds);
        testlist.addList(ID,this);

    }

}

My Right click

private class rightclickscan extends MouseAdapter {
            @Override public void mousePressed(MouseEvent e) {
                if (e.getButton() == MouseEvent.BUTTON3) {
                    System.out.println(e.getSource());

                }
            }
        }

My GUI

Best Regards

Justin

I Try to put a Mouse Listener on my Screen but i didnt find a Method where i can get specific Informations.


问:
How to use base64.b64decode to decode an image in python
I have this following piece of code, to read an image from db and display into html:

```<code>import base64

with open("2_questions_html_8f51fe3fa0ef29dd.gif", "rb") as image_file:
    encoded_string = base64.b64encode(image_file.read())

with open('img_test.html', 'w') as f:
    f.write("<!DOCTYPE html><head></head><body>")
    f.write(f'<img src="data:image/png;base64,{encoded_string}"/>')
    f.write('</body></html>')

</code>```

It doesn't work because the variable encoded_string = b'....[string]....'

If I copy the part ...[string]... inside the b'...[string]...' then it works.

Please give some explanation and how to fix this programmatically (like, how to get the ...[string]... from the encoded_string = b'...string]...'?

Another way for the problem is to write out the base64 data into an image file and paste the src into the img tag. Can you compare the two ways?

Thanks

Body:
I have this following piece of code, to read an image from db and display into html:

import base64

with open("2_questions_html_8f51fe3fa0ef29dd.gif", "rb") as image_file:
    encoded_string = base64.b64encode(image_file.read())

with open('img_test.html', 'w') as f:
    f.write("<!DOCTYPE html>")
    f.write(f'')
    f.write('')

It doesn't work because the variable encoded_string = b'....[string]....'

If I copy the part ...[string]... inside the b'...[string]...' then it works.

Please give some explanation and how to fix this programmatically (like, how to get the ...[string]... from the encoded_string = b'...string]...'?

Another way for the problem is to write out the base64 data into an image file and paste the src into the img tag. Can you compare the two ways?

Thanks


问:
Invariant Violation: `new NativeEventEmitter()` requires a non-null argument
When i work on react native reanimated i faced this error.

ERROR  Error: Requiring module "node_modules/@react-navigation/drawer/src/index.tsx", which threw an exception: Invariant Violation: new NativeEventEmitter() requires a non-null argument., js engine: hermes

And i cant use drawer navigator.

```<code>import * as React from 'react';
import { createAppContainer } from "react-navigation";
import { createStackNavigator } from "react-navigation-stack";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"
import { NavigationContainer } from "@react-navigation/native";
import { View } from "native-base";
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { createDrawerNavigator } from '@react-navigation/drawer';

const Stack = createNativeStackNavigator();
function HomeScreen({ navigation }) {
    return (
        <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
            <Button
                onPress={() => navigation.navigate('Notifications')}
                title="Go to notifications"
            />
        </View>
    );
}

function NotificationsScreen({ navigation }) {
    return (
        <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
            <Button onPress={() => navigation.goBack()} title="Go back home" />
        </View>
    );
}

const Drawer = createDrawerNavigator();
const StackNavigator = () => {
    return (
        <NavigationContainer>

            <Drawer.Navigator initialRouteName="Home">
                <Drawer.Screen name="Home" component={HomeScreen} />
                <Drawer.Screen name="Notifications" component={NotificationsScreen} />
            </Drawer.Navigator>
        </NavigationContainer>
    );
}

export default StackNavigator;
</code>```

I install react native reanimated package and i run pod install. But i faced this error.

Body:
When i work on react native reanimated i faced this error.

ERROR  Error: Requiring module "node_modules/@react-navigation/drawer/src/index.tsx", which threw an exception: Invariant Violation: new NativeEventEmitter() requires a non-null argument., js engine: hermes

And i cant use drawer navigator.

import * as React from 'react';
import { createAppContainer } from "react-navigation";
import { createStackNavigator } from "react-navigation-stack";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"
import { NavigationContainer } from "@react-navigation/native";
import { View } from "native-base";
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { createDrawerNavigator } from '@react-navigation/drawer';

const Stack = createNativeStackNavigator();
function HomeScreen({ navigation }) {
    return (
        <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
            <Button
                onPress={() => navigation.navigate('Notifications')}
                title="Go to notifications"
            />
        </View>
    );
}

function NotificationsScreen({ navigation }) {
    return (
        <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
            <Button onPress={() => navigation.goBack()} title="Go back home" />
        </View>
    );
}

const Drawer = createDrawerNavigator();
const StackNavigator = () => {
    return (
        <NavigationContainer>

            <Drawer.Navigator initialRouteName="Home">
                <Drawer.Screen name="Home" component={HomeScreen} />
                <Drawer.Screen name="Notifications" component={NotificationsScreen} />
            </Drawer.Navigator>
        </NavigationContainer>
    );
}

export default StackNavigator;

I install react native reanimated package and i run pod install. But i faced this error.


问:
Git workflow on live project with both internal as 3th party updates
Another developer and I are working on a live project with users in the "main environment". We are both completely new to git but we would like to use a VCS.

I wondered if this visual representation of our workflow makes sense and would work.

Basically, we both develop on a separate virtual environment. Normally we would push code straight from our virtual environment to a test environment with client data but no users and if that was all working we moved it over to the main environment. Now we have very little control over minor updates besides our daily backups of the data. Another added problem is that we work on open-source software which still receives updates and also makes use of 3rd party "extensions" which routinely get updated.

I was thinking if we do these updates on our "local" environment first and then push them to the central repo we also catch any differences and potential conflicts with our own work before it goes live. Then we would mirror the central repo to the test environment and if that still works we move it to the main environment. Also as an added question, I wonder if it's preferable to host our own central repo or use Github.

Please let me know if I'm on the right track regarding the workflow. I am still learning about the in-depth git processes but I'm more interested in how to actually implement it into our current situation now.


问:
Setting axes to logarithmic scale in ScatterMatrix plot in Plotly
If I generate a figure as:

```<code>fig = px.scatter_matrix(df, dimensions=columns, color=coloring_column)
</code>```

I wonder how can I set the x-axes or y-axes to the logarithmic scale.

The fig.update_yaxes(type=scale) method or the keyword log_x is not included in the scatter_matrix function differently from the scatter function.

Thank you

Body:
If I generate a figure as:

fig = px.scatter_matrix(df, dimensions=columns, color=coloring_column)

I wonder how can I set the x-axes or y-axes to the logarithmic scale.

The fig.update_yaxes(type=scale) method or the keyword log_x is not included in the scatter_matrix function differently from the scatter function.

Thank you


问:
Writer inside a class does not work in a driver
I have a Java console application which has different views for different users. Inside of each view I have writer and reader, which are used to displaying and getting data. But when I start my driver code it simply doesn't display required data.

```<code>public UserView(){
    reader = new BufferedReader(new InputStreamReader(System.in));
    writer = new BufferedWriter(new OutputStreamWriter(System.out));
}
</code>```

Here is how I initiate my reader and writer inside parent class.

```<code>public void main(){
    while(true){
        try{
            writer.write("0. Exit\n");
            writer.write("1. View news\n");
            writer.write("2. View personal info\n");
            writer.write("3. Change password\n");
            writer.write("4. Create user\n");
            String ans = reader.readLine();
            switch(ans){
                case "0":
                    return;
                case "1":
                    viewNews();
                case "2":
                    viewPersonalInfo();
                case "3":
                    changePassword();
                case "4":
                    createUser();
            }
        }
        catch (IOException ioe){
            System.out.println("Wrong");
        }
    }
}
</code>```

Here is my main method in admin view

```<code>public class Main {

    public static UserView view = new AdminView(((Admin)Data.getInstance().getUser("China", "Kaguya")));

    public static void main(String args[]){
        view.main();
    }
}
</code>```

And here is my driver code. How can I fix this?

Body:
I have a Java console application which has different views for different users. Inside of each view I have writer and reader, which are used to displaying and getting data. But when I start my driver code it simply doesn't display required data.

public UserView(){
    reader = new BufferedReader(new InputStreamReader(System.in));
    writer = new BufferedWriter(new OutputStreamWriter(System.out));
}

Here is how I initiate my reader and writer inside parent class.

public void main(){
    while(true){
        try{
            writer.write("0. Exit\n");
            writer.write("1. View news\n");
            writer.write("2. View personal info\n");
            writer.write("3. Change password\n");
            writer.write("4. Create user\n");
            String ans = reader.readLine();
            switch(ans){
                case "0":
                    return;
                case "1":
                    viewNews();
                case "2":
                    viewPersonalInfo();
                case "3":
                    changePassword();
                case "4":
                    createUser();
            }
        }
        catch (IOException ioe){
            System.out.println("Wrong");
        }
    }
}

Here is my main method in admin view

public class Main {

    public static UserView view = new AdminView(((Admin)Data.getInstance().getUser("China", "Kaguya")));

    public static void main(String args[]){
        view.main();
    }
}

And here is my driver code. How can I fix this?


问:
How InboudNavigation works in c#
I have some ChangeTracker with TrackGraph structure like

```<code>context.ChangeTracker.TrackGraph(entity,
                    node => ..... )
</code>```

In node i have node.InboundNavigation, this field show me path whick track graph passed to the node
I not completely undestand how its work
If i have model

```<code>User
{
string Name;
string email;
....
User Doctor;
}
</code>```

node.InboundNavigation on node Doctor show me path User.User?

Maybe its a bad way to know track path in graph?

I tried to debug it, but visual studio cant pass full way in TrackGraph

Title: How InboudNavigation works in c#

Body:
I have some ChangeTracker with TrackGraph structure like

context.ChangeTracker.TrackGraph(entity,
                    node => ..... )

In node i have node.InboundNavigation, this field show me path whick track graph passed to the node
I not completely undestand how its work
If i have model

User
{
string Name;
string email;
....
User Doctor;
}

node.InboundNavigation on node Doctor show me path User.User?

Maybe its a bad way to know track path in graph?

I tried to debug it, but visual studio cant pass full way in TrackGraph


问:
How to show / hide scheduled notification based on condition?
How can I show / hide scheduled notification based on condition?

Example Use case -

Let's say To-Do tasks notifications are scheduled for 10 users at a specific time of 1:30 PM
and some users have already completed the task before 1:30 PM.

Now scheduled notification are sent at 1:30 PM
And I don't want to show notification to those users who have completed their task already ( before 1:30 PM )
and want to show only to those users who haven't completed the task yet.

currently oneSignal does not have any method handler to handle notification in background for flutter, having such method could have help running custom logic and deciding to show / hide the notification.


问:
How to get Jenkins Agent disconnection timestamp?
I'm trying to retrieve this value here via groovy, in reference from the GUI

Currently I have a workaround solution by inserting the timestamp into the offline message, and then parsing it out later on.

But I would really like a solution where I would be able to retrieve this date data straight from Jenkins.
I have tried the functions

```<code>getOfflineCause()
</code>```

and

```<code>getOfflineCauseReason()
</code>```

Referenced in https://javadoc.jenkins-ci.org/hudson/model/Computer.html, but the timestamps werent included in the output. Thanks in advance.

I have a working solution, but I would like to get help with a more robust one.

Body:
I'm trying to retrieve this value here via groovy, in reference from the GUI

Currently I have a workaround solution by inserting the timestamp into the offline message, and then parsing it out later on.

But I would really like a solution where I would be able to retrieve this date data straight from Jenkins.
I have tried the functions

getOfflineCause()

and

getOfflineCauseReason()

Referenced in https://javadoc.jenkins-ci.org/hudson/model/Computer.html, but the timestamps werent included in the output. Thanks in advance.

I have a working solution, but I would like to get help with a more robust one.


问:
ES5 : mocha and qunit.js
I have qunits written using QUnit.js, now I am trying to integrate Qunit.js with mocha so that I can execute both unittests with single mocha command.

I have installed qunit and mocha using npm.

```<code>➜ npm ls

├── mocha@10.2.0
├── qunit@2.19.3
├── sinon@15.0.1
├── ts-node@10.9.1
└── typescript@4.9.4
</code>```

And when I tried to run the mocha command

```<code>> mocha --require qunit --package ./package.json ./*.js

ReferenceError: QUnit is not defined
</code>```

I am using ES5 JS Syntax, so I can't add lines like require in my .js files. Is there any way we can achieve this?

Title: ES5 : mocha and qunit.js

Body:
I have qunits written using QUnit.js, now I am trying to integrate Qunit.js with mocha so that I can execute both unittests with single mocha command.

I have installed qunit and mocha using npm.

➜ npm ls

├── mocha@10.2.0
├── qunit@2.19.3
├── sinon@15.0.1
├── ts-node@10.9.1
└── typescript@4.9.4

And when I tried to run the mocha command

> mocha --require qunit --package ./package.json ./*.js

ReferenceError: QUnit is not defined

I am using ES5 JS Syntax, so I can't add lines like require in my .js files. Is there any way we can achieve this?