问:
fwrite becomes slow after long uptime
Recently we had a production server up for 50+ days exhibit slow fwrite times. Sporadically, a single fwrite() would take 50 to 300 msec to complete (typically 300 to 2400 bytes). We spent a few days investigating, collecting stats, trying a number of things. Finally after rebooting the system the problem is gone and the server is running normal, as-expected operation. Here are some notes:

-the system is a Xeon 2660 16-core with one HDD and one SSD, Ubuntu 12.04, 3.2.0-49-generic. The HDD is about 88% full and the SSD 75%. fstat() shows optimal HDD blocksize of 4096

-the application software running on the system is two different executables that open, run, and close repeatedly, running for intervals from a minute to several hours, writing numerous wav files of various sizes on a continuous basis while they are running

-both the HDD and SSD exhibited the issue. Writes to ramdisk were Ok

My question: is there any known issue where the Linux I/O interface can reach a point, over time, where a single flush or other I/O operation takes 50 or even 300+ msec to complete ?

We tried defragmenting both drives, setvbuf() variations, and non-blocking file descriptors (fcntl), without any change. After reboot we see wav file extents the same as before, ranging from 1 to 10 typically, depending on file size. The only hint seemed to be that we could occasionally catch a thread briefly showing long I/O wait time or in "uninterruptible sleep" state. For that we used htop (turning on Detailed CPU Usage) and this command:

```<code>     for x in `seq 1 1 100`; do ps -eo state,tid,pid,cmd | grep "^D"; echo "----"; sleep 0.25; done
</code>```

which would (occasionally) show something like "flush-252:0"

We looked through this thread on slow fwrites along with many other discussions but did not find anything that helped other than the usual "probably if you reboot it will go away". Which of course is good advice, but doesn't avoid the next occurrence.

After the reboot, we went on a hunt for any left-over file handles not being closed by those two (2) apps before terminating, and did find one case. My understanding is that should not have an effect.

Title: fwrite becomes slow after long uptime

Body:
Recently we had a production server up for 50+ days exhibit slow fwrite times. Sporadically, a single fwrite() would take 50 to 300 msec to complete (typically 300 to 2400 bytes). We spent a few days investigating, collecting stats, trying a number of things. Finally after rebooting the system the problem is gone and the server is running normal, as-expected operation. Here are some notes:

-the system is a Xeon 2660 16-core with one HDD and one SSD, Ubuntu 12.04, 3.2.0-49-generic. The HDD is about 88% full and the SSD 75%. fstat() shows optimal HDD blocksize of 4096

-the application software running on the system is two different executables that open, run, and close repeatedly, running for intervals from a minute to several hours, writing numerous wav files of various sizes on a continuous basis while they are running

-both the HDD and SSD exhibited the issue. Writes to ramdisk were Ok

My question: is there any known issue where the Linux I/O interface can reach a point, over time, where a single flush or other I/O operation takes 50 or even 300+ msec to complete ?

We tried defragmenting both drives, setvbuf() variations, and non-blocking file descriptors (fcntl), without any change. After reboot we see wav file extents the same as before, ranging from 1 to 10 typically, depending on file size. The only hint seemed to be that we could occasionally catch a thread briefly showing long I/O wait time or in "uninterruptible sleep" state. For that we used htop (turning on Detailed CPU Usage) and this command:

     for x in `seq 1 1 100`; do ps -eo state,tid,pid,cmd | grep "^D"; echo "----"; sleep 0.25; done

which would (occasionally) show something like "flush-252:0"

We looked through this thread on slow fwrites along with many other discussions but did not find anything that helped other than the usual "probably if you reboot it will go away". Which of course is good advice, but doesn't avoid the next occurrence.

After the reboot, we went on a hunt for any left-over file handles not being closed by those two (2) apps before terminating, and did find one case. My understanding is that should not have an effect.


来源: stackexchange

问:
Command Line Arguments Issue
I have an executable file a.out in my workspace that I am trying to call with the argument hello.txt.

When I run ./a.out hello.txt in the terminal, it works. However, when try to do this with VSC, hello.txt is not getting passed to the executable.

I've verified my json files extensively, but I cannot figure out where the issue is coming from. Any help would be greatly appreciated. My tasks.json and launch.json are below:

tasks.json:

```<code>{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: gcc-9 build active file",
            "command": "/usr/bin/gcc-9",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/a.out"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        }
    ],
    "version": "2.0.0"
}
</code>```

launch.json:

```<code>{
    "name": "C Launch",
    "request": "launch",
    "program": "${workspaceFolder}/a.out",
    "args": ["${workspaceFolder}/hello.txt"],
    "cwd": "${workspaceFolder}"
}
</code>```

ContentLicense: CC BY-SA 4.0

Title: Command Line Arguments Issue

Body:
I have an executable file a.out in my workspace that I am trying to call with the argument hello.txt.

When I run ./a.out hello.txt in the terminal, it works. However, when try to do this with VSC, hello.txt is not getting passed to the executable.

I've verified my json files extensively, but I cannot figure out where the issue is coming from. Any help would be greatly appreciated. My tasks.json and launch.json are below:

tasks.json:

{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: gcc-9 build active file",
            "command": "/usr/bin/gcc-9",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/a.out"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        }
    ],
    "version": "2.0.0"
}

launch.json:

{
    "name": "C Launch",
    "request": "launch",
    "program": "${workspaceFolder}/a.out",
    "args": ["${workspaceFolder}/hello.txt"],
    "cwd": "${workspaceFolder}"
}


问:
Is it possible to use vscode syntax highlighter to a ast file using tree-sitter?
I am trying to get AST file using vs code syntax highlighter file for a custom language. Please help me</p>


问:
JUnit - Micronaut Value annotation is not working for the class I running the test
Hi I am trying to right test cases for a class in micronaut with JUnit. The class extends an abstract class AbstractShippingService which is something like this:

```<code>@Singleton
public abstract class AbstractShippingService {
    @Value("${delivery.customer.shipping-period}")
    int shippingPeriod; // This is not being initialized with application.yml value, hence giving 0 during running test

    public ShippingStatus getShippingStatus(String token, long ShippingRef, long ShippingCode);
}
</code>```

The class which I am writing test for is:

```<code>@Singleton
public class ShippingService extends AbstractShippingService{
@Override
    public ShippingStatus getShippingStatus(String token, long ShippingRef, long ShippingCode) {
       ....// some code
       if (timeInDays <= shippingPeriod) {
       // some code
       }
    }
}
</code>```

And here is my test:

```<code>@ExtendWith(MockitoExtension.class)
@MicronautTest(propertySources = "application.yml")
public class ShippingServiceTest {
    @Mock
    CourierService courierService;

    @InjectMocks
    ShippingService shippingService;

   @Test
   void test_shouldReturnShippingStatusAwaiting_whenNoDeliveryAgentPresent() {
      // Some methods mocked here
      assertEquals(shippingService. getShippingStatus(TOKEN, SHIPPING_REF, ShippingCode.TWO, ShippingStatus.AWAITING);
    }
}
</code>```

The propertySources attribute only works for MicronuatTest but not on the class which I am writing tests for. How do I make sure the Value will get initialized ?

Body:
Hi I am trying to right test cases for a class in micronaut with JUnit. The class extends an abstract class AbstractShippingService which is something like this:

@Singleton
public abstract class AbstractShippingService {
    @Value("${delivery.customer.shipping-period}")
    int shippingPeriod; // This is not being initialized with application.yml value, hence giving 0 during running test

    public ShippingStatus getShippingStatus(String token, long ShippingRef, long ShippingCode);
}

The class which I am writing test for is:

@Singleton
public class ShippingService extends AbstractShippingService{
@Override
    public ShippingStatus getShippingStatus(String token, long ShippingRef, long ShippingCode) {
       ....// some code
       if (timeInDays <= shippingPeriod) {
       // some code
       }
    }
}

And here is my test:

@ExtendWith(MockitoExtension.class)
@MicronautTest(propertySources = "application.yml")
public class ShippingServiceTest {
    @Mock
    CourierService courierService;

    @InjectMocks
    ShippingService shippingService;

   @Test
   void test_shouldReturnShippingStatusAwaiting_whenNoDeliveryAgentPresent() {
      // Some methods mocked here
      assertEquals(shippingService. getShippingStatus(TOKEN, SHIPPING_REF, ShippingCode.TWO, ShippingStatus.AWAITING);
    }
}

The propertySources attribute only works for MicronuatTest but not on the class which I am writing tests for. How do I make sure the Value will get initialized ?


问:
error occurs when an Activity is unable to start due to an InflateException
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapp/com.example.myapp.MainActivity}: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class android.widget.Button</p>
```<code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapp/com.example.myapp.MainActivity}: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class android.widget.Button

</code>```

Body:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapp/com.example.myapp.MainActivity}: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class android.widget.Button

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapp/com.example.myapp.MainActivity}: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class android.widget.Button


问:
Barcode line overlay scanner in flutter package mobile_scanner: ^2.1.0
I'm using  package mobile_scanner in my flutter application, and it works fine, it opens the camera in full screen and scans QR/Barcode in any place on the screen. I want to add a specific detection area on the screen with a camera full view. how can I achieve this.

I researched and found this package does not  have that feature , what can be the solution
Note: I don't like to replace this package with other i.e I must stay in this package.

What I am doing is this:

```<code>body: Stack(
  children: [
    MobileScanner(
        allowDuplicates: false,
        controller: cameraController,
        onDetect: (qrcode, args) {
          if (qrcode.rawValue == null) {
            debugPrint('Failed to scan Barcode');
          } else {
            final String code = qrcode.rawValue!;
            Get.off(QrInfo(codeInfo: code), binding: QrCodeBinding());

            debugPrint('Qr found! $code');
          }
        }),
    Center(
        child: Image.asset(
      'assets/qrFrame.png',
      scale: 0.25,
          color: Colors.red,
    )),
  ],
));

</code>```

Body:
I'm using  package mobile_scanner in my flutter application, and it works fine, it opens the camera in full screen and scans QR/Barcode in any place on the screen. I want to add a specific detection area on the screen with a camera full view. how can I achieve this.

I researched and found this package does not  have that feature , what can be the solution
Note: I don't like to replace this package with other i.e I must stay in this package.

What I am doing is this:

body: Stack(
  children: [
    MobileScanner(
        allowDuplicates: false,
        controller: cameraController,
        onDetect: (qrcode, args) {
          if (qrcode.rawValue == null) {
            debugPrint('Failed to scan Barcode');
          } else {
            final String code = qrcode.rawValue!;
            Get.off(QrInfo(codeInfo: code), binding: QrCodeBinding());

            debugPrint('Qr found! $code');
          }
        }),
    Center(
        child: Image.asset(
      'assets/qrFrame.png',
      scale: 0.25,
          color: Colors.red,
    )),
  ],
));


问:
Is it possible to use workmanager in Flutter to relaunch the app after a few hours (depending on the situation) when the app is completely closed?
I want to create an app that shows an alarm screen that sounds when the app is restarted when certain conditions are met after communicating with the api using workmanager in Flutter. However, the app does not restart even if I use the code below.</p>
```<code>void callbackDispatcher() {
  Workmanager().executeTask((task, inputData) async {
    do{
    code that api communication....
    }while(When conditions are satisfied)

    Restart.restartApp();//When I try to relaunch the app, nothing happens
    });

    return Future.value(true);

}
</code>```

Body:
I want to create an app that shows an alarm screen that sounds when the app is restarted when certain conditions are met after communicating with the api using workmanager in Flutter. However, the app does not restart even if I use the code below.

void callbackDispatcher() {
  Workmanager().executeTask((task, inputData) async {
    do{
    code that api communication....
    }while(When conditions are satisfied)

    Restart.restartApp();//When I try to relaunch the app, nothing happens
    });

    return Future.value(true);

}


问:
How to pass input checkbox value into another component Mat-checkbox
There is a table where all rows are selected through checkbox and currently i added a new checkbox for selecting only current page rows which is working fine. But I don't want to display 2 checkbox in table. So I tough to hidden one checkbox and get value from checkbox in dashboard. I tried but the unable to do it .

table.compoent.html   (child)

```<code> <th mat-header-cell *matHeaderCellDef>
          <mat-checkbox (change)="$event ? masterToggle() : null" [checked]="selection.hasValue() && isAllSelected() "
            [aria-label]="checkboxLabel()">
          </mat-checkbox>
          <mat-checkbox (change)="$event ? masterToggles() : null" [checked]="selection.hasValue() && isCurrentSelect()"
            [aria-label]="checkboxLabel()" >
          </mat-checkbox>
        </th>

</code>```

This are the 2 checkbox where in second I wanted to checked it by the passing value from dashboard and hide the table.component.html second checkbox.

dashboard.component.html (parent)

```<code> <label>Select Per Page</label>
                <input class="form-check-input" type="checkbox" value="" id="currentPage" style="width: 25px; height: 40px;" >
</code>```

Body:
There is a table where all rows are selected through checkbox and currently i added a new checkbox for selecting only current page rows which is working fine. But I don't want to display 2 checkbox in table. So I tough to hidden one checkbox and get value from checkbox in dashboard. I tried but the unable to do it .

table.compoent.html   (child)

          <mat-checkbox (change)="$event ? masterToggle() : null" [checked]="selection.hasValue() && isAllSelected() "
            [aria-label]="checkboxLabel()">
          </mat-checkbox>
          <mat-checkbox (change)="$event ? masterToggles() : null" [checked]="selection.hasValue() && isCurrentSelect()"
            [aria-label]="checkboxLabel()" >
          </mat-checkbox>

This are the 2 checkbox where in second I wanted to checked it by the passing value from dashboard and hide the table.component.html second checkbox.

dashboard.component.html (parent)

 Select Per Page
                <input class="form-check-input" type="checkbox" value="" id="currentPage" style="width: 25px; height: 40px;" >


问:
How to intercept request with mitmproxy before response is streamed?
The request I am trying to intercept and modify is a get request with only one parameter and I try to modify it:

```<code>from mitmproxy import http

def request(flow: http.HTTPFlow) -> None:
    if flow.request.pretty_url.startswith(BASE_URL):
        flow.request.url = BASE_URL.replace('abc', 'def')
</code>```

The above shows what I am trying to do in a nutshell. But unfortunately, according to docs,

this event fires after the entire body has been streamed.

In the end, I am not able to modify the request. Am I missing something here? Because if modify requests is not possible, then what is the point of mitmproxy?

Body:
The request I am trying to intercept and modify is a get request with only one parameter and I try to modify it:

from mitmproxy import http

def request(flow: http.HTTPFlow) -> None:
    if flow.request.pretty_url.startswith(BASE_URL):
        flow.request.url = BASE_URL.replace('abc', 'def')

The above shows what I am trying to do in a nutshell. But unfortunately, according to docs,

this event fires after the entire body has been streamed.

In the end, I am not able to modify the request. Am I missing something here? Because if modify requests is not possible, then what is the point of mitmproxy?


问:
Can't install SQL Server Driver (PHP / Heroku)
Can't install ext-sqlsrv & ext-pdo_sqlsrv php extensions on Heroku Platform.

I'm following the repo: https://github.com/heroku-softtrends/heroku-php-sqlsrv-buildpack

.user.ini

```<code>extension = sqlsrv.so
extension = pdo_sqlsrv.so
</code>```

Aptfile

```<code>https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/libodbc1_2.3.7_amd64.deb
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/odbcinst_2.3.7_amd64.deb
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/odbcinst1debian2_2.3.7_amd64.deb
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/unixodbc_2.3.7_amd64.deb
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/unixodbc-dev_2.3.7_amd64.deb
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/m/msodbcsql17/msodbcsql17_17.6.1.1-1_amd64.deb
</code>```

HEROKU_PHP_PLATFORM_REPOSITORIES: https://github.com/heroku-softtrends/mssql-server-drivers-for-php/raw/main/5.9.0/ubuntu/20.04/php/8.0/nts/packages.json

However, when I attempt to push to Heroku I get the following error:

```<code>remote:          Problem 1
remote:            - Root composer.json requires PHP extension ext-sqlsrv ^5.9 but it is missing from your system. Install or enable PHP's sqlsrv extension.
remote:          Problem 2
remote:            - Root composer.json requires PHP extension ext-pdo_sqlsrv ^5.9 but it is missing from your system. Install or enable PHP's pdo_sqlsrv extension.
</code>```

Body:
Can't install ext-sqlsrv & ext-pdo_sqlsrv php extensions on Heroku Platform.

I'm following the repo: https://github.com/heroku-softtrends/heroku-php-sqlsrv-buildpack

.user.ini

extension = sqlsrv.so
extension = pdo_sqlsrv.so

Aptfile

https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/libodbc1_2.3.7_amd64.deb
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/odbcinst_2.3.7_amd64.deb
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/odbcinst1debian2_2.3.7_amd64.deb
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/unixodbc_2.3.7_amd64.deb
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/u/unixodbc/unixodbc-dev_2.3.7_amd64.deb
https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/m/msodbcsql17/msodbcsql17_17.6.1.1-1_amd64.deb

HEROKU_PHP_PLATFORM_REPOSITORIES: https://github.com/heroku-softtrends/mssql-server-drivers-for-php/raw/main/5.9.0/ubuntu/20.04/php/8.0/nts/packages.json

However, when I attempt to push to Heroku I get the following error:

remote:          Problem 1
remote:            - Root composer.json requires PHP extension ext-sqlsrv ^5.9 but it is missing from your system. Install or enable PHP's sqlsrv extension.
remote:          Problem 2
remote:            - Root composer.json requires PHP extension ext-pdo_sqlsrv ^5.9 but it is missing from your system. Install or enable PHP's pdo_sqlsrv extension.


问:
How to connect mtproto telegram client without library / framework?
I've been looking for a way to make a connection to the telegram api for a long time, but I didn't find anything suitable

i have read this: https://core.telegram.org/mtproto
and this: How to implement authorization using a Telegram API?

But I can't figure out how to decode and encrypt it. I've read other open-source code, but I still don't understand how to port it to the language I'm going to use.

Can you write instructions on how to use the mtproto api telegram on dart? you can write the language you prefer.

I want to use the client on dart language


问:
SAP B1 Inventory Counting : Getting error as Internal error (-5002) Occurred
We are implementing inventory counting service in our application & we are making calls using DIAPI. When we perform the add operation on inventory counting we are getting an error:

Internal error (-5002) occurred

We are using SAP B1 V10 with respective DIAPI. We able to connect to the SAP B1 instance/server using DIAPI but when performing add we are getting error.

Here is the sample code for add:

```<code>SAPbobsCOM.Company _company = new SAPbobsCOM.Company();

_company.Server = @"ServerURL";

_company.CompanyDB = "CompanyDatabase";

_company.UserName = "username";

_company.Password = "password";

_company.LicenseServer = "licenseServer";

_company.language = (SAPbobsCOM.BoSuppLangs)

Enum.Parse(typeof(SAPbobsCOM.BoSuppLangs), "ln_English_Gb");

_company.DbServerType = (SAPbobsCOM.BoDataServerTypes)

Enum.Parse(typeof(SAPbobsCOM.BoDataServerTypes), "15");

_company.DbUserName = "DBUser";

_company.DbPassword = "DBPassword";

int returnVal = _company.Connect();

SAPbobsCOM.CompanyService oCS = (SAPbobsCOM.CompanyService)_company.GetCompanyService();

SAPbobsCOM.InventoryCountingsService oICS = oCS.GetBusinessService(SAPbobsCOM.ServiceTypes.InventoryCountingsService);

SAPbobsCOM.InventoryCounting oIC = oICS.GetDataInterface(SAPbobsCOM.InventoryCountingsServiceDataInterfaces.icsInventoryCounting);

oIC.FromXMLFile("c:\\Temp\\UserXML.xml");

SAPbobsCOM.InventoryCountingParams oInventoryCountingParams = oICS.Add(oIC);
</code>```

Body:
We are implementing inventory counting service in our application & we are making calls using DIAPI. When we perform the add operation on inventory counting we are getting an error:

Internal error (-5002) occurred

We are using SAP B1 V10 with respective DIAPI. We able to connect to the SAP B1 instance/server using DIAPI but when performing add we are getting error.

Here is the sample code for add:

SAPbobsCOM.Company _company = new SAPbobsCOM.Company();

_company.Server = @"ServerURL";

_company.CompanyDB = "CompanyDatabase";

_company.UserName = "username";

_company.Password = "password";

_company.LicenseServer = "licenseServer";

_company.language = (SAPbobsCOM.BoSuppLangs)

Enum.Parse(typeof(SAPbobsCOM.BoSuppLangs), "ln_English_Gb");

_company.DbServerType = (SAPbobsCOM.BoDataServerTypes)

Enum.Parse(typeof(SAPbobsCOM.BoDataServerTypes), "15");

_company.DbUserName = "DBUser";

_company.DbPassword = "DBPassword";

int returnVal = _company.Connect();

SAPbobsCOM.CompanyService oCS = (SAPbobsCOM.CompanyService)_company.GetCompanyService();

SAPbobsCOM.InventoryCountingsService oICS = oCS.GetBusinessService(SAPbobsCOM.ServiceTypes.InventoryCountingsService);

SAPbobsCOM.InventoryCounting oIC = oICS.GetDataInterface(SAPbobsCOM.InventoryCountingsServiceDataInterfaces.icsInventoryCounting);

oIC.FromXMLFile("c:\\Temp\\UserXML.xml");

SAPbobsCOM.InventoryCountingParams oInventoryCountingParams = oICS.Add(oIC);


问:
C# list of generic class with different parameter
How to store a list of generic class with different parameter

namespace Cmd;

public abstract class BaseDto
{
}

public abstract class BaseMessage<T>
{
    public readonly T Data;

    public BaseMessage(T data)
    {
        Data = data;
    }

    public abstract string Embed();
}

public abstract class BaseTopic<T>
{
    public abstract IEnumerable<BaseMessage<T>> Order();
}

public abstract class Dto
{
}

public class Dto1 : Dto
{
    public string? Name { get; set; }
}

public class Dto2 : Dto
{
    public string? Address { get; set; }
}

public class Message1 : BaseMessage<Dto1>
{
    public Message1(Dto1 data) : base(data)
    {
    }

    public override string Embed()
    {
        return $"{Data.Name}";
    }
}

public class Message2 : BaseMessage<Dto2>
{
    public Message2(Dto2 data) : base(data)
    {
    }

    public override string Embed()
    {
        return $"{Data.Address}";
    }
}

public class Topic1 : BaseTopic<Dto1>
{
    public override IEnumerable<BaseMessage<Dto1>> Order()
    {
        var dto = new Dto1();
        var msg = new Message1(dto);
        return new List<BaseMessage<Dto1>> { msg, msg };
    }
}

public class Topic2 : BaseTopic<Dto2>
{
    public override IEnumerable<BaseMessage<Dto2>> Order()
    {
        var dto = new Dto2();
        var msg = new Message2(dto);
        return new List<BaseMessage<Dto2>> { msg, msg };
    }
}
```
<p>is it possible to create a list of topics?
ex :</p>
<pre class="lang-cs prettyprint-override"><code>var topic1 = new Topic1();
var topic2 = new Topic2();
var list = new List<BaseTopic> {topic1, topic2}
</code>```

what I want is to loop through the list and call message.Embed() after topic.Order got called

I considered using the base DTO class, but it did not work. The error message stated that the argument is not assignable

The BaseTopic class has a generic type parameter because its method requires a generic return value.

Body:
How to store a list of generic class with different parameter

namespace Cmd;

public abstract class BaseDto
{
}

public abstract class BaseMessage<T>
{
    public readonly T Data;

    public BaseMessage(T data)
    {
        Data = data;
    }

    public abstract string Embed();
}

public abstract class BaseTopic<T>
{
    public abstract IEnumerable<BaseMessage<T>> Order();
}

public abstract class Dto
{
}

public class Dto1 : Dto
{
    public string? Name { get; set; }
}

public class Dto2 : Dto
{
    public string? Address { get; set; }
}

public class Message1 : BaseMessage<Dto1>
{
    public Message1(Dto1 data) : base(data)
    {
    }

    public override string Embed()
    {
        return $"{Data.Name}";
    }
}

public class Message2 : BaseMessage<Dto2>
{
    public Message2(Dto2 data) : base(data)
    {
    }

    public override string Embed()
    {
        return $"{Data.Address}";
    }
}

public class Topic1 : BaseTopic<Dto1>
{
    public override IEnumerable<BaseMessage<Dto1>> Order()
    {
        var dto = new Dto1();
        var msg = new Message1(dto);
        return new List<BaseMessage<Dto1>> { msg, msg };
    }
}

public class Topic2 : BaseTopic<Dto2>
{
    public override IEnumerable<BaseMessage<Dto2>> Order()
    {
        var dto = new Dto2();
        var msg = new Message2(dto);
        return new List<BaseMessage<Dto2>> { msg, msg };
    }
}

is it possible to create a list of topics?
ex :

var topic1 = new Topic1();
var topic2 = new Topic2();
var list = new List<BaseTopic> {topic1, topic2}

what I want is to loop through the list and call message.Embed() after topic.Order got called

I considered using the base DTO class, but it did not work. The error message stated that the argument is not assignable

The BaseTopic class has a generic type parameter because its method requires a generic return value.


问:
I can't get OpenCV library to work in PyCharm, returns "Cannot find reference 'imread' in '__init__.py'" and more errors
After importing cv2 in Pycharm, every function associated with cv2 returns an error for some reason. list of errors. I have already gone through countless posts on Stack Overflow but none of the suggested answers have helped.

Here is the code:

```<code>import cv2 as cv
import numpy as np

# Read the image
image = cv.imread('image')

# Convert the image to grayscale
gray = cv.cvtColor(image, cv.COLOR_BGR2GRAY)

# Blur the image to reduce high frequency noise
blurred = cv.GaussianBlur(gray, (9, 9), 0)

# Threshold the image to create a binary image
threshold, thresh_image = cv.threshold(blurred, 50, 255, cv.THRESH_BINARY)

# Dilate the image to fill in the holes
kernel = np.ones((5,5),np.uint8)
dilated = cv.dilate(thresh_image, kernel, iterations=2)

# Invert the image to create a mask
mask = cv.bitwise_not(dilated)

# Apply the mask to the original image
result = cv.bitwise_and(image, image, mask=mask)

# Save the resulting image
cv.imwrite('image_without_stars.jpg2', result)
</code>```

Here is what I have tried:

updating PyCharm to version (3.11)

changing the location of 'image'

adding the directory where the Python interpreter is installed to the PATH environment variable

re-downloading OpenCV library

copying the code to notepad, saving it and trying to execute that file in the terminal

copying the cv2 file from the cv2 folder into the site-packages folder (because another post on this site said to try it)

It is also possible that I didn't do some of these things correctly...

Does anyone know how I might be able to fix this?

Body:
After importing cv2 in Pycharm, every function associated with cv2 returns an error for some reason. list of errors. I have already gone through countless posts on Stack Overflow but none of the suggested answers have helped.

Here is the code:

import cv2 as cv
import numpy as np

# Read the image
image = cv.imread('image')

# Convert the image to grayscale
gray = cv.cvtColor(image, cv.COLOR_BGR2GRAY)

# Blur the image to reduce high frequency noise
blurred = cv.GaussianBlur(gray, (9, 9), 0)

# Threshold the image to create a binary image
threshold, thresh_image = cv.threshold(blurred, 50, 255, cv.THRESH_BINARY)

# Dilate the image to fill in the holes
kernel = np.ones((5,5),np.uint8)
dilated = cv.dilate(thresh_image, kernel, iterations=2)

# Invert the image to create a mask
mask = cv.bitwise_not(dilated)

# Apply the mask to the original image
result = cv.bitwise_and(image, image, mask=mask)

# Save the resulting image
cv.imwrite('image_without_stars.jpg2', result)

Here is what I have tried:

updating PyCharm to version (3.11)

changing the location of 'image'

adding the directory where the Python interpreter is installed to the PATH environment variable

re-downloading OpenCV library

copying the code to notepad, saving it and trying to execute that file in the terminal

copying the cv2 file from the cv2 folder into the site-packages folder (because another post on this site said to try it)

It is also possible that I didn't do some of these things correctly...

Does anyone know how I might be able to fix this?


问:
what m_list.SetItemState(idx, 1, FALSE) means? MFC CListCtrl
I saw this peace of code m_list.SetItemState(idx, 1, FALSE) from MFC based project.

my question is what 1 and FALSE mean?

I saw that state LVIS_FOCUSED is 0x0001, so I think 1 is LVIS_FOCUSED, but why they didn't use just LVIS_FOCUSED ?

And detailed explanation about 3rd parameter (for example when it is FALSE) is not given (CListCtrl::SetItemState )


问:
Generate public interface for a closed source rust library
I am making a rust library, but it is closed source, and I'm distributing it as a .a file. The entire public interface of the library and all publicly accessible structs have a C abi, using #[repr(C)], #[no_mangle] etc, and a header file generated using cbindgen, allowing a C/C++ application to use my library.

But how would a rust application use the .a file? How would I generate a "header" - like interface for a rust application to use? To build the application do I just link my .a using a build.rs script?


问:
CircleCI mongo executor failed
I used the new Circle v2.1 format, and declare an executor using the latest OpenJDK and mongo, but the mongo container always failed when running the pipeline.

version: 2.1

orbs:
  maven: circleci/maven@1.4.0
  codecov: codecov/codecov@3.2.4
executors:
  docker-mongo:
    docker:
      - image: cimg/openjdk:19.0.1
      - image: mongo:6
jobs:
  build:
    executor: docker-mongo
    steps:
      - checkout
      - maven/with_cache:
          steps:
            - run: mvn -q test verify -Pcoverage
      - maven/process_test_results
      - codecov/upload:
          when: on_success
workflows:
  build:
    jobs:
      - build
```

See the build errors on Circle CI:  https://app.circleci.com/pipelines/github/hantsy/spring-reactive-jwt-sample/469/workflows/e04f6c58-1099-4821-b9c4-21ab96b22337/jobs/480

Title: CircleCI mongo executor failed

Body:
I used the new Circle v2.1 format, and declare an executor using the latest OpenJDK and mongo, but the mongo container always failed when running the pipeline.

version: 2.1

orbs:
  maven: circleci/maven@1.4.0
  codecov: codecov/codecov@3.2.4
executors:
  docker-mongo:
    docker:
      - image: cimg/openjdk:19.0.1
      - image: mongo:6
jobs:
  build:
    executor: docker-mongo
    steps:
      - checkout
      - maven/with_cache:
          steps:
            - run: mvn -q test verify -Pcoverage
      - maven/process_test_results
      - codecov/upload:
          when: on_success
workflows:
  build:
    jobs:
      - build

See the build errors on Circle CI:  https://app.circleci.com/pipelines/github/hantsy/spring-reactive-jwt-sample/469/workflows/e04f6c58-1099-4821-b9c4-21ab96b22337/jobs/480


问:
can you see why there is still a listener at the end of this code?
adobe animate cc/HTML5 Canvas/JS
This code is running from and external class file
I thought I had this working but for some reason when it gets to the part where I thought I had removed all listeners this button (bt_1) keeps reacting like it still has the listener for the setState3() function active when we get to the (setState == 5) or (setState == 6) part of the update() function.

Its a bit strange because if I use the .off('click' command on both listeners for btn_1 at the (setState = 1) part of the update() function then the button becomes inactive (as intended)
let me know if you can spot what I have done wrong (it throws no errors in the debug)

class Game {
  constructor (exportRoot, stage) {
    this.root = exportRoot
    this.stage = stage
    this.str1 = 'start'
    this.strOp1 = '1'
    this.strOp2 = '2'
    this.init()
    this.setstate
    this.randomNumber
  }

  init () {
    const game = this
    this.main_Txt = this.root.main_Txt
    this.op_1 = this.root.op_1
    this.op_2 = this.root.op_2
    this.root.start_bt.on('click', function () { game.update() })
    this.setstate = 0
  };

  update () {
    if (this.setstate == 0) {
      this.str1 = 'You have had a really big weekend camping.  In fact as you are driving home through the dark forest you can hardly keep you eyes open.  The stereo is playing your favourite song but suddenly it cuts out.  There is a huge bright purple light in the sky and your car sputters to a stop.  The stereo is dead and all the lights are out.'
      this.strOp1 = 'Try to fix your car'
      this.strOp2 = 'Start walking'
      this.root.start_bt.visible = 0
      this.root.mc_2.visible = false
      this.root.btn_1.on('click', function () { game.setstate1() })
      // this.root.btn_2.on("click", function(){ game.setstate2(); })
    } else if (this.setstate == 1) {
      this.str1 = 'You get out and open the hood, its hard to see but there is still some purple glow in the sky.  You wonder what that big light came from and what is going on.  All of a sudden there is some moaning and some noises from the underbrush and a zombie stumbles out onto the road.'
      this.strOp1 = 'Fight the zombie'
      this.strOp2 = 'Ask him to help fix the car'
      this.root.mc_1.visible = false
      this.root.mc_2.visible = true
      this.root.btn_1.off('click', function () { game.setstate1() })
      this.root.btn_1.on('click', function () { game.setstate3() })
      // this.root.btn_2.on("click", function(){ game.setstate2(); })
    } else if (this.setstate == 5) {
      this.str1 = 'You try to fight but the zombie overpowers you and eats your brain.'
      this.strOp1 = 'dead'
      this.strOp2 = 'dead'
      this.root.mc_1.visible = false
      this.root.mc_2.visible = false
      this.root.btn_1.off('click', function () { game.setstate3() })
      // this.root.btn_2.on("click", function(){game.setstate2();  })
    } else if (this.setstate == 6) {
      this.str1 = 'lost.'
      this.strOp1 = 'dead'
      this.strOp2 = 'dead'
      this.root.mc_1.visible = false
      this.root.mc_2.visible = false
      this.root.btn_1.off('click', function () { game.setstate3() })
      // this.root.btn_2.on("click", function(){ game.setstate2(); }
    }
    this.setText()
  }

  chooseNumber () {
      this.randomNumber = Math.floor(Math.random() * 10) + 1
  }

  setText () {
    this.main_Txt.text = this.str1
    this.op_1.text = this.strOp1
    this.op_2.text = this.strOp2
  }

  setstate1 () {
    console.log('setstate1')
    this.setstate = 1
    this.update()
  }

  setstate3 () {
    this.chooseNumber()
    if (this.randomNumber >= 5) {
      console.log('setstate5')
      this.setstate = 5
      this.update()
    } else {
      console.log('setstate6')
      this.setstate = 6
      this.update()
    }
  }
}```


问:
Country code not loading in `react-native-phone-number-input` for some android versions
I am using react-native-phone-number-input to get the phone number from the user. And using react-native-country-picker-modal to get the country codes to set the countrycode within the react-native-phone-number-input. This works fine in android API 30 without any errors. The IOS applications works fine as well.

But when I trying with android API 31 and android API 32 country codes are not loading.

Does anyone face this issue previously? what can be the reason for that? How can I solve this?

I tried with both debug and release APKs. with emulators and real devices (Mi POCO X3, SM-M21). Also tried the released android app bundle by downloading the google play store, and the internal testing group. But the thing is the same. In the console, I wasn't found any error messages.


问:
Why is basic math in Java showing up as 1.4 million times slower than Python?
I was experimenting to find how different the amount of time calculations took in Java and Python; I came up with an arbitrary expression to be evaluated in both languages and then took the amount of time that elapsed during the calculation and found that the time for Java was 1454584 ns while for Python, it was either 0 or 1000 ns (I'm guessing anything less than 1000 was rounded down to 0 or too small to be detected). Is Java really this slow to do relatively basic mathematical operations, or is there some difference in the way time is measured in these languages, or am I misunderstanding something about how calculations are performed? I am finding it hard to believe that there is that large of a time difference between the two, but if it is really just because of the languages, then why?

Here is my Java code, which gave the output for time elapsed of 1454584 ns in console. The calculation in result is just a random arbitrary calculation I came up with on the spot.

```<code>double result;
long start = System.nanoTime();
result = 10 + 5 - Math.pow(9, 3) * 10 / 5 + 3 - 3 - 2 - 100 * 2 + 9000 / 50 + 0.2 * 0.9 / 3 + 1 / Math.pow(3, 2) * 6;
long time = System.nanoTime() - start;
System.out.println("Result: " + result);
System.out.println("Time elapsed: " + time + " ns.");
</code>```

Here is my Python code, which gave a result of either 0 ns or 1000 ns over multiple trials.

```<code>start = time.time_ns()
result = 10 + 5 - 9 ** 3 * 10 / 5 + 3 - 3 - 2 - 100 * 2 + 9000 / 50 + 0.2 * 0.9 / 3 + 1 / 3 ** 2 * 6
finish = time.time_ns()
print("Result: ",result)
print("Time elapsed:",finish - start,"ns.")
</code>```

Body:
I was experimenting to find how different the amount of time calculations took in Java and Python; I came up with an arbitrary expression to be evaluated in both languages and then took the amount of time that elapsed during the calculation and found that the time for Java was 1454584 ns while for Python, it was either 0 or 1000 ns (I'm guessing anything less than 1000 was rounded down to 0 or too small to be detected). Is Java really this slow to do relatively basic mathematical operations, or is there some difference in the way time is measured in these languages, or am I misunderstanding something about how calculations are performed? I am finding it hard to believe that there is that large of a time difference between the two, but if it is really just because of the languages, then why?

Here is my Java code, which gave the output for time elapsed of 1454584 ns in console. The calculation in result is just a random arbitrary calculation I came up with on the spot.

double result;
long start = System.nanoTime();
result = 10 + 5 - Math.pow(9, 3) * 10 / 5 + 3 - 3 - 2 - 100 * 2 + 9000 / 50 + 0.2 * 0.9 / 3 + 1 / Math.pow(3, 2) * 6;
long time = System.nanoTime() - start;
System.out.println("Result: " + result);
System.out.println("Time elapsed: " + time + " ns.");

Here is my Python code, which gave a result of either 0 ns or 1000 ns over multiple trials.

start = time.time_ns()
result = 10 + 5 - 9 ** 3 * 10 / 5 + 3 - 3 - 2 - 100 * 2 + 9000 / 50 + 0.2 * 0.9 / 3 + 1 / 3 ** 2 * 6
finish = time.time_ns()
print("Result: ",result)
print("Time elapsed:",finish - start,"ns.")


问:
AED8C8C1CAC0 SQL (1064): You have an error in your SQL syntax;
when i am trying to execute sql procedure (call statement) and it gives me this error : "AED8C8C1CAC0 SQL (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on best_avg(tbl_name)' at line 1"

this code deletes the indexes for each table with field more than one

and there are no ideas how to fix it..

here is the code:

is the cause in execute statement ?
then how can that operation be performed?)

```<code> delimiter &&
 CREATE PROCEDURE dropping_indexes_excpt_for_primaryone()
 BEGIN
    DECLARE done INT DEFAULT 0;

    DECLARE tbl_name VARCHAR(200) DEFAULT '';

    DECLARE all_tables_cursor CURSOR for
     (SELECT TABLE_NAME
      FROM information_schema.tables
      WHERE table_schema = DATABASE()
      AND table_type = 'BASE TABLE');

    DECLARE CONTINUE handler FOR NOT FOUND SET done = 1;

    OPEN all_tables_cursor;
    tables_loop: LOOP
        fetch all_tables_cursor INTO tbl_name;
        if done then
            leave tables_loop;
        END if;
        BLOCK2: BEGIN
        DECLARE index_name VARCHAR(200) DEFAULT '';

        DECLARE done_attr INT DEFAULT 0;

        DECLARE all_indexes_cursor CURSOR FOR
            (SELECT index_name  FROM information_schema.STATISTICS AS inf
                WHERE TABLE_NAME = tbl_name AND table_schema= DATABASE() AND inf.index_name <>'PRIMARY'
                GROUP BY inf.index_name
                HAVING COUNT(*)>1
            );

        DECLARE CONTINUE handler FOR NOT FOUND SET done_attr = 1;

        OPEN all_indexes_cursor;
        indexes_loop: LOOP
            fetch all_indexes_cursor INTO index_name;
            if done_attr then leave indexes_loop;
            END if;

            SET @tmp = CONCAT('drop index ',index_name, ' on ', tbl_name);
            PREPARE dropping FROM @tmp;
            EXECUTE dropping;
            DEALLOCATE PREPARE dropping;
            END loop indexes_loop;
        close all_indexes_cursor;
        END BLOCK2;
        END loop tables_loop;
    close all_tables_cursor;
    END;
&&

DROP PROCEDURE dropping_indexes_excpt_for_primaryone
CALL dropping_indexes_excpt_for_primaryone()
</code>```

2 approaches were taken by me
the first is i replaced the "drop index" statement with "alter table"
and the second one is that i used "drop index" without an execute clause (but that didn`t work because tabl and index are strings)

Body:
when i am trying to execute sql procedure (call statement) and it gives me this error : "AED8C8C1CAC0 SQL (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on best_avg(tbl_name)' at line 1"

this code deletes the indexes for each table with field more than one

and there are no ideas how to fix it..

here is the code:

is the cause in execute statement ?
then how can that operation be performed?)

 delimiter &&
 CREATE PROCEDURE dropping_indexes_excpt_for_primaryone()
 BEGIN
    DECLARE done INT DEFAULT 0;

    DECLARE tbl_name VARCHAR(200) DEFAULT '';

    DECLARE all_tables_cursor CURSOR for
     (SELECT TABLE_NAME
      FROM information_schema.tables
      WHERE table_schema = DATABASE()
      AND table_type = 'BASE TABLE');

    DECLARE CONTINUE handler FOR NOT FOUND SET done = 1;

    OPEN all_tables_cursor;
    tables_loop: LOOP
        fetch all_tables_cursor INTO tbl_name;
        if done then
            leave tables_loop;
        END if;
        BLOCK2: BEGIN
        DECLARE index_name VARCHAR(200) DEFAULT '';

        DECLARE done_attr INT DEFAULT 0;

        DECLARE all_indexes_cursor CURSOR FOR
            (SELECT index_name  FROM information_schema.STATISTICS AS inf
                WHERE TABLE_NAME = tbl_name AND table_schema= DATABASE() AND inf.index_name <>'PRIMARY'
                GROUP BY inf.index_name
                HAVING COUNT(*)>1
            );

        DECLARE CONTINUE handler FOR NOT FOUND SET done_attr = 1;

        OPEN all_indexes_cursor;
        indexes_loop: LOOP
            fetch all_indexes_cursor INTO index_name;
            if done_attr then leave indexes_loop;
            END if;

            SET @tmp = CONCAT('drop index ',index_name, ' on ', tbl_name);
            PREPARE dropping FROM @tmp;
            EXECUTE dropping;
            DEALLOCATE PREPARE dropping;
            END loop indexes_loop;
        close all_indexes_cursor;
        END BLOCK2;
        END loop tables_loop;
    close all_tables_cursor;
    END;
&&

DROP PROCEDURE dropping_indexes_excpt_for_primaryone
CALL dropping_indexes_excpt_for_primaryone()

2 approaches were taken by me
the first is i replaced the "drop index" statement with "alter table"
and the second one is that i used "drop index" without an execute clause (but that didn`t work because tabl and index are strings)


问:
Does cgal library's polygon merge support floating point?
I am looking for a polygon merge library.
Polygons are made up of floating points.
Does anyone know of a merge library that supports floating point?</p>
```<code>Browse for 3 days
</code>```

Body:
I am looking for a polygon merge library.
Polygons are made up of floating points.
Does anyone know of a merge library that supports floating point?

Browse for 3 days


问:
Getting error while installing pyseer using miniconda
I am a new Miniconda user that needs to use pyseer to perform a GWAS study in regards to a bioinformatic pipeline. After downloading 64-bit Miniconda on Windows 11, I first created a new environment (bioinformatics3) and added the necessary channels according to pyseer documentation:

conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
```
<p>I want to install <code>pyseer</code> and its dependencies using:</p>
<pre class="lang-bash prettyprint-override"><code>conda install pyseer
</code>```

However, when I try running this, it always ends up looking something like:

(bioinformatics3) C:\Users\djian>conda install pyseer
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed

UnsatisfiableError:
```

I have already tried running this a couple of times and using the commands here as well, but still no luck.

Why is this happening? Any insight/solutions would be amazing and please note that I am a new Conda user with virtually no background in Python/command line since I only am familiar with R.

Body:
I am a new Miniconda user that needs to use pyseer to perform a GWAS study in regards to a bioinformatic pipeline. After downloading 64-bit Miniconda on Windows 11, I first created a new environment (bioinformatics3) and added the necessary channels according to pyseer documentation:

conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge

I want to install pyseer and its dependencies using:

conda install pyseer

However, when I try running this, it always ends up looking something like:

(bioinformatics3) C:\Users\djian>conda install pyseer
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed

UnsatisfiableError:

I have already tried running this a couple of times and using the commands here as well, but still no luck.

Why is this happening? Any insight/solutions would be amazing and please note that I am a new Conda user with virtually no background in Python/command line since I only am familiar with R.


问:
Automate Donut chart with cypress

If you see the above Donut chart, there are 2 parts which mean the above half of the pic is an area and the bottom is an area.

When I select that specific area and perform a hover action, it still points at the middle of the area, but not over the arc (colored part)

Can anyone help me to perform a hover action, that points over the arc?

Title: Automate Donut chart with cypress


问:
Why is foundObj._id showing undefined?
```<code>deleteCrypto(name){
      let foundObj = this.Cryptos.find(x => x.name === name);

      let indexOfArrayItem = this.Cryptos.findIndex(i => i._id === foundObj._id);

      axios.delete(`${this.baseApiURL}/delete-crypto/${foundObj._id}`).then(() => {
        this.Cryptos.splice(indexOfArrayItem, 1);

        this.getCryptos()
      }).catch(error => {
        console.log(error)
      });

</code>```

foundObj._id should evaluate to an _id field for a mongodb document but it evaluates to undefined.

Title: Why is foundObj._id showing undefined?

Body:
deleteCrypto(name){
      let foundObj = this.Cryptos.find(x => x.name === name);

      let indexOfArrayItem = this.Cryptos.findIndex(i => i._id === foundObj._id);

      axios.delete(`${this.baseApiURL}/delete-crypto/${foundObj._id}`).then(() => {
        this.Cryptos.splice(indexOfArrayItem, 1);

        this.getCryptos()
      }).catch(error => {
        console.log(error)
      });

foundObj._id should evaluate to an _id field for a mongodb document but it evaluates to undefined.


问:
What is this workboxOpts issue for, what does it mean and how can I resolve it?
While running the environment I get these warnings which didn't use to come first.
enter image description here

The below lines of code is my next.config.js file

```<code>const path = require('path');
const dotenv = require('dotenv');

const { withOffline } = require('next-offline-ts');
// const MiniCssExtractPlugin = require("mini-css-extract-plugin");

const { parsed } = dotenv.config({ path: `./config/.${process.env.ENVIRONMENT}` });
const { BUILD_DIRECTORY, BUILD_ID } = process.env
process.env.ENV_FILE = `./config/.${process.env.ENVIRONMENT}`

const withBundleAnalyzer = require('@next/bundle-analyzer')({ enabled: false })
module.exports = withBundleAnalyzer(
    // withLess(
    //  withCss(
    withOffline({
        workboxOpts: {
            runtimeCaching: [
                {
                    urlPattern: /\.cloudfront\.net\/static\/fonts\/.*$/,
                    handler: 'CacheFirst',
                    options: {
                        cacheName: 'custom-fonts',
                        expiration: {
                            maxEntries: 4,
                            maxAgeSeconds: 1 * 24 * 60 * 60 // 1 days
                        }
                    }
                },
                {
                    urlPattern: /\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,
                    handler: 'StaleWhileRevalidate',
                    options: {
                        cacheName: 'static-font-assets',
                        expiration: {
                            maxEntries: 20,
                            maxAgeSeconds: 7 * 24 * 60 * 60 // 7 days
                        }
                    }
                },
                {
                    urlPattern: /\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,
                    handler: 'StaleWhileRevalidate',
                    options: {
                        cacheName: 'static-image-assets',
                        expiration: {
                            maxEntries: 100,
                            maxAgeSeconds: 24 * 60 * 60 // 24 hours
                        }
                    }
                },
                {
                    urlPattern: /\.(?:js)$/i,
                    handler: 'StaleWhileRevalidate',
                    options: {
                        cacheName: 'static-js-assets',
                        expiration: {
                            maxEntries: 50,
                            maxAgeSeconds: 24 * 60 * 60 // 24 hours
                        }
                    }
                },
                {
                    urlPattern: /\.(?:css|less)$/i,
                    handler: 'StaleWhileRevalidate',
                    options: {
                        cacheName: 'static-style-assets',
                        expiration: {
                            maxEntries: 50,
                            maxAgeSeconds: 24 * 60 * 60 // 24 hours
                        }
                    }
                },
                {
                    urlPattern: /\.(?:json)$/i,
                    handler: 'StaleWhileRevalidate',
                    options: {
                        cacheName: 'static-data-assets',
                        expiration: {
                            maxEntries: 50,
                            maxAgeSeconds: 24 * 60 * 60 // 24 hours
                        }
                    }
                }
            ]
        },
        resolve: {
            modules: ['./../node_modules']
        },
        swcMinify: true,
        // webpack5: true,
        compress: false, //Disabled. We are already using `compression` package for it.
        generateBuildId: () => BUILD_ID,
        assetPrefix: process.env.CDN_PATH,
        // cssLoaderOptions: { url: false, },
        env: { 'customKey': parsed },
        poweredByHeader: false,
        useFileSystemPublicRoutes: true,
        distDir: BUILD_DIRECTORY,
        crossOrigin: 'anonymous',
        sassOptions: {
            includePaths: [path.join(__dirname, 'theme'), path.join(__dirname, 'theme/custom/')],
            prependData: `@import './theme/custom/variables.scss';`,
        },
        webpack: (config) => {
            /* FIXES NPM PACKAGES THAT DEPEND ON `FS` MODULE */
            config.resolve.fallback = {
                ...config.resolve.fallback,
                fs: false,
            };

            config.resolve.alias['@components'] = path.resolve(__dirname, 'components/')
            config.resolve.alias['@utils'] = path.resolve(__dirname, 'utils/')
            config.resolve.alias['@routes'] = path.resolve(__dirname, 'routes')
            config.resolve.alias['@theme'] = path.resolve(__dirname, 'theme')
            const originalEntry = config.entry;
            config.entry = async () => {
                const entries = await originalEntry();
                if (process.env.NODE_ENV != 'production') {
                    if (
                        entries['main.js'] &&
                        !entries['main.js'].includes('./polyfill/devPolyfills.js')
                    ) {
                        entries['main.js'].unshift('./polyfill/devPolyfills.js')
                    }
                    return entries;
                }

                if (
                    entries['main.js'] &&
                    !entries['main.js'].includes('./polyfill/prodPolyfills.js')
                ) {
                    entries['main.js'].unshift('./polyfill/prodPolyfills.js')
                }
                return entries;

            };

            /* LOADER FOR FONTS */
            config.module.rules.push({
                test: /\.(svg|eot|ttf|woff|woff2)$/,
                use: {
                    loader: 'url-loader',
                    options: {

                        limit: 5,
                        name: 'static/fonts/[hash].[ext]',
                        publicPath: '../../',
                    },
                },
            });

            /* LOADER FOR IMAGES */
            config.module.rules.push({
                test: /\.(jpe?g|png|gif|svg)$/i,
                use: {
                    loader: 'url-loader',
                    options: {
                        limit: 5,
                        name: 'static/css/[hash].[ext]',
                        publicPath: '../../',
                    },
                },
            });

            // config.optimization.splitChunks = {
            //  cacheGroups: {
            //      styles: {
            //          name: 'styles',
            //          test: /\.css$/,
            //          chunks: 'async',
            //          enforce: true,
            //          reuseExistingChunk: true
            //      }
            //  }
            // }

            // config.plugins.push(new MiniCssExtractPlugin({
            //  filename: process.env.NODE_ENV === 'production' ? 'static/css/[name].[chunkhash].css' : 'static/css/[name].css',
            //  chunkFilename: process.env.NODE_ENV === 'production' ? 'static/css/[id].[chunkhash].css' : 'static/css/[id].css',
            //  ignoreOrder: true,
            // }));

            config.resolve.symlinks = false;

            return config;
        }
    })
)

</code>```

The below lines of code is of my package.json :

```<code>"dependencies": {
        "@tippyjs/react": "^4.2.6",
        "archiver": "^5.3.1",
        "axios": "^0.18.1",
        "body-parser": "^1.20.0",
        "braintree-web-drop-in": "1.32.0",
        "compression": "^1.7.4",
        "cookie-parser": "^1.4.6",
        "cors": "^2.8.5",
        "dotenv": "^16.0.0",
        "express": "^4.17.3",
        "express-device": "^0.4.2",
        "fine-uploader": "^5.16.2",
        "fine-uploader-wrappers": "^1.0.1",
        "http-proxy-middleware": "^2.0.5",
        "intersection-observer": "^0.12.0",
        "js-base64": "^2.5.2",
        "lodash": "^4.17.21",
        "multer": "^1.4.4",
        "next": "^12.1.5",
        "next-offline-ts": "^6.1.7",
        "next-routes": "^1.4.2",
        "next-routes-extended": "^1.7.0",
        "nprogress": "^0.2.0",
        "prop-types": "^15.8.1",
        "querystring": "^0.2.1",
        "react": "^17.0.2",
        "react-color": "^2.17.3",
        "react-content-loader": "^6.2.0",
        "react-dom": "^17.0.2",
        "react-fine-uploader": "^1.1.1",
        "react-google-invisible-recaptcha": "^0.2.12",
        "react-gtm-module": "^2.0.11",
        "react-iframe": "^1.8.0",
        "react-image-lightbox": "^5.1.4",
        "react-infinite-scroller": "^1.2.6",
        "react-intersection-observer": "^8.34.0",
        "react-intl-tel-input": "^8.2.0",
        "react-masonry-component": "^6.3.0",
        "react-metismenu": "^1.4.0",
        "react-redux": "^7.2.8",
        "react-responsive-tabs": "^4.4.3",
        "react-select": "^5.3.0",
        "react-slick": "^0.29.0",
        "react-smooth-scrollbar": "^8.0.6",
        "react-social-login": "^3.4.15",
        "react-to-print": "^2.14.6",
        "redis": "^4.0.6",
        "redux": "^4.2.0",
        "redux-thunk": "^2.4.1",
        "request": "^2.88.2",
        "smooth-scrollbar": "^8.7.4",
        "smoothscroll-polyfill": "^0.4.4",
        "sprintf-js": "^1.1.2",
        "sweetalert": "^2.1.2",
        "universal-cookie": "^4.0.4",
        "validator": "^13.7.0",
        "xml-js": "^1.6.11",
        "xml2js": "^0.4.23"
    },
    "license": "ISC",
    "devDependencies": {
        "@babel/core": "^7.17.9",
        "@next/bundle-analyzer": "^12.1.5",
        "@redux-devtools/extension": "^3.2.2",
        "@testing-library/jest-dom": "^5.16.4",
        "@testing-library/react": "^13.1.1",
        "babel-jest": "^27.5.1",
        "cross-env": "^7.0.3",
        "css-loader": "^6.7.1",
        "eslint": "^8.13.0",
        "eslint-config-kentcdodds": "^20.2.0",
        "eslint-plugin-css-modules": "^2.11.0",
        "eslint-plugin-prettier": "^4.0.0",
        "eslint-plugin-react": "^7.29.4",
        "file-loader": "^6.2.0",
        "husky": "^4.2.5",
        "identity-obj-proxy": "^3.0.0",
        "image-size": "^1.0.1",
        "jest": "^27.5.1",
        "less": "^4.1.2",
        "less-loader": "^10.2.0",
        "lint-staged": "^7.2.2",
        "mini-css-extract-plugin": "^2.6.0",
        "raw-loader": "^4.0.2",
        "react-test-renderer": "^17.0.2",
        "redux-promise-middleware": "^6.1.2",
        "sass": "^1.50.1",
        "sass-loader": "^12.6.0",
        "sass-resources-loader": "^2.2.5",
        "stylelint": "^14.7.1",
        "url-loader": "^4.1.1"
    },
    "lint-staged": {
        "*.js": [
            "eslint --fix",
            "git add"
        ]
    }
</code>```

What I actually did was I upgraded my next version from 9 to 12, so after that when I was trying to run my environment it displayed a couple of warnings in the vsc terminal. Can you please help me out to understand what caused this warning or what does it mean, and how can I get rid of it?

Commenting out the workboxOpts helps in getting rid of the warning but that doesn't seem to be the best approach here.

Body:
While running the environment I get these warnings which didn't use to come first.
enter image description here

The below lines of code is my next.config.js file

const path = require('path');
const dotenv = require('dotenv');

const { withOffline } = require('next-offline-ts');
// const MiniCssExtractPlugin = require("mini-css-extract-plugin");

const { parsed } = dotenv.config({ path: `./config/.${process.env.ENVIRONMENT}` });
const { BUILD_DIRECTORY, BUILD_ID } = process.env
process.env.ENV_FILE = `./config/.${process.env.ENVIRONMENT}`

const withBundleAnalyzer = require('@next/bundle-analyzer')({ enabled: false })
module.exports = withBundleAnalyzer(
    // withLess(
    //  withCss(
    withOffline({
        workboxOpts: {
            runtimeCaching: [
                {
                    urlPattern: /\.cloudfront\.net\/static\/fonts\/.*$/,
                    handler: 'CacheFirst',
                    options: {
                        cacheName: 'custom-fonts',
                        expiration: {
                            maxEntries: 4,
                            maxAgeSeconds: 1 * 24 * 60 * 60 // 1 days
                        }
                    }
                },
                {
                    urlPattern: /\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,
                    handler: 'StaleWhileRevalidate',
                    options: {
                        cacheName: 'static-font-assets',
                        expiration: {
                            maxEntries: 20,
                            maxAgeSeconds: 7 * 24 * 60 * 60 // 7 days
                        }
                    }
                },
                {
                    urlPattern: /\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,
                    handler: 'StaleWhileRevalidate',
                    options: {
                        cacheName: 'static-image-assets',
                        expiration: {
                            maxEntries: 100,
                            maxAgeSeconds: 24 * 60 * 60 // 24 hours
                        }
                    }
                },
                {
                    urlPattern: /\.(?:js)$/i,
                    handler: 'StaleWhileRevalidate',
                    options: {
                        cacheName: 'static-js-assets',
                        expiration: {
                            maxEntries: 50,
                            maxAgeSeconds: 24 * 60 * 60 // 24 hours
                        }
                    }
                },
                {
                    urlPattern: /\.(?:css|less)$/i,
                    handler: 'StaleWhileRevalidate',
                    options: {
                        cacheName: 'static-style-assets',
                        expiration: {
                            maxEntries: 50,
                            maxAgeSeconds: 24 * 60 * 60 // 24 hours
                        }
                    }
                },
                {
                    urlPattern: /\.(?:json)$/i,
                    handler: 'StaleWhileRevalidate',
                    options: {
                        cacheName: 'static-data-assets',
                        expiration: {
                            maxEntries: 50,
                            maxAgeSeconds: 24 * 60 * 60 // 24 hours
                        }
                    }
                }
            ]
        },
        resolve: {
            modules: ['./../node_modules']
        },
        swcMinify: true,
        // webpack5: true,
        compress: false, //Disabled. We are already using `compression` package for it.
        generateBuildId: () => BUILD_ID,
        assetPrefix: process.env.CDN_PATH,
        // cssLoaderOptions: { url: false, },
        env: { 'customKey': parsed },
        poweredByHeader: false,
        useFileSystemPublicRoutes: true,
        distDir: BUILD_DIRECTORY,
        crossOrigin: 'anonymous',
        sassOptions: {
            includePaths: [path.join(__dirname, 'theme'), path.join(__dirname, 'theme/custom/')],
            prependData: `@import './theme/custom/variables.scss';`,
        },
        webpack: (config) => {
            /* FIXES NPM PACKAGES THAT DEPEND ON `FS` MODULE */
            config.resolve.fallback = {
                ...config.resolve.fallback,
                fs: false,
            };

            config.resolve.alias['@components'] = path.resolve(__dirname, 'components/')
            config.resolve.alias['@utils'] = path.resolve(__dirname, 'utils/')
            config.resolve.alias['@routes'] = path.resolve(__dirname, 'routes')
            config.resolve.alias['@theme'] = path.resolve(__dirname, 'theme')
            const originalEntry = config.entry;
            config.entry = async () => {
                const entries = await originalEntry();
                if (process.env.NODE_ENV != 'production') {
                    if (
                        entries['main.js'] &&
                        !entries['main.js'].includes('./polyfill/devPolyfills.js')
                    ) {
                        entries['main.js'].unshift('./polyfill/devPolyfills.js')
                    }
                    return entries;
                }

                if (
                    entries['main.js'] &&
                    !entries['main.js'].includes('./polyfill/prodPolyfills.js')
                ) {
                    entries['main.js'].unshift('./polyfill/prodPolyfills.js')
                }
                return entries;

            };

            /* LOADER FOR FONTS */
            config.module.rules.push({
                test: /\.(svg|eot|ttf|woff|woff2)$/,
                use: {
                    loader: 'url-loader',
                    options: {

                        limit: 5,
                        name: 'static/fonts/[hash].[ext]',
                        publicPath: '../../',
                    },
                },
            });

            /* LOADER FOR IMAGES */
            config.module.rules.push({
                test: /\.(jpe?g|png|gif|svg)$/i,
                use: {
                    loader: 'url-loader',
                    options: {
                        limit: 5,
                        name: 'static/css/[hash].[ext]',
                        publicPath: '../../',
                    },
                },
            });

            // config.optimization.splitChunks = {
            //  cacheGroups: {
            //      styles: {
            //          name: 'styles',
            //          test: /\.css$/,
            //          chunks: 'async',
            //          enforce: true,
            //          reuseExistingChunk: true
            //      }
            //  }
            // }

            // config.plugins.push(new MiniCssExtractPlugin({
            //  filename: process.env.NODE_ENV === 'production' ? 'static/css/[name].[chunkhash].css' : 'static/css/[name].css',
            //  chunkFilename: process.env.NODE_ENV === 'production' ? 'static/css/[id].[chunkhash].css' : 'static/css/[id].css',
            //  ignoreOrder: true,
            // }));

            config.resolve.symlinks = false;

            return config;
        }
    })
)

The below lines of code is of my package.json :

"dependencies": {
        "@tippyjs/react": "^4.2.6",
        "archiver": "^5.3.1",
        "axios": "^0.18.1",
        "body-parser": "^1.20.0",
        "braintree-web-drop-in": "1.32.0",
        "compression": "^1.7.4",
        "cookie-parser": "^1.4.6",
        "cors": "^2.8.5",
        "dotenv": "^16.0.0",
        "express": "^4.17.3",
        "express-device": "^0.4.2",
        "fine-uploader": "^5.16.2",
        "fine-uploader-wrappers": "^1.0.1",
        "http-proxy-middleware": "^2.0.5",
        "intersection-observer": "^0.12.0",
        "js-base64": "^2.5.2",
        "lodash": "^4.17.21",
        "multer": "^1.4.4",
        "next": "^12.1.5",
        "next-offline-ts": "^6.1.7",
        "next-routes": "^1.4.2",
        "next-routes-extended": "^1.7.0",
        "nprogress": "^0.2.0",
        "prop-types": "^15.8.1",
        "querystring": "^0.2.1",
        "react": "^17.0.2",
        "react-color": "^2.17.3",
        "react-content-loader": "^6.2.0",
        "react-dom": "^17.0.2",
        "react-fine-uploader": "^1.1.1",
        "react-google-invisible-recaptcha": "^0.2.12",
        "react-gtm-module": "^2.0.11",
        "react-iframe": "^1.8.0",
        "react-image-lightbox": "^5.1.4",
        "react-infinite-scroller": "^1.2.6",
        "react-intersection-observer": "^8.34.0",
        "react-intl-tel-input": "^8.2.0",
        "react-masonry-component": "^6.3.0",
        "react-metismenu": "^1.4.0",
        "react-redux": "^7.2.8",
        "react-responsive-tabs": "^4.4.3",
        "react-select": "^5.3.0",
        "react-slick": "^0.29.0",
        "react-smooth-scrollbar": "^8.0.6",
        "react-social-login": "^3.4.15",
        "react-to-print": "^2.14.6",
        "redis": "^4.0.6",
        "redux": "^4.2.0",
        "redux-thunk": "^2.4.1",
        "request": "^2.88.2",
        "smooth-scrollbar": "^8.7.4",
        "smoothscroll-polyfill": "^0.4.4",
        "sprintf-js": "^1.1.2",
        "sweetalert": "^2.1.2",
        "universal-cookie": "^4.0.4",
        "validator": "^13.7.0",
        "xml-js": "^1.6.11",
        "xml2js": "^0.4.23"
    },
    "license": "ISC",
    "devDependencies": {
        "@babel/core": "^7.17.9",
        "@next/bundle-analyzer": "^12.1.5",
        "@redux-devtools/extension": "^3.2.2",
        "@testing-library/jest-dom": "^5.16.4",
        "@testing-library/react": "^13.1.1",
        "babel-jest": "^27.5.1",
        "cross-env": "^7.0.3",
        "css-loader": "^6.7.1",
        "eslint": "^8.13.0",
        "eslint-config-kentcdodds": "^20.2.0",
        "eslint-plugin-css-modules": "^2.11.0",
        "eslint-plugin-prettier": "^4.0.0",
        "eslint-plugin-react": "^7.29.4",
        "file-loader": "^6.2.0",
        "husky": "^4.2.5",
        "identity-obj-proxy": "^3.0.0",
        "image-size": "^1.0.1",
        "jest": "^27.5.1",
        "less": "^4.1.2",
        "less-loader": "^10.2.0",
        "lint-staged": "^7.2.2",
        "mini-css-extract-plugin": "^2.6.0",
        "raw-loader": "^4.0.2",
        "react-test-renderer": "^17.0.2",
        "redux-promise-middleware": "^6.1.2",
        "sass": "^1.50.1",
        "sass-loader": "^12.6.0",
        "sass-resources-loader": "^2.2.5",
        "stylelint": "^14.7.1",
        "url-loader": "^4.1.1"
    },
    "lint-staged": {
        "*.js": [
            "eslint --fix",
            "git add"
        ]
    }

What I actually did was I upgraded my next version from 9 to 12, so after that when I was trying to run my environment it displayed a couple of warnings in the vsc terminal. Can you please help me out to understand what caused this warning or what does it mean, and how can I get rid of it?

Commenting out the workboxOpts helps in getting rid of the warning but that doesn't seem to be the best approach here.


问:
what is alt mempool in EIP-4337 (Account Abstraction)
In https://eips.ethereum.org/EIPS/eip-4337, the authors say "Users send UserOperation objects into a separate mempool". i was wondering what it means.. and now, i think that they refer to off-chain memory pool for storing Pending UserOperation(High-level Transaction). so, i think that 'alt mempool' is probably 'alternative memory pool' that is implemented based distributed in-memory key-value store (e.g. Redis) that stores pending UserOperations.

Did I understand correctly? how do you think about it?

what i did : read and read and think.. about eip-4337.

what i expect : check whether i understand it correctly or not


问:
Approach or method to train ML Model for text data (input & output)?
I'm new in machine learning and want to know is there best approach to train ML model using tabular request and response data (appx. 1 Million record data).

This ML will be used to create mockup server that can reply based on request it received.

For example:

Training data example 1:

```<code>Request:
{
  "type" : "weather",
  "location" : "CA",
  "requester" : "Joe"
}
Response:
{
  "type" : "weather",
  "location" : "CA",
  "requester" : "Joe",
  "weather" : "sunny"
}

</code>```

Training data example 2:

```<code>Request:

<?xml version="1.0" encoding="UTF-8" ?>
<root>
    <type>humidity</type>
    <location>LA</location>
    <requester>David</requester>
</root>

Response:

<?xml version="1.0" encoding="UTF-8" ?>
<root>
    <type>humidity</type>
    <location>LA</location>
    <requester>David</requester>
    <humidity>29</humidity>
    <ends>2 hour</ends>
</root>
</code>```

Based on example of above training data, it can give response prediction like this:

```<code>Request (random):
{
  "type" : "weather",
  "location" : "AZ",
  "requester" : "Joseph"
}
Response (predicted):
{
  "type" : "weather",
  "location" : "AZ",
  "requester" : "joseph",
  "weather" : "Rainy"
}

</code>```
```<code>Request(random):

<?xml version="1.0" encoding="UTF-8" ?>
<root>
    <type>humidity</type>
    <location>DC</location>
    <requester>Karen</requester>
</root>

Response (predicted):

<?xml version="1.0" encoding="UTF-8" ?>
<root>
    <type>humidity</type>
    <location>DC</location>
    <requester>Karen</requester>
    <humidity>23</humidity>
    <ends>7 hour</ends>
</root>
</code>```

What is the best ML method for the above prediction?
Thank you! I've tried to read and learn some approaches but still cannot find the right one.

Body:
I'm new in machine learning and want to know is there best approach to train ML model using tabular request and response data (appx. 1 Million record data).

This ML will be used to create mockup server that can reply based on request it received.

For example:

Training data example 1:

Request:
{
  "type" : "weather",
  "location" : "CA",
  "requester" : "Joe"
}
Response:
{
  "type" : "weather",
  "location" : "CA",
  "requester" : "Joe",
  "weather" : "sunny"
}

Training data example 2:

Request:

<?xml version="1.0" encoding="UTF-8" ?>
<root>
    <type>humidity</type>
    <location>LA</location>
    <requester>David</requester>
</root>

Response:

<?xml version="1.0" encoding="UTF-8" ?>
<root>
    <type>humidity</type>
    <location>LA</location>
    <requester>David</requester>
    <humidity>29</humidity>
    <ends>2 hour</ends>
</root>

Based on example of above training data, it can give response prediction like this:

Request (random):
{
  "type" : "weather",
  "location" : "AZ",
  "requester" : "Joseph"
}
Response (predicted):
{
  "type" : "weather",
  "location" : "AZ",
  "requester" : "joseph",
  "weather" : "Rainy"
}

Request(random):

<?xml version="1.0" encoding="UTF-8" ?>
<root>
    <type>humidity</type>
    <location>DC</location>
    <requester>Karen</requester>
</root>

Response (predicted):

<?xml version="1.0" encoding="UTF-8" ?>
<root>
    <type>humidity</type>
    <location>DC</location>
    <requester>Karen</requester>
    <humidity>23</humidity>
    <ends>7 hour</ends>
</root>

What is the best ML method for the above prediction?
Thank you! I've tried to read and learn some approaches but still cannot find the right one.


问:
React.JS Next.JS error importing private NPM library bumps into TypeError: _mui_styles_makeStyles__WEBPACK_IMPORTED_MODULE_12__ is not a function
I have a private NPM library using typescript exposed through index.js and hosted on private github packages. Importing it in my React.JS Next.JS application bumps into the following runtime error:

```<code>error - unhandledRejection: TypeError: _mui_styles_makeStyles__WEBPACK_IMPORTED_MODULE_12__ is not a function
    at eval (webpack-internal:///../../node_modules/@myorg/mylib/build/index.js:106:21)
    at ../../node_modules/@myorg/gvs-kit/build/index.js (/apps/api/.next/server/pages/_app.js:11913:1)
    at __webpack_require__ (/apps/api/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./src/modules/MyModule/myFunction.ts:14:76)
    at ./src/modules/MyModule/myFunction.ts (/apps/api/.next/server/pages/_app.js:10303:1)
    at __webpack_require__ (/apps/api/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./src/auth/AuthProvider.tsx:13:85)
    at ./src/auth/AuthProvider.tsx (/apps/api/.next/server/pages/_app.js:10083:1)
    at __webpack_require__ (/apps/api/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./src/app/App.tsx:13:76)
    at ./src/app/App.tsx (/apps/api/.next/server/pages/_app.js:10017:1)
    at __webpack_require__ (/apps/api/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./src/app/Providers.tsx:24:63)
    at ./src/app/Providers.tsx (/apps/api/.next/server/pages/_app.js:10028:1)
    at __webpack_require__ (/apps/api/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./pages/_app.tsx:16:76)
    at ./pages/_app.tsx (/apps/api/.next/server/pages/_app.js:9984:1)
    at __webpack_require__ (/apps/api/.next/server/webpack-runtime.js:33:42)
    at __webpack_exec__ (/apps/api/.next/server/pages/_app.js:11934:39)
    at /apps/api/.next/server/pages/_app.js:11935:28
    at Object.<anonymous> (/apps/api/.next/server/pages/_app.js:11938:3)
    at Module._compile (node:internal/modules/cjs/loader:1119:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
    at Module.load (node:internal/modules/cjs/loader:997:32)
    at Module._load (node:internal/modules/cjs/loader:838:12)
    at Module.require (node:internal/modules/cjs/loader:1021:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.requirePage (/node_modules/next/dist/server/require.js:88:12)
    at /node_modules/next/dist/server/load-components.js:34:54
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 1)
    at async Object.loadComponents (/node_modules/next/dist/server/load-components.js:32:33)
    at async DevServer.findPageComponents (/node_modules/next/dist/server/next-server.js:561:36) {
  page: '/'
}
null
</code>```

Examining the exception line in .next/server/pages/_app.js shows the following:

```<code>var _mui_styles_makeStyles__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @mui/styles/makeStyles */ \"../../node_modules/@myorg/mylib/node_modules/@mui/styles/node/makeStyles/index.js\");\n/* harmony import */
</code>```

What do I miss?

Body:
I have a private NPM library using typescript exposed through index.js and hosted on private github packages. Importing it in my React.JS Next.JS application bumps into the following runtime error:

error - unhandledRejection: TypeError: _mui_styles_makeStyles__WEBPACK_IMPORTED_MODULE_12__ is not a function
    at eval (webpack-internal:///../../node_modules/@myorg/mylib/build/index.js:106:21)
    at ../../node_modules/@myorg/gvs-kit/build/index.js (/apps/api/.next/server/pages/_app.js:11913:1)
    at __webpack_require__ (/apps/api/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./src/modules/MyModule/myFunction.ts:14:76)
    at ./src/modules/MyModule/myFunction.ts (/apps/api/.next/server/pages/_app.js:10303:1)
    at __webpack_require__ (/apps/api/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./src/auth/AuthProvider.tsx:13:85)
    at ./src/auth/AuthProvider.tsx (/apps/api/.next/server/pages/_app.js:10083:1)
    at __webpack_require__ (/apps/api/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./src/app/App.tsx:13:76)
    at ./src/app/App.tsx (/apps/api/.next/server/pages/_app.js:10017:1)
    at __webpack_require__ (/apps/api/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./src/app/Providers.tsx:24:63)
    at ./src/app/Providers.tsx (/apps/api/.next/server/pages/_app.js:10028:1)
    at __webpack_require__ (/apps/api/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./pages/_app.tsx:16:76)
    at ./pages/_app.tsx (/apps/api/.next/server/pages/_app.js:9984:1)
    at __webpack_require__ (/apps/api/.next/server/webpack-runtime.js:33:42)
    at __webpack_exec__ (/apps/api/.next/server/pages/_app.js:11934:39)
    at /apps/api/.next/server/pages/_app.js:11935:28
    at Object.<anonymous> (/apps/api/.next/server/pages/_app.js:11938:3)
    at Module._compile (node:internal/modules/cjs/loader:1119:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
    at Module.load (node:internal/modules/cjs/loader:997:32)
    at Module._load (node:internal/modules/cjs/loader:838:12)
    at Module.require (node:internal/modules/cjs/loader:1021:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.requirePage (/node_modules/next/dist/server/require.js:88:12)
    at /node_modules/next/dist/server/load-components.js:34:54
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 1)
    at async Object.loadComponents (/node_modules/next/dist/server/load-components.js:32:33)
    at async DevServer.findPageComponents (/node_modules/next/dist/server/next-server.js:561:36) {
  page: '/'
}
null

Examining the exception line in .next/server/pages/_app.js shows the following:

var _mui_styles_makeStyles__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @mui/styles/makeStyles */ \"../../node_modules/@myorg/mylib/node_modules/@mui/styles/node/makeStyles/index.js\");\n/* harmony import */

What do I miss?


问:
GraphXR in React
Can I embed GraphXR in a React application so that a user can interact with it or is it only possible to embed it in a view format?

I looked online but found very little information on this, if someone has worked on this before it would help me get a clearer picture.

Title: GraphXR in React


问:
React Page contents are not rendering in React (With Redux) without a manual refresh
I am new to React and currently doing a demo project in React - with Redux. I have designed a Homepage, But it's contents are not rendering on initial loading. The contents are loading perfectly after manually refreshing the page.

This is my UNSAFE_ComponentWillMount in Home.js

```<code> export class Home extends Component {

 componentDidMount() {
  const id =this.props.userinfo.id
   axios.get(`http://localhost:8081/api/accounts/check/${id}`,id)
  .then(response => {
    console.log(response)
    if(response.status === 404){
      window.location.assign('/activate')
    }
  })
  .catch(err =>{
    console.log(err)
    window.location.assign('/activate')
  })
  this.props.initalAccountState(id)
  this.props.getBudgetsApi(id)
 }
.........
........
........
    const mapStateToProps = (state) =>{
      return{
        userinfo: state.user.user,
        accountinfo : state.account.accountDetails,
        checkAccount : state.account.checkAccount,
        isvalid:state.account.isvalid,
        budgetinfo:state.budget.budgetsinfo

      }
    }

    export default connect(mapStateToProps,{initalAccountState, checkAccountActivationApi,getBudgetsApi})(Home)
</code>```

I replaced the UNSAFE_ComponentWillMount with ComponentDidMount and tried, but it not solved my problem.

This is the function in Redux Action to perform an API call to fetch the details.

```<code>//Api call for inital fetching of  Account details
export const initalAccountState =(id)=>{
    return (dispatch) =>{
        axios.get(`http://localhost:8081/api/accounts/getdetails/${id}`,id)
        .then(response => {
            console.log(response)
            dispatch(getAccountDetails(response.data))

        })
        .catch(err => {
            console.log(err)
        })
    }
}
</code>```

This is my Router.js

```<code> <Routes>
              {/* Protected Routes */}
              <Route element={<PrivateRoutes/>}>
                <Route path='/expenses' element={<Expenses/>} />
                <Route path="/home" element={<Home></Home>}></Route>
<Routes>
</code>```

How Can I solve this Problem?
Please help me..

Body:
I am new to React and currently doing a demo project in React - with Redux. I have designed a Homepage, But it's contents are not rendering on initial loading. The contents are loading perfectly after manually refreshing the page.

This is my UNSAFE_ComponentWillMount in Home.js

 export class Home extends Component {

 componentDidMount() {
  const id =this.props.userinfo.id
   axios.get(`http://localhost:8081/api/accounts/check/${id}`,id)
  .then(response => {
    console.log(response)
    if(response.status === 404){
      window.location.assign('/activate')
    }
  })
  .catch(err =>{
    console.log(err)
    window.location.assign('/activate')
  })
  this.props.initalAccountState(id)
  this.props.getBudgetsApi(id)
 }
.........
........
........
    const mapStateToProps = (state) =>{
      return{
        userinfo: state.user.user,
        accountinfo : state.account.accountDetails,
        checkAccount : state.account.checkAccount,
        isvalid:state.account.isvalid,
        budgetinfo:state.budget.budgetsinfo

      }
    }

    export default connect(mapStateToProps,{initalAccountState, checkAccountActivationApi,getBudgetsApi})(Home)

I replaced the UNSAFE_ComponentWillMount with ComponentDidMount and tried, but it not solved my problem.

This is the function in Redux Action to perform an API call to fetch the details.

//Api call for inital fetching of  Account details
export const initalAccountState =(id)=>{
    return (dispatch) =>{
        axios.get(`http://localhost:8081/api/accounts/getdetails/${id}`,id)
        .then(response => {
            console.log(response)
            dispatch(getAccountDetails(response.data))

        })
        .catch(err => {
            console.log(err)
        })
    }
}

This is my Router.js

 <Routes>
              {/* Protected Routes */}
              <Route element={<PrivateRoutes/>}>
                <Route path='/expenses' element={<Expenses/>} />
                <Route path="/home" element={<Home></Home>}></Route>
<Routes>

How Can I solve this Problem?
Please help me..