问:
Android Studio - OpenCSV - Error java.io.FileNotFoundException: teste.csv: open failed: ENOENT (No such file or directory)
I'm having some trouble working with OpenCSV in Android Studio. When I try to reference a file, it gives me the following error: "java.io.FileNotFoundException: teste.csv: open failed: ENOENT (No such file or directory)".

Specs:
*Windows 10
*Android Studio Dolphin | 2021.3.1 Patch 1
**Project on Android Studio: "No activity"
*OpenCSV 5.7.1

MainActivity code (UPDATED with codes InputStream, InputStreamReader, BufferedReader):

```<code>package com.example.testecsv;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.content.res.AssetManager;
import android.os.Bundle;

import com.opencsv.CSVParserBuilder;
import com.opencsv.CSVReader;
import com.opencsv.CSVReaderBuilder;
import com.opencsv.exceptions.CsvValidationException;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Field;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        try {
            //#1 InputStreamReader code (no error)
            InputStreamReader isr = new InputStreamReader(getAssets().open("teste.csv"));

            //#2 InputStream code (no error)
            InputStream is = getAssets().open("teste.csv");

            //#3 BufferedReader code (no error)
            BufferedReader br = new BufferedReader(new InputStreamReader(getAssets().open("teste.csv"), "UTF-8"));

            // Code retrieved from OpenCSV site and documentation
            // New example from original post, got from OpenCSV documentation --> WHAT DO I PUT INSIDE "FileReader" ???
            CSVReader reader = new CSVReaderBuilder(new FileReader("teste.csv")).build();
            String [] nextLine;
            while ((nextLine = reader.readNext()) != null) {
                // nextLine[] is an array of values from the line
                System.out.println(nextLine[0] + nextLine[1] + "etc...");
            }

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (CsvValidationException e) {
            e.printStackTrace();
        }

    }

}
</code>```

The file exists on both "assets" folder and "res/raw" folder. Android Studio finds the FILE, but the compilation don't (on virtual or on physical device), here's some details of the error:

```<code>2022-12-18 15:39:15.232 13198-13198 System.err              com.example.testecsv                 W  java.io.FileNotFoundException: teste.csv: open failed: ENOENT (No such file or directory)
2022-12-18 15:39:15.280 13198-13198 System.err              com.example.testecsv                 W      at libcore.io.IoBridge.open(IoBridge.java:574)
2022-12-18 15:39:15.281 13198-13198 System.err              com.example.testecsv                 W      at java.io.FileInputStream.<init>(FileInputStream.java:160)
2022-12-18 15:39:15.283 13198-13198 System.err              com.example.testecsv                 W      at java.io.FileInputStream.<init>(FileInputStream.java:115)
2022-12-18 15:39:15.284 13198-13198 System.err              com.example.testecsv                 W      at java.io.FileReader.<init>(FileReader.java:60)
2022-12-18 15:39:15.285 13198-13198 System.err              com.example.testecsv                 W      at com.example.testecsv.MainActivity.onCreate(MainActivity.java:25)
2022-12-18 15:39:15.289 13198-13198 System.err              com.example.testecsv                 W      at android.app.Activity.performCreate(Activity.java:8305)
2022-12-18 15:39:15.289 13198-13198 System.err              com.example.testecsv                 W      at android.app.Activity.performCreate(Activity.java:8284)
2022-12-18 15:39:15.290 13198-13198 System.err              com.example.testecsv                 W      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
2022-12-18 15:39:15.291 13198-13198 System.err              com.example.testecsv                 W      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3626)
2022-12-18 15:39:15.292 13198-13198 System.err              com.example.testecsv                 W      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782)
2022-12-18 15:39:15.292 13198-13198 System.err              com.example.testecsv                 W      at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
2022-12-18 15:39:15.293 13198-13198 System.err              com.example.testecsv                 W      at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
2022-12-18 15:39:15.296 13198-13198 System.err              com.example.testecsv                 W      at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
2022-12-18 15:39:15.298 13198-13198 System.err              com.example.testecsv                 W      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
2022-12-18 15:39:15.299 13198-13198 System.err              com.example.testecsv                 W      at android.os.Handler.dispatchMessage(Handler.java:106)
2022-12-18 15:39:15.301 13198-13198 System.err              com.example.testecsv                 W      at android.os.Looper.loopOnce(Looper.java:201)
2022-12-18 15:39:15.301 13198-13198 System.err              com.example.testecsv                 W      at android.os.Looper.loop(Looper.java:288)
2022-12-18 15:39:15.302 13198-13198 System.err              com.example.testecsv                 W      at android.app.ActivityThread.main(ActivityThread.java:7872)
2022-12-18 15:39:15.304 13198-13198 System.err              com.example.testecsv                 W      at java.lang.reflect.Method.invoke(Native Method)
2022-12-18 15:39:15.306 13198-13198 System.err              com.example.testecsv                 W      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
2022-12-18 15:39:15.308 13198-13198 System.err              com.example.testecsv                 W      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
2022-12-18 15:39:15.314 13198-13198 System.err              com.example.testecsv                 W  Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
2022-12-18 15:39:15.316 13198-13198 System.err              com.example.testecsv                 W      at libcore.io.Linux.open(Native Method)
2022-12-18 15:39:15.316 13198-13198 System.err              com.example.testecsv                 W      at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
2022-12-18 15:39:15.317 13198-13198 System.err              com.example.testecsv                 W      at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
2022-12-18 15:39:15.318 13198-13198 System.err              com.example.testecsv                 W      at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
2022-12-18 15:39:15.318 13198-13198 System.err              com.example.testecsv                 W      at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7758)
2022-12-18 15:39:15.322 13198-13198 System.err              com.example.testecsv                 W      at libcore.io.IoBridge.open(IoBridge.java:560)
2022-12-18 15:39:15.324 13198-13198 System.err              com.example.testecsv                 W      ... 20 more
</code>```

I've tried a lot of codes, answers from internet (stackoverflow included), examples from documentation and outside documentation, but still struggling trying to simply READ a .csv file. It doesn't matter which code I write, it always can't find the file path, giving the error above (the code more above I wrote just to post it here like an example). I also tried using
"InputStream", "AssetManager", "FileInputStream" and a few others commands and codes. It still 4 days and it's stressing me out. I'm using my last resort which is asking here. I'm not an advanced programmer, I'm just trying to build a simple app to help some people. The answer might be something very simple, but I can't find it, and I'm feeling down, almost giving up to something so simple. Please be kind. Thanks for all who might help me.

EDIT 1:

With the following added code, I can read the .csv file by the normal way, but I'm still struggling how I can link this code with the OpenCSV Code.

```<code>BufferedReader br = new BufferedReader(new InputStreamReader(getAssets().open("teste.csv"), "UTF-8"));
ArrayList lines = new ArrayList<String>();
String newLine;
    while ((newLine = br.readLine()) != null) {
        System.out.println(newLine);
        lines.add(newLine);
    }
br.close();
</code>```

Body:
I'm having some trouble working with OpenCSV in Android Studio. When I try to reference a file, it gives me the following error: "java.io.FileNotFoundException: teste.csv: open failed: ENOENT (No such file or directory)".

Specs:
*Windows 10
*Android Studio Dolphin | 2021.3.1 Patch 1
**Project on Android Studio: "No activity"
*OpenCSV 5.7.1

MainActivity code (UPDATED with codes InputStream, InputStreamReader, BufferedReader):

package com.example.testecsv;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.content.res.AssetManager;
import android.os.Bundle;

import com.opencsv.CSVParserBuilder;
import com.opencsv.CSVReader;
import com.opencsv.CSVReaderBuilder;
import com.opencsv.exceptions.CsvValidationException;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Field;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        try {
            //#1 InputStreamReader code (no error)
            InputStreamReader isr = new InputStreamReader(getAssets().open("teste.csv"));

            //#2 InputStream code (no error)
            InputStream is = getAssets().open("teste.csv");

            //#3 BufferedReader code (no error)
            BufferedReader br = new BufferedReader(new InputStreamReader(getAssets().open("teste.csv"), "UTF-8"));

            // Code retrieved from OpenCSV site and documentation
            // New example from original post, got from OpenCSV documentation --> WHAT DO I PUT INSIDE "FileReader" ???
            CSVReader reader = new CSVReaderBuilder(new FileReader("teste.csv")).build();
            String [] nextLine;
            while ((nextLine = reader.readNext()) != null) {
                // nextLine[] is an array of values from the line
                System.out.println(nextLine[0] + nextLine[1] + "etc...");
            }

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (CsvValidationException e) {
            e.printStackTrace();
        }

    }

}

The file exists on both "assets" folder and "res/raw" folder. Android Studio finds the FILE, but the compilation don't (on virtual or on physical device), here's some details of the error:

2022-12-18 15:39:15.232 13198-13198 System.err              com.example.testecsv                 W  java.io.FileNotFoundException: teste.csv: open failed: ENOENT (No such file or directory)
2022-12-18 15:39:15.280 13198-13198 System.err              com.example.testecsv                 W      at libcore.io.IoBridge.open(IoBridge.java:574)
2022-12-18 15:39:15.281 13198-13198 System.err              com.example.testecsv                 W      at java.io.FileInputStream.<init>(FileInputStream.java:160)
2022-12-18 15:39:15.283 13198-13198 System.err              com.example.testecsv                 W      at java.io.FileInputStream.<init>(FileInputStream.java:115)
2022-12-18 15:39:15.284 13198-13198 System.err              com.example.testecsv                 W      at java.io.FileReader.<init>(FileReader.java:60)
2022-12-18 15:39:15.285 13198-13198 System.err              com.example.testecsv                 W      at com.example.testecsv.MainActivity.onCreate(MainActivity.java:25)
2022-12-18 15:39:15.289 13198-13198 System.err              com.example.testecsv                 W      at android.app.Activity.performCreate(Activity.java:8305)
2022-12-18 15:39:15.289 13198-13198 System.err              com.example.testecsv                 W      at android.app.Activity.performCreate(Activity.java:8284)
2022-12-18 15:39:15.290 13198-13198 System.err              com.example.testecsv                 W      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
2022-12-18 15:39:15.291 13198-13198 System.err              com.example.testecsv                 W      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3626)
2022-12-18 15:39:15.292 13198-13198 System.err              com.example.testecsv                 W      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782)
2022-12-18 15:39:15.292 13198-13198 System.err              com.example.testecsv                 W      at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
2022-12-18 15:39:15.293 13198-13198 System.err              com.example.testecsv                 W      at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
2022-12-18 15:39:15.296 13198-13198 System.err              com.example.testecsv                 W      at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
2022-12-18 15:39:15.298 13198-13198 System.err              com.example.testecsv                 W      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
2022-12-18 15:39:15.299 13198-13198 System.err              com.example.testecsv                 W      at android.os.Handler.dispatchMessage(Handler.java:106)
2022-12-18 15:39:15.301 13198-13198 System.err              com.example.testecsv                 W      at android.os.Looper.loopOnce(Looper.java:201)
2022-12-18 15:39:15.301 13198-13198 System.err              com.example.testecsv                 W      at android.os.Looper.loop(Looper.java:288)
2022-12-18 15:39:15.302 13198-13198 System.err              com.example.testecsv                 W      at android.app.ActivityThread.main(ActivityThread.java:7872)
2022-12-18 15:39:15.304 13198-13198 System.err              com.example.testecsv                 W      at java.lang.reflect.Method.invoke(Native Method)
2022-12-18 15:39:15.306 13198-13198 System.err              com.example.testecsv                 W      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
2022-12-18 15:39:15.308 13198-13198 System.err              com.example.testecsv                 W      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
2022-12-18 15:39:15.314 13198-13198 System.err              com.example.testecsv                 W  Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
2022-12-18 15:39:15.316 13198-13198 System.err              com.example.testecsv                 W      at libcore.io.Linux.open(Native Method)
2022-12-18 15:39:15.316 13198-13198 System.err              com.example.testecsv                 W      at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
2022-12-18 15:39:15.317 13198-13198 System.err              com.example.testecsv                 W      at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
2022-12-18 15:39:15.318 13198-13198 System.err              com.example.testecsv                 W      at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
2022-12-18 15:39:15.318 13198-13198 System.err              com.example.testecsv                 W      at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7758)
2022-12-18 15:39:15.322 13198-13198 System.err              com.example.testecsv                 W      at libcore.io.IoBridge.open(IoBridge.java:560)
2022-12-18 15:39:15.324 13198-13198 System.err              com.example.testecsv                 W      ... 20 more

I've tried a lot of codes, answers from internet (stackoverflow included), examples from documentation and outside documentation, but still struggling trying to simply READ a .csv file. It doesn't matter which code I write, it always can't find the file path, giving the error above (the code more above I wrote just to post it here like an example). I also tried using
"InputStream", "AssetManager", "FileInputStream" and a few others commands and codes. It still 4 days and it's stressing me out. I'm using my last resort which is asking here. I'm not an advanced programmer, I'm just trying to build a simple app to help some people. The answer might be something very simple, but I can't find it, and I'm feeling down, almost giving up to something so simple. Please be kind. Thanks for all who might help me.

EDIT 1:

With the following added code, I can read the .csv file by the normal way, but I'm still struggling how I can link this code with the OpenCSV Code.

BufferedReader br = new BufferedReader(new InputStreamReader(getAssets().open("teste.csv"), "UTF-8"));
ArrayList lines = new ArrayList<String>();
String newLine;
    while ((newLine = br.readLine()) != null) {
        System.out.println(newLine);
        lines.add(newLine);
    }
br.close();


来源: stackexchange

问:
How do I gather the Inspect Element code as a string using c#?
I've been searching around online but am too bad of a learner to understand. I want to programmatically get a .png link that I can find when going into Inspect Element on a page.
I've tried WebClient wb = new WebClient(); wb.DownloadString(url); but it does not contain the source for a .png link.

ContentLicense: CC BY-SA 4.0


问:
SQL Server Graph DB - Edge table constraint
I am experimenting with graph tables in SQL Server for the first time.
I noticed that my simple query with this predicate

MATCH (E-(RelatesTo)->O)

Is quite slow. The query plan suggest to create a new index on table RelatesTo (where the query plan now shows a Full Scan):

```<code>CREATE NONCLUSTERED INDEX IX_RelatesTo
ON [dbo].[RelatesTo] ([from_obj_id_5CBDB5152153436D8C906BB25FA1CCCA],[to_obj_id_B665CD5691CC4647BA26629F6B8E5C4E])
INCLUDE ([from_id_A710BDEF1CAE4834BD4CFB78AC21AFC2],[to_id_9640505F2EE840A6B68861118E664B2E])
</code>```

However when I run this command, I get this error:

Cannot access internal graph column 'from_obj_id_5CBDB5152153436D8C906BB25FA1CCCA'.

Am I missing something? I have not created any explicit indices in any of the NODE / EDGE tables, only PK. I sort-of expected that the server would create some default index for EDGE tables. Does it? Is the full scan on the edge table expected?

Here is the DDL part for reference:

```<code>CREATE TABLE E (
  ID INTEGER PRIMARY KEY FOREIGN KEY REFERENCES ABC(ID) ON DELETE CASCADE,
) AS NODE;
CREATE TABLE O (
  ObjectID INT PRIMARY KEY,
) AS NODE;
CREATE TABLE RelatesTo AS EDGE;
</code>```

Body:
I am experimenting with graph tables in SQL Server for the first time.
I noticed that my simple query with this predicate

MATCH (E-(RelatesTo)->O)

Is quite slow. The query plan suggest to create a new index on table RelatesTo (where the query plan now shows a Full Scan):

CREATE NONCLUSTERED INDEX IX_RelatesTo
ON [dbo].[RelatesTo] ([from_obj_id_5CBDB5152153436D8C906BB25FA1CCCA],[to_obj_id_B665CD5691CC4647BA26629F6B8E5C4E])
INCLUDE ([from_id_A710BDEF1CAE4834BD4CFB78AC21AFC2],[to_id_9640505F2EE840A6B68861118E664B2E])

However when I run this command, I get this error:

Cannot access internal graph column 'from_obj_id_5CBDB5152153436D8C906BB25FA1CCCA'.

Am I missing something? I have not created any explicit indices in any of the NODE / EDGE tables, only PK. I sort-of expected that the server would create some default index for EDGE tables. Does it? Is the full scan on the edge table expected?

Here is the DDL part for reference:

CREATE TABLE E (
  ID INTEGER PRIMARY KEY FOREIGN KEY REFERENCES ABC(ID) ON DELETE CASCADE,
) AS NODE;
CREATE TABLE O (
  ObjectID INT PRIMARY KEY,
) AS NODE;
CREATE TABLE RelatesTo AS EDGE;


问:
social analysis (preferential_attachment)
df=list(nx.preferential_attachment(G1))

df.sort(key=operator.itemgetter(2), reverse = True)

print('preferential_attachment_Z: {}'.format(df))

error:not implemented for directed type

Do you know where is the wrong point?

please let me know the wrong point


问:
Python-xlsxwriter pass the formula to dropdown list
I have the data similar to

Have a Vlookup formula,{=VLOOKUP(Sheet1!C11,Sheet2!J1:M4,{2,3,4}, FALSE)} that gives me the entire row of matched value. If the user selects Tag1, I should show the list of users in the dropdown. How do I pass this formula into the source so that it gives me the list in the dropdown?

I need it like:
.

Tried to pass this in the source as :

```<code>worksheet.data_validation(data_start_row, 11, 500, 11, {"validate": "list", "source": vlookup_formula})
</code>```

Seems like, the source is expecting range and not the formula, do I have any other way to pass data as a dropdown?

Body:
I have the data similar to

Have a Vlookup formula,{=VLOOKUP(Sheet1!C11,Sheet2!J1:M4,{2,3,4}, FALSE)} that gives me the entire row of matched value. If the user selects Tag1, I should show the list of users in the dropdown. How do I pass this formula into the source so that it gives me the list in the dropdown?

I need it like:
.

Tried to pass this in the source as :

worksheet.data_validation(data_start_row, 11, 500, 11, {"validate": "list", "source": vlookup_formula})

Seems like, the source is expecting range and not the formula, do I have any other way to pass data as a dropdown?


问:
HTTPRoute set a timeout
I am trying to set up a multi-cluster architecture. I have a Spring Boot API that I want to run on a second cluster (for isolation purposes). I have set that up using the gateway.networking.k8s.io API. I am using a Gateway that has an SSL certificate and matches an IP address that's registered to my domain in the DNS registry. I am then setting up an HTTPRoute for each service that I am running on the second cluster. That works fine and I can communicate between our clusters and everything works as intended but there is a problem:

There is a timeout of 30s by default and I cannot change it. I want to increase it as the application in the second cluster is a WebSocket and I obviously would like our WebSocket connections to stay open for more than 30s at a time. I can see that in the backend service that's created from our HTTPRoute there is a timeout specified as 30s. I found a command to increase it gcloud compute backend-services update gkemcg1-namespace-store-west-1-8080-o1v5o5p1285j --timeout=86400

When I run that command it would increase the timeout and the webSocket connection will be kept alive. But after a few minutes this change gets overridden (I suspect that it's because it's managed by the yaml file). This is the yaml file for my backend service

```<code>kind: HTTPRoute
apiVersion: gateway.networking.k8s.io/v1beta1
metadata:
  name: public-store-route
  namespace: namespace
  labels:
    gateway: external-http
spec:
  hostnames:
  - "my-website.example.org"
  parentRefs:
  - name: external-http
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /west
    backendRefs:
    - group: net.gke.io
      kind: ServiceImport
      name: store-west-1
      port: 8080
</code>```

I have tried to add either a timeout, timeoutSec, or timeoutSeconds under every level with no success. I always get the following error:

error: error validating "public-store-route.yaml": error validating data: ValidationError(HTTPRoute.spec.rules[0].backendRefs[0]): unknown field "timeout" in io.k8s.networking.gateway.v1beta1.HTTPRoute.spec.rules.backendRefs; if you choose to ignore these errors, turn validation off with --validate=false

Surely there must be a way to configure this. But I wasn't able to find anything in the documentation referring to a timeout. Am I missing something here?

How do I configure the timeout?

Edit:

I have found this resource: https://cloud.google.com/kubernetes-engine/docs/how-to/configure-gateway-resources

I have been trying to set up a LBPolicy and attatch it it the Gateway, HTTPRoute, Service, or ServiceImport but nothing has made a difference. Am I doing something wrong or is this not working how it is supposed to? This is my yaml:

```<code>kind: LBPolicy
apiVersion: networking.gke.io/v1
metadata:
  name: store-timeout-policy
  namespace: sandstone-test
spec:
  default:
    timeoutSec: 50
  targetRef:
    name: public-store-route
    group: gateway.networking.k8s.io
    kind: HTTPRoute
</code>```

Title: HTTPRoute set a timeout

Body:
I am trying to set up a multi-cluster architecture. I have a Spring Boot API that I want to run on a second cluster (for isolation purposes). I have set that up using the gateway.networking.k8s.io API. I am using a Gateway that has an SSL certificate and matches an IP address that's registered to my domain in the DNS registry. I am then setting up an HTTPRoute for each service that I am running on the second cluster. That works fine and I can communicate between our clusters and everything works as intended but there is a problem:

There is a timeout of 30s by default and I cannot change it. I want to increase it as the application in the second cluster is a WebSocket and I obviously would like our WebSocket connections to stay open for more than 30s at a time. I can see that in the backend service that's created from our HTTPRoute there is a timeout specified as 30s. I found a command to increase it gcloud compute backend-services update gkemcg1-namespace-store-west-1-8080-o1v5o5p1285j --timeout=86400

When I run that command it would increase the timeout and the webSocket connection will be kept alive. But after a few minutes this change gets overridden (I suspect that it's because it's managed by the yaml file). This is the yaml file for my backend service

kind: HTTPRoute
apiVersion: gateway.networking.k8s.io/v1beta1
metadata:
  name: public-store-route
  namespace: namespace
  labels:
    gateway: external-http
spec:
  hostnames:
  - "my-website.example.org"
  parentRefs:
  - name: external-http
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /west
    backendRefs:
    - group: net.gke.io
      kind: ServiceImport
      name: store-west-1
      port: 8080

I have tried to add either a timeout, timeoutSec, or timeoutSeconds under every level with no success. I always get the following error:

error: error validating "public-store-route.yaml": error validating data: ValidationError(HTTPRoute.spec.rules[0].backendRefs[0]): unknown field "timeout" in io.k8s.networking.gateway.v1beta1.HTTPRoute.spec.rules.backendRefs; if you choose to ignore these errors, turn validation off with --validate=false

Surely there must be a way to configure this. But I wasn't able to find anything in the documentation referring to a timeout. Am I missing something here?

How do I configure the timeout?

Edit:

I have found this resource: https://cloud.google.com/kubernetes-engine/docs/how-to/configure-gateway-resources

I have been trying to set up a LBPolicy and attatch it it the Gateway, HTTPRoute, Service, or ServiceImport but nothing has made a difference. Am I doing something wrong or is this not working how it is supposed to? This is my yaml:

kind: LBPolicy
apiVersion: networking.gke.io/v1
metadata:
  name: store-timeout-policy
  namespace: sandstone-test
spec:
  default:
    timeoutSec: 50
  targetRef:
    name: public-store-route
    group: gateway.networking.k8s.io
    kind: HTTPRoute


问:
ob_end_flush times out after calling ob_end_flush timing
I'm using WordPress 6.1.1 on the following spec (Nginx + PHP FPM):

```<code>nginx version: nginx/1.21.1
PHP 7.4.33
</code>```

The following function keeps timing out after 5 minutes (sometimes it works after 6-7 minutes) when buffering 36MB (used ob_get_length() to measure it) which are reasonable for the WP plugin being used.

```<code>function wp_ob_end_flush_all() {
    $levels = ob_get_level();
    for ( $i = 0; $i < $levels; $i++ ) {
        ob_end_flush();
    }
}
</code>```

I tried to turn off zlib.output_compression but it isn't the issue.

Also, I tried to disabling buffering

```<code>\remove_action('shutdown', 'wp_ob_end_flush_all', 1);
\add_action('shutdown', function() {
    header('X-Accel-Buffering: no');
    $levels = \ob_get_level();
    for ( $i = 0; $i < $levels; $i++ ) {
        \ob_end_flush();
    }
}, 1);
</code>```

It is still timing out and I have no clue.
Any ideas where would the bottle neck be?

EDIT

After increasing the max_execution_timeout to 600 it now loads after 6.2m, but that's a lot for 36 MB, that when gzipped are 902 KB. Something still doesn't make sense in the communication between PHPFpm-Nginx.

Body:
I'm using WordPress 6.1.1 on the following spec (Nginx + PHP FPM):

nginx version: nginx/1.21.1
PHP 7.4.33

The following function keeps timing out after 5 minutes (sometimes it works after 6-7 minutes) when buffering 36MB (used ob_get_length() to measure it) which are reasonable for the WP plugin being used.

function wp_ob_end_flush_all() {
    $levels = ob_get_level();
    for ( $i = 0; $i < $levels; $i++ ) {
        ob_end_flush();
    }
}

I tried to turn off zlib.output_compression but it isn't the issue.

Also, I tried to disabling buffering

\remove_action('shutdown', 'wp_ob_end_flush_all', 1);
\add_action('shutdown', function() {
    header('X-Accel-Buffering: no');
    $levels = \ob_get_level();
    for ( $i = 0; $i < $levels; $i++ ) {
        \ob_end_flush();
    }
}, 1);

It is still timing out and I have no clue.
Any ideas where would the bottle neck be?

EDIT

After increasing the max_execution_timeout to 600 it now loads after 6.2m, but that's a lot for 36 MB, that when gzipped are 902 KB. Something still doesn't make sense in the communication between PHPFpm-Nginx.


问:
WooCommerce After Addresses Endpoints Permalinks
I managed to change once these endpoints of WooCommerce --> /my-account/addresses/billing-address/ or /shipping-address/ or /add-address/. The problem is that I changed them to Cyrillic when I need to go back to Latin, and now I can't find those anywhere! Do you know how I can manage to change those, they're not in the advanced settings?

I need to find a way to change those again. In my language, it looks like that: /moyat-profil/adresi/фактуриране, in English: /my-account/addresses/billing-address/ I have to change 'фактуриране' to Latin.

P.S. I clearly remember that once they appeared in the backend of WordPress and I changed them simply from there. However, I'm not able to find them again.


问:
RazorSQL get Column Description from AS400
I am currently working with "RazorSQL" on a AS400 DB. I connect through the System DSN with the iSeriesAccess Driver.
I have also tried the Software "ODBC Query Tool", where I get the column descriptions from the Schema. - On RazorSQL i can't see the Schema Descriptions for the columns.

Does anyone know where I can change the settings for this? - I looked RazorSQL`s Docs and don't found anything helpful..


问:
How to fetch Json data directly from webview link android studio?
I developed android app using kotlin and iam able to open webview also but iam unable find json data in logcat from website link? there is no api in middle. I want fetch data from random website  directly with url? there is no (key, value)? not json url.</p>


问:
Dynamic weekday border color [React-Calendar]
I want to add dynamic color to border of each weekday in react-calendar.
And want to change text on hover on each date.

Sample Image:

I tried adding onMouseEnter event using tileContent props

```<code>tileContent={({date})=>(
  <div onMouseEnter={(e)=>{setHoverText("hello")}}/>)}
</code>```

Body:
I want to add dynamic color to border of each weekday in react-calendar.
And want to change text on hover on each date.

Sample Image:

I tried adding onMouseEnter event using tileContent props

tileContent={({date})=>(

{setHoverText("hello")}}/>)}


问:
How to enable saml2 on specific endpoint and use jwt authentication on others?
i have to  authentificate the user with saml2 on specific endpoint when saml2 success i create jwt token who permite to access to other endpoints.

My security config look like this

```<code>@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
    OpenSaml4AuthenticationProvider authenticationProvider = new OpenSaml4AuthenticationProvider();
    authenticationProvider.setResponseAuthenticationConverter(groupsConverter());

    http
            .cors()
            .and()
            .csrf()
            .disable()
             .addFilterBefore(new JWTFilter(tokenProvider), UsernamePasswordAuthenticationFilter.class)
            .saml2Login(saml2 -> {

                        saml2
                                .authenticationManager(new ProviderManager(authenticationProvider));

                    }

            )
            .saml2Logout(withDefaults());

    return http.build();
}

</code>```

But my problem is that when the user is not logged on other endpoints saml2 login form is displayed it should throw http 403 response
how to enable authenticate saml2 on specific endpoint and enable jwt token on other endpoints?
how to implement saml2 and jwt together on spring security 6   spring boot?

or how to disable saml2login on specific endpoint?

Body:
i have to  authentificate the user with saml2 on specific endpoint when saml2 success i create jwt token who permite to access to other endpoints.

My security config look like this

@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
    OpenSaml4AuthenticationProvider authenticationProvider = new OpenSaml4AuthenticationProvider();
    authenticationProvider.setResponseAuthenticationConverter(groupsConverter());

    http
            .cors()
            .and()
            .csrf()
            .disable()
             .addFilterBefore(new JWTFilter(tokenProvider), UsernamePasswordAuthenticationFilter.class)
            .saml2Login(saml2 -> {

                        saml2
                                .authenticationManager(new ProviderManager(authenticationProvider));

                    }

            )
            .saml2Logout(withDefaults());

    return http.build();
}

But my problem is that when the user is not logged on other endpoints saml2 login form is displayed it should throw http 403 response
how to enable authenticate saml2 on specific endpoint and enable jwt token on other endpoints?
how to implement saml2 and jwt together on spring security 6   spring boot?

or how to disable saml2login on specific endpoint?


问:
p:messages rendering not working after ajax update
I have sheet(as datatable) . I am using ajax to update sheet(table) on change . I can update submit button render from backing bean . But i cant update my p:messages rendering like button. At the backing bean i am setting canMessageShow=false to not rendered p:messages but it still shows.

My code :

```<code><form>

<p:commandButton id="submitButton"
disabled="#{facesContext.validationFailed or !anybean.canSubmit}"
 actionListener="#{anyBean.dosmethn}"  value="Submit"/>

<p:remoteCommand name="onCellEdit" update="someSheet"/>

<pe:sheet id="someSheet"

<p:messages id="createTrashMessages" rendered="#{anyBean.canMessageShow}" autoUpdate="true"
            showDetail="true" showIcon="false" style="margin-left: 20px; width: 640px;"/>

<p:ajax event="change" global="false"
        update="submitButton someSheet createTrashMessages"
        listener="#{anyBean.editActionListener}" oncomplete="onCellEdit()"/>

<pe:sheetcolumn headerText="Item"
                readOnly="true"
                value="#{entity.item}"/>

<pe:sheet>

</form>
</code>```

On my ajax update as you can see i am updating sheet and messages it self. Also i tried to remove from
FacesContext.getCurrentInstance().getViewRoot().getAttributes()  But p:messages still displays. Also i have checked
FacesContext.getCurrentInstance().getmessages but it says no elements to display i mean its empty. How can i remove p:messages and not rendering upon ajax update. Because right now ajax updating button also setting canMessageShow to false. But p:messages still displaying.

My java version : 8
jsf 2.2.1
primefaces-extensions 6.2.10
primefaces 6.2

Body:
I have sheet(as datatable) . I am using ajax to update sheet(table) on change . I can update submit button render from backing bean . But i cant update my p:messages rendering like button. At the backing bean i am setting canMessageShow=false to not rendered p:messages but it still shows.

My code :

<form>

<pe:sheet id="someSheet"

<pe:sheetcolumn headerText="Item"
                readOnly="true"
                value="#{entity.item}"/>

<pe:sheet>

</form>

On my ajax update as you can see i am updating sheet and messages it self. Also i tried to remove from
FacesContext.getCurrentInstance().getViewRoot().getAttributes()  But p:messages still displays. Also i have checked
FacesContext.getCurrentInstance().getmessages but it says no elements to display i mean its empty. How can i remove p:messages and not rendering upon ajax update. Because right now ajax updating button also setting canMessageShow to false. But p:messages still displaying.

My java version : 8
jsf 2.2.1
primefaces-extensions 6.2.10
primefaces 6.2


问:
pandas read_json from s3 with chunksize option returns single row multiple columns dataframe
I have a json file in s3 (with >100 records), this is sample json file format:

```<code>[{
    "data": {
        "a": "hello"
    },
    "details": {
        "b": "hello1"
    },
    "dtype": "SP"
},
{
    "data": {
        "a": "hello2"
    },
    "details": {
        "b": "hello3"
    },
    "dtype": "SP"
}]
</code>```

I use aws wrangler to read_json using boto3, I get the right format of dataframe.

```<code>         data          details      dtype
0   {'a': 'hello'}  {'b': 'hello1'}   SP
1  {'a': 'hello2'}  {'b': 'hello3'}   SP
</code>```

If I use the chunksize option along with lines=True, I get the dataframe in a single row, multiple column format.

```<code>                                                   0                                               1
0  {'data': {'a': 'hello'}, 'details': {'b': 'hel...    {'data': {'a': 'hello2'}, 'details': {'b': 'he...

</code>```

Is there a way to still get right format of dataframe (multiple rows) with the size mentioned by chunksize

Update: I have tried nrows instead of chunksize. It didin't help, gives me the same output as chunksize.

code I am using to read json file from s3:

```<code>import boto3
import botocore
import awswrangler as wr

client = boto3.session.Session(
        aws_access_key_id=s3_access_key,
        aws_secret_access_key=s3_secret_key,
        region_name=s3_region,
    )

def read_json_s3(path, client, **args):
    try:
        return wr.s3.read_json(path=path, boto3_session=client, **args)
    except botocore.exceptions.ClientError as err:
        raise err
</code>```

I am sending chunksize=1000, lines=True as args

Body:
I have a json file in s3 (with >100 records), this is sample json file format:

[{
    "data": {
        "a": "hello"
    },
    "details": {
        "b": "hello1"
    },
    "dtype": "SP"
},
{
    "data": {
        "a": "hello2"
    },
    "details": {
        "b": "hello3"
    },
    "dtype": "SP"
}]

I use aws wrangler to read_json using boto3, I get the right format of dataframe.

         data          details      dtype
0   {'a': 'hello'}  {'b': 'hello1'}   SP
1  {'a': 'hello2'}  {'b': 'hello3'}   SP

If I use the chunksize option along with lines=True, I get the dataframe in a single row, multiple column format.

                                                   0                                               1
0  {'data': {'a': 'hello'}, 'details': {'b': 'hel...    {'data': {'a': 'hello2'}, 'details': {'b': 'he...

Is there a way to still get right format of dataframe (multiple rows) with the size mentioned by chunksize

Update: I have tried nrows instead of chunksize. It didin't help, gives me the same output as chunksize.

code I am using to read json file from s3:

import boto3
import botocore
import awswrangler as wr

client = boto3.session.Session(
        aws_access_key_id=s3_access_key,
        aws_secret_access_key=s3_secret_key,
        region_name=s3_region,
    )

def read_json_s3(path, client, **args):
    try:
        return wr.s3.read_json(path=path, boto3_session=client, **args)
    except botocore.exceptions.ClientError as err:
        raise err

I am sending chunksize=1000, lines=True as args


问:
How to query from postman with a field value starting with some character
I have a REST API verification to be done using Postman. I want to retrieve details of fields whose values which starts with some characters. How can I pass this type of query parameter in postman Get request?</p>


问:
How to remove the container background color from QScrollBar?
Is there a way to remove the container background (seen in attached pix as white around the rounded top/bottom of the scroll bar.

Here's my stylesheet:

QScrollBar:horizontal, QScrollBar:vertical
{border: none; border-radius: 0.5em; background-color: #bfbfbf; margin: 0px; padding: 0px;}

QScrollBar:horizontal
{height: 1em;}

QScrollBar:vertical
{width: 1em;}

QScrollBar::handle:horizontal, QScrollBar::handle:vertical
{background-color: #404040; border-radius: 0.5em;}

QScrollBar::handle:horizontal, QScrollBar::handle:vertical
{min-width: 1em; min-height: 1em;}

QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal, QScrollBar::add-page:horizontal,
QScrollBar::sub-page:horizontal
{width: 0px;}

QScrollBar::sub-line:vertical, QScrollBar::add-line:vertical, QScrollBar::add-page:vertical,
QScrollBar::sub-page:vertical
{height: 0px;}
```


问:
Error when installing Composer with SSH on putty
I'm new to Putty and SSH.
I followed instructions from https://getcomposer.org/download/ to install Composer with Putty.

The following is the instructions mentionned:

```<code>php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
</code>```

But i got error on the line:

```<code>php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
</code>```

telling Error in argument 1, char 2: option not found r

My PHP Version (php -v  output):

```<code>PHP 4.4.9 (cgi-fcgi) (built: Jul  7 2021 07:43:18)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
</code>```

How can I avoid this error ?

Body:
I'm new to Putty and SSH.
I followed instructions from https://getcomposer.org/download/ to install Composer with Putty.

The following is the instructions mentionned:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

But i got error on the line:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

telling Error in argument 1, char 2: option not found r

My PHP Version (php -v  output):

PHP 4.4.9 (cgi-fcgi) (built: Jul  7 2021 07:43:18)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

How can I avoid this error ?


问:
Python 3.10.8 TypeError: TypedDict does not support instance and class checks
After having created the a typeddict, I am experiencing the following error:

TypeError: TypedDict does not support instance and class checks

Below is a MWE

"""Entry point for this project, runs the project code based on the cli command
that invokes this script."""

print('hello world')
from typeguard import typechecked
import sys
from typing import Dict, List, Union

if sys.version_info < (3, 11):
    from typing_extensions import NotRequired, TypedDict
else:
    from typing import NotRequired

class Run_config(TypedDict):
    adaptation: Union[None, Dict]
    algorithm: Dict
    iteration: int
    graph_size: int
    graph_nr: int
    radiation: Union[None, Dict]
    seed: int
    simulator: str
    export_images: NotRequired[bool]
    export_types: NotRequired[List[str]]
    max_duration: NotRequired[int]
    overwrite_snn_creation: NotRequired[bool]
    overwrite_snn_propagation: NotRequired[bool]
    overwrite_visualisation: NotRequired[bool]
    overwrite_sim_results: NotRequired[bool]
    show_snns: NotRequired[bool]

@typechecked
def some_function( some_int:int, run_config: Run_config) -> Run_config:
    """Returns a dict"""
    print(f'some_int={some_int}')
    return run_config

some_run_config:Run_config = {
    "adaptation":None,
    "algorithm":{"hi":2},
    "iteration":5,
    "graph_size":4,
    "graph_nr":6,
    "radiation":None,
    "seed":2,
    "simulator":"hello",
}
some_int:int =5
some_function(some_int,some_run_config)
```
<p>That throws as output the above error. The stacktrace is:</p>
```$python -m src.mwe
hello world
Traceback (most recent call last):
  File "/home/name/anaconda/envs/snncompare/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/name/anaconda/envs/snncompare/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/name/git/snn/mwe/src/mwe/__main__.py", line 50, in <module>
    some_function(some_int,some_run_config)
  File "/home/name/anaconda/envs/snncompare/lib/python3.10/site-packages/typeguard/__init__.py", line 1032, in wrapper
    check_argument_types(memo)
  File "/home/name/anaconda/envs/snncompare/lib/python3.10/site-packages/typeguard/__init__.py", line 875, in check_argument_types
    raise TypeError(*exc.args) from None
TypeError: TypedDict does not support instance and class checks
```

Question

Why does this error occur, and how can I resolve it?

Body:
After having created the a typeddict, I am experiencing the following error:

TypeError: TypedDict does not support instance and class checks

Below is a MWE

"""Entry point for this project, runs the project code based on the cli command
that invokes this script."""

print('hello world')
from typeguard import typechecked
import sys
from typing import Dict, List, Union

if sys.version_info < (3, 11):
    from typing_extensions import NotRequired, TypedDict
else:
    from typing import NotRequired

class Run_config(TypedDict):
    adaptation: Union[None, Dict]
    algorithm: Dict
    iteration: int
    graph_size: int
    graph_nr: int
    radiation: Union[None, Dict]
    seed: int
    simulator: str
    export_images: NotRequired[bool]
    export_types: NotRequired[List[str]]
    max_duration: NotRequired[int]
    overwrite_snn_creation: NotRequired[bool]
    overwrite_snn_propagation: NotRequired[bool]
    overwrite_visualisation: NotRequired[bool]
    overwrite_sim_results: NotRequired[bool]
    show_snns: NotRequired[bool]

@typechecked
def some_function( some_int:int, run_config: Run_config) -> Run_config:
    """Returns a dict"""
    print(f'some_int={some_int}')
    return run_config

some_run_config:Run_config = {
    "adaptation":None,
    "algorithm":{"hi":2},
    "iteration":5,
    "graph_size":4,
    "graph_nr":6,
    "radiation":None,
    "seed":2,
    "simulator":"hello",
}
some_int:int =5
some_function(some_int,some_run_config)

That throws as output the above error. The stacktrace is:

$python -m src.mwe
hello world
Traceback (most recent call last):
  File "/home/name/anaconda/envs/snncompare/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/name/anaconda/envs/snncompare/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/name/git/snn/mwe/src/mwe/__main__.py", line 50, in <module>
    some_function(some_int,some_run_config)
  File "/home/name/anaconda/envs/snncompare/lib/python3.10/site-packages/typeguard/__init__.py", line 1032, in wrapper
    check_argument_types(memo)
  File "/home/name/anaconda/envs/snncompare/lib/python3.10/site-packages/typeguard/__init__.py", line 875, in check_argument_types
    raise TypeError(*exc.args) from None
TypeError: TypedDict does not support instance and class checks

Question

Why does this error occur, and how can I resolve it?


问:
How do I make pagerCustom carousel in bxSlider?
```<code>I created a thumbnail slider with bxSlider pagerCustom. Thumbnails do not fit in the slider. I need to make the thumbnails a carousel.
</code>```

I have 15 pictures and 15 thumbnails for them and the picture slide works like a carousel and I need the thumbnails to work the same way

```<code> How should I do it?
</code>```

`js

```<code> $(document).ready(function() {
            jQuery('.bxslider').bxSlider({
              nextText: '',
              prevText: '',
              pagerCustom: '#bx-pager',

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

`

```<code><div class="product3_slider">
              <div class="slider3">
                <ul class="bxslider">
                  <li><img src="https://static.mikrotik.group/image/trm240.jpg" /></li>
                   <li><img src="https://static.mikrotik.group/image/trm240back.jpg" /></li>

                </ul>
              </div>
              <div id="bx-pager">
<a data-slide-index="0" href=""><img src="https://static.mikrotik.group/image/trm240small.jpg" /></a>
                <a data-slide-index="1" href=""><img src="https://static.mikrotik.group/image/trm240backsmall.jpg"/></a>
              </div>
            </div>
</code>```

```<code>I tried to find examples where there are a lot of pictures with thumbnails, but I did not find such examples.
</code>```

Body:
I created a thumbnail slider with bxSlider pagerCustom. Thumbnails do not fit in the slider. I need to make the thumbnails a carousel.

I have 15 pictures and 15 thumbnails for them and the picture slide works like a carousel and I need the thumbnails to work the same way

 How should I do it?

`js

 $(document).ready(function() {
            jQuery('.bxslider').bxSlider({
              nextText: '',
              prevText: '',
              pagerCustom: '#bx-pager',

            });
          });

`

I tried to find examples where there are a lot of pictures with thumbnails, but I did not find such examples.


问:
Having a second orderby sorting criteria after default sorting criteria (WP Profile Builder)
I'm using the WP Profile Builder plugin. In the frontend user listing I set a default sorting criteria. Works fine! But now I would like to have a second criteria that comes right after the default one.
Lets say first are the "gold" users and behind them the "silver" users.

Right now it looks like this:

```<code>
 */
function wppb_userlisting_users_loop( $value, $name, $children, $extra_values ){
    if( $name == 'users' ){
        global $userlisting_args;
        global $wpdb;
        $userlisting_form_id = $extra_values['userlisting_form_id'];
        $userlisting_args = get_post_meta( $userlisting_form_id, 'wppb_ul_page_settings', true );

        if( !empty( $userlisting_args[0] ) ){
            $paged = (get_query_var('wppb_page')) ? get_query_var('wppb_page') : 1;
            if( !is_int( (int)$userlisting_args[0]['number-of-userspage'] ) || (int)$userlisting_args[0]['number-of-userspage'] == 0 )
                $userlisting_args[0]['number-of-userspage'] = 5;

            // Check if some of the listing parameters have changed
            if ( isset( $_REQUEST['setSortingOrder'] ) && sanitize_text_field( $_REQUEST['setSortingOrder'] ) !== '' )
                $sorting_order = sanitize_text_field( $_REQUEST['setSortingOrder'] );
            else
                $sorting_order = $userlisting_args[0]['default-sorting-order'];

            /* if we have admin approval on we don't want to show those users in the userlisting so we need to exclude them */
            if( wppb_get_admin_approval_option_value() === 'yes' ){
                $excluded_ids = array();
                $user_statusTaxID = get_term_by( 'name', 'unapproved', 'user_status' );
                if( $user_statusTaxID != false ){
                    $term_taxonomy_id = $user_statusTaxID->term_taxonomy_id;
                    $results = $wpdb->get_results( $wpdb->prepare( "SELECT wppb_t1.ID FROM $wpdb->users AS wppb_t1 LEFT OUTER JOIN $wpdb->term_relationships AS wppb_t0 ON wppb_t1.ID = wppb_t0.object_id WHERE wppb_t0.term_taxonomy_id = %d", $term_taxonomy_id ) );

                    foreach ( $results as $result )
                        array_push( $excluded_ids, $result->ID );

                    $excluded_ids = implode( ',', $excluded_ids );
                }
            }
            if( !empty($excluded_ids) )
                $extra_values['exclude'] .= ','. $excluded_ids;
            //set query args
            $args = array(
                'order'                         => $sorting_order,
                'include'                       => $extra_values['include'],
                'exclude'                       => $extra_values['exclude'],
                'fields'                        => array( 'ID' )
            );

            /* get all field options here, we will need it bellow */
            global $wppb_manage_fields;
            if( !isset( $wppb_manage_fields ) )
                $wppb_manage_fields = get_option( 'wppb_manage_fields', 'not_found' );

            // Check if some of the listing parameters have changed
            if ( isset( $_REQUEST['setSortingCriteria'] ) && sanitize_text_field( $_REQUEST['setSortingCriteria'] ) !== '' )
                $sorting_criteria = sanitize_text_field( $_REQUEST['setSortingCriteria'] );
            else
                $sorting_criteria = $userlisting_args[0]['default-sorting-criteria'];

            if( in_array( $sorting_criteria, array( 'login', 'email', 'url', 'registered', 'post_count', 'nicename' ) ) ){
                if( $sorting_criteria == 'nicename' )
                    $args['orderby']  = 'display_name';

            }
            else{

                $args['orderby']  = apply_filters( 'wppb_ul_sorting_type', 'meta_value', $sorting_criteria );

                if ($wppb_manage_fields != 'not_found') {
                    foreach ($wppb_manage_fields as $wppb_field) {
                        if( $wppb_field['meta-name'] == $sorting_criteria ){
                            if( $wppb_field['field'] == 'Number' || $wppb_field['field'] == 'Phone' ){
                                $args['orderby']  = apply_filters( 'wppb_ul_sorting_type', 'meta_value_num', $sorting_criteria );
                            }

                        }
                    }
                }

                switch( $sorting_criteria ){
                    case "bio":
                        $args['meta_key'] = 'description';
                        break;
                    case "firstname":
                        $args['meta_key'] = 'first_name';
                        break;
                    case "lastname":
                        $args['meta_key'] = 'last_name';
                        break;
                    case "nickname":
                        $args['meta_key'] = 'nickname';
                        break;
                    case "role":
                        $args['meta_key'] = $wpdb->get_blog_prefix().'capabilities';
                        break;
                    case "RAND()":
                        break;
                    default:
                        $args['meta_key']  = $sorting_criteria;
                }
            }

            /* the relationship between meta query is AND because we need to narrow the result  */
            $args['meta_query'] = array('relation' => 'AND');

            /* we check if we have a meta_value and meta_key in the shortcode and add a meta query */
            if( !empty( $extra_values['meta_value'] ) && !empty( $extra_values['meta_key'] ) ){
                $args['meta_query'][0] = array( 'relation' => 'AND' ); //insert relation here
                $args['meta_query'][0][] = array(
                    'key' => $extra_values['meta_key'],
                    'value' => $extra_values['meta_value'],
                    'compare' => apply_filters( 'wppb_ul_meta_att_in_shortcode_compare', '=', $extra_values )
                );
            }
</code>```

Can someone help me out with that? Best regards, Ingo

I already tried to change some parameters and checked what was changing but no luck for me!

Body:
I'm using the WP Profile Builder plugin. In the frontend user listing I set a default sorting criteria. Works fine! But now I would like to have a second criteria that comes right after the default one.
Lets say first are the "gold" users and behind them the "silver" users.

Right now it looks like this:

 */
function wppb_userlisting_users_loop( $value, $name, $children, $extra_values ){
    if( $name == 'users' ){
        global $userlisting_args;
        global $wpdb;
        $userlisting_form_id = $extra_values['userlisting_form_id'];
        $userlisting_args = get_post_meta( $userlisting_form_id, 'wppb_ul_page_settings', true );

        if( !empty( $userlisting_args[0] ) ){
            $paged = (get_query_var('wppb_page')) ? get_query_var('wppb_page') : 1;
            if( !is_int( (int)$userlisting_args[0]['number-of-userspage'] ) || (int)$userlisting_args[0]['number-of-userspage'] == 0 )
                $userlisting_args[0]['number-of-userspage'] = 5;

            // Check if some of the listing parameters have changed
            if ( isset( $_REQUEST['setSortingOrder'] ) && sanitize_text_field( $_REQUEST['setSortingOrder'] ) !== '' )
                $sorting_order = sanitize_text_field( $_REQUEST['setSortingOrder'] );
            else
                $sorting_order = $userlisting_args[0]['default-sorting-order'];

            /* if we have admin approval on we don't want to show those users in the userlisting so we need to exclude them */
            if( wppb_get_admin_approval_option_value() === 'yes' ){
                $excluded_ids = array();
                $user_statusTaxID = get_term_by( 'name', 'unapproved', 'user_status' );
                if( $user_statusTaxID != false ){
                    $term_taxonomy_id = $user_statusTaxID->term_taxonomy_id;
                    $results = $wpdb->get_results( $wpdb->prepare( "SELECT wppb_t1.ID FROM $wpdb->users AS wppb_t1 LEFT OUTER JOIN $wpdb->term_relationships AS wppb_t0 ON wppb_t1.ID = wppb_t0.object_id WHERE wppb_t0.term_taxonomy_id = %d", $term_taxonomy_id ) );

                    foreach ( $results as $result )
                        array_push( $excluded_ids, $result->ID );

                    $excluded_ids = implode( ',', $excluded_ids );
                }
            }
            if( !empty($excluded_ids) )
                $extra_values['exclude'] .= ','. $excluded_ids;
            //set query args
            $args = array(
                'order'                         => $sorting_order,
                'include'                       => $extra_values['include'],
                'exclude'                       => $extra_values['exclude'],
                'fields'                        => array( 'ID' )
            );

            /* get all field options here, we will need it bellow */
            global $wppb_manage_fields;
            if( !isset( $wppb_manage_fields ) )
                $wppb_manage_fields = get_option( 'wppb_manage_fields', 'not_found' );

            // Check if some of the listing parameters have changed
            if ( isset( $_REQUEST['setSortingCriteria'] ) && sanitize_text_field( $_REQUEST['setSortingCriteria'] ) !== '' )
                $sorting_criteria = sanitize_text_field( $_REQUEST['setSortingCriteria'] );
            else
                $sorting_criteria = $userlisting_args[0]['default-sorting-criteria'];

            if( in_array( $sorting_criteria, array( 'login', 'email', 'url', 'registered', 'post_count', 'nicename' ) ) ){
                if( $sorting_criteria == 'nicename' )
                    $args['orderby']  = 'display_name';

            }
            else{

                $args['orderby']  = apply_filters( 'wppb_ul_sorting_type', 'meta_value', $sorting_criteria );

                if ($wppb_manage_fields != 'not_found') {
                    foreach ($wppb_manage_fields as $wppb_field) {
                        if( $wppb_field['meta-name'] == $sorting_criteria ){
                            if( $wppb_field['field'] == 'Number' || $wppb_field['field'] == 'Phone' ){
                                $args['orderby']  = apply_filters( 'wppb_ul_sorting_type', 'meta_value_num', $sorting_criteria );
                            }

                        }
                    }
                }

                switch( $sorting_criteria ){
                    case "bio":
                        $args['meta_key'] = 'description';
                        break;
                    case "firstname":
                        $args['meta_key'] = 'first_name';
                        break;
                    case "lastname":
                        $args['meta_key'] = 'last_name';
                        break;
                    case "nickname":
                        $args['meta_key'] = 'nickname';
                        break;
                    case "role":
                        $args['meta_key'] = $wpdb->get_blog_prefix().'capabilities';
                        break;
                    case "RAND()":
                        break;
                    default:
                        $args['meta_key']  = $sorting_criteria;
                }
            }

            /* the relationship between meta query is AND because we need to narrow the result  */
            $args['meta_query'] = array('relation' => 'AND');

            /* we check if we have a meta_value and meta_key in the shortcode and add a meta query */
            if( !empty( $extra_values['meta_value'] ) && !empty( $extra_values['meta_key'] ) ){
                $args['meta_query'][0] = array( 'relation' => 'AND' ); //insert relation here
                $args['meta_query'][0][] = array(
                    'key' => $extra_values['meta_key'],
                    'value' => $extra_values['meta_value'],
                    'compare' => apply_filters( 'wppb_ul_meta_att_in_shortcode_compare', '=', $extra_values )
                );
            }

Can someone help me out with that? Best regards, Ingo

I already tried to change some parameters and checked what was changing but no luck for me!


问:
How to amend the below code to replace the "text" searched, in this case "london" for text in a particular cell, "Registration Form" Sheet Cell C15
Below is the code I am using to find text within a data table and return all rows that contain that text on another sheet.  The code works on a full data table with now empty cells, however I want to perform the same task but instead of giving the text to search within the code, I want this to be determined by the user in a given cell on the sheet.

Sub CopyOverBudgetRecords()
Dim StatusCol As Range
Dim Status As Range
Dim PasteCell As Range

Set StatusCol = Sheets("Data Sheet").Range("c8:l35")
For Each Status In StatusCol

```<code>If Sheets("Registration Form").Range("c22") = "" Then
    Set PasteCell = Sheets("Registration Form").Range("c22")
Else

End If

    If Status = "london" Then Range(Status.End(xlToLeft), Status.End(xlToRight)).Copy PasteCell
</code>```

Next Status

End Sub

```<code>
I tried

using - If Status = "london" Then Range(Status.End(xlToLeft), Status.End(xlToRight)).Copy PasteCell

Replacing "london" With Sheets ("Registration Form").Range("c15").value

So - If Status = Sheets ("Registration Form").Range("c15").value Then Range(Status.End(xlToLeft), Status.End(xlToRight)).Copy PasteCell.  This didn't work.
</code>```

Body:
Below is the code I am using to find text within a data table and return all rows that contain that text on another sheet.  The code works on a full data table with now empty cells, however I want to perform the same task but instead of giving the text to search within the code, I want this to be determined by the user in a given cell on the sheet.

Sub CopyOverBudgetRecords()
Dim StatusCol As Range
Dim Status As Range
Dim PasteCell As Range

Set StatusCol = Sheets("Data Sheet").Range("c8:l35")
For Each Status In StatusCol

If Sheets("Registration Form").Range("c22") = "" Then
    Set PasteCell = Sheets("Registration Form").Range("c22")
Else

End If

    If Status = "london" Then Range(Status.End(xlToLeft), Status.End(xlToRight)).Copy PasteCell

Next Status

End Sub

I tried

using - If Status = "london" Then Range(Status.End(xlToLeft), Status.End(xlToRight)).Copy PasteCell

Replacing "london" With Sheets ("Registration Form").Range("c15").value

So - If Status = Sheets ("Registration Form").Range("c15").value Then Range(Status.End(xlToLeft), Status.End(xlToRight)).Copy PasteCell.  This didn't work.


问:
How to get data of a column of dataframe 1 is not in another column of dataframe 2
I wanted to extract the rows in a column in a pandas dataframe1 which are not present in another column on pandas dataframe2 e.g.

I wanted this kind of result. I used .isin function of pandas but got only boolean output of "true or false" or "0 or 1".

```<code>    `dataframe1.isin(dataframe2)`
and `dataframe1.isin(dataframe2).astype(int)`
</code>```

I tried using .unique also but is not the right way as it will give me unique value of dataframe2 also. If it possible please help. Please don't my if I am asking silly question as I am a new learner. Thank You :)

Body:
I wanted to extract the rows in a column in a pandas dataframe1 which are not present in another column on pandas dataframe2 e.g.

I wanted this kind of result. I used .isin function of pandas but got only boolean output of "true or false" or "0 or 1".

    `dataframe1.isin(dataframe2)`
and `dataframe1.isin(dataframe2).astype(int)`

I tried using .unique also but is not the right way as it will give me unique value of dataframe2 also. If it possible please help. Please don't my if I am asking silly question as I am a new learner. Thank You :)


问:
Displaying images in boxes
Part-1  I have to take 6 boxes and display images by clicking on any Box. IF I click on any box, The 1st empty box should display picture and then so on.

Part2- IF the Box which has been Assigned an image where to be clicked again, then that box image should be replaced.

I have Done/Solved The 1st Part OF THE Problem.

But, NOT THE PART 2. if you have better approach to both parts. Then help would be appreciated.

Template

```<code><div class="container">
      <label for="file-input">
        <div class="container1" >
          <img [src]="url[0]" *ngIf="url" class="imgdisplay" />
        </div>
      </label>

      <label for="file-input">
        <div class="container1">
          <img [src]="url[1]" *ngIf="url" class="imgdisplay" />
        </div>
      </label>

      <label for="file-input">
        <div class="container1">
          <img [src]="url[2]" *ngIf="url" class="imgdisplay" />
        </div>
      </label>

      <label for="file-input">
        <div class="container1">
          <img [src]="url[3]" *ngIf="url" class="imgdisplay" />
        </div>
      </label>

      <label for="file-input">
        <div class="container1">
          <img [src]="url[4]" *ngIf="url" class="imgdisplay" />
        </div>
      </label>

      <label for="file-input">
        <div class="container1">
          <div class="image-upload">
            <div><img [src]="url[5]" *ngIf="url" class="imgdisplay" /></div>

            <input id="file-input" type="file" #img ngModel name="img" [(ngModel)]="model.img" class="customfile"
            accept="image/*" (change)="selectFile($event)" />
          </div>
        </div>
      </label>
    </div>
</code>```

TS

```<code>   model: any = {};
    url: any = [];

    selectFile(event: any) {

     var reader = new FileReader();
     reader.readAsDataURL(event.target.files[0]);

     reader.onload = (_event) => {

       this.url.push(reader.result);
      console.log(this.url);

     }
   }
</code>```

I tried to get index and then checking with if else and then replacing it but keep getting index null or undefined. Any help would be appreciated.

Title: Displaying images in boxes

Body:
Part-1  I have to take 6 boxes and display images by clicking on any Box. IF I click on any box, The 1st empty box should display picture and then so on.

Part2- IF the Box which has been Assigned an image where to be clicked again, then that box image should be replaced.

I have Done/Solved The 1st Part OF THE Problem.

But, NOT THE PART 2. if you have better approach to both parts. Then help would be appreciated.

Template

            <input id="file-input" type="file" #img ngModel name="img" [(ngModel)]="model.img" class="customfile"
            accept="image/*" (change)="selectFile($event)" />

TS

   model: any = {};
    url: any = [];

    selectFile(event: any) {

     var reader = new FileReader();
     reader.readAsDataURL(event.target.files[0]);

     reader.onload = (_event) => {

       this.url.push(reader.result);
      console.log(this.url);

     }
   }

I tried to get index and then checking with if else and then replacing it but keep getting index null or undefined. Any help would be appreciated.


问:
How to route frontend API calls to Docker network
I developed a docker compose stack, with, let's say, an API and a frontend.

The frontend queries the API service with JavaScript Fetch calls. What I am trying to achieve is to fetch the API through the http://api/endpoint URL.

version: 3
services:
  api:
    build: ./api
    ports:
      - "5000:80"
  frontend:
    build: ./frontend
    ports:
      - "80:80"
```

Whenever I try to reach an API endpoint from the frontend:

from a terminal in the frontend container: curl http://api:5000/endpoint works

from my local browser: a fetch from my frontend to http://localhost:5000 works

from my local browser: a fetch from my frontend to http://api:5000 or http://api not found (of course, my local network is not the docker compose network)

Is there a possibility to map my container's traffic from my browser to the docker compose network? Or should I access my container from the browser differently?

I get that my javaScript is executed on runtime, therefore on my machine's network, but the "DNS" feature that docker compose offers is too good not to be used even on frontend development purposes.

Many thanks in advance guys for your ideas!

Body:
I developed a docker compose stack, with, let's say, an API and a frontend.

The frontend queries the API service with JavaScript Fetch calls. What I am trying to achieve is to fetch the API through the http://api/endpoint URL.

version: 3
services:
  api:
    build: ./api
    ports:
      - "5000:80"
  frontend:
    build: ./frontend
    ports:
      - "80:80"

Whenever I try to reach an API endpoint from the frontend:

from a terminal in the frontend container: curl http://api:5000/endpoint works

from my local browser: a fetch from my frontend to http://localhost:5000 works

from my local browser: a fetch from my frontend to http://api:5000 or http://api not found (of course, my local network is not the docker compose network)

Is there a possibility to map my container's traffic from my browser to the docker compose network? Or should I access my container from the browser differently?

I get that my javaScript is executed on runtime, therefore on my machine's network, but the "DNS" feature that docker compose offers is too good not to be used even on frontend development purposes.

Many thanks in advance guys for your ideas!


问:
Disable ios App Tracking for expo react native app
We don't track users in our expo react native app and do not use any ad libraries but in the expo eas build somehow AppTrackingTransparency framework is added and we get rejected in App Store. I read expo is adding this by default. But is there a way to disable it?

We use the following libraries though which may also adding this framework:

expo-facebook

firebase

Can someone help with this issue? How is it possible to turn off the AppTrackingTransparency framework with the eas build. Maybe in eas.json or app.json?

Is there a library to turn this off?

The only idea I have is to use this library and leave the tracking description (userTrackingPermission) empty:
expo-tracking-transparency plugin


问:
SQL Standard Server Transaction Log for an SQL Express Server
I have an SQL express Server whereby the Transaction log becomes full.
Given the Edition of SQL server it cannot be directly managed with various tools like in the Standard Edition of SQL Server.

We do have another SQL Server - Full Standard version used in this environment as part of a larger system.
To anticipate the question: No we cannot add this database to that server.

Is there any way we can utilize the power of Standard SQL server to handle the Transaction logs for the SQL express server?
As if the Transaction Log was being handled by our full SQL Server with the tools available there?


问:
set output log in CTestConfig.cmake
Using ctest on terminal one can save the output by using --output-log. Is it possible to also set the (default) log output using CTestConfig.cmake?

Title: set output log in CTestConfig.cmake


问:
Unable to push to dockerhub : 504 gateway timeout
I m having a problem pushing a docker image for a maven project to dockerhub.
It says 504 Gateway Timeout even though i can pull images

I tought at first it was because of image size so i tried to push an image with 14kb
Still the same error.


问:
Custom weblogic log format
I have application running through cargo-maven3-plugin (1.9.4) on weblogic14x container.
I would like to modify weblogic log to exclude fields which are not important for me.

Currently log looks like this:

```<code>[INFO] [talledLocalContainer] <19 gru 2022, 13:12:33,731> <Notice> <Stdout> <BEA-000000> <log message from my application>
</code>```

I would like it to look like this:

```<code><log message from my application>
</code>```

Is there a way to do that in weblogic14? I was able to do something similar in older weblogic versions but I didn't find anything for this one.

Even an extremaly ugly hack would be fine, I don't care as long as it will work ;)

Title: Custom weblogic log format

Body:
I have application running through cargo-maven3-plugin (1.9.4) on weblogic14x container.
I would like to modify weblogic log to exclude fields which are not important for me.

Currently log looks like this:

[INFO] [talledLocalContainer] <19 gru 2022, 13:12:33,731> <Notice> <Stdout> <BEA-000000> <log message from my application>

I would like it to look like this:

<log message from my application>

Is there a way to do that in weblogic14? I was able to do something similar in older weblogic versions but I didn't find anything for this one.

Even an extremaly ugly hack would be fine, I don't care as long as it will work ;)


问:
How to add the interaction term between dummies and continuous variable?
I want to include university-specific linear time trends in the following regression.

The data is like this:

unitid
year

100654
1991

100654
1992

100654
1993

```<code>model <- plm(gradrate4yr ~ block1 + block2 + instatetuition + faculty + costs
       + per_urm + per_white + per_fem + as.factor(unitid) + as.factor(year), data = gradeData,
            model = 'within', weights = meansize)
</code>```

I've tried these - year * unitid, and also unitid:year , both of them are likely not the right way.

```<code>model <- plm(gradrate4yr ~ year * unitid + block1 + block2 + instatetuition + faculty + costs
            + per_urm + per_white + per_fem + as.factor(unitid) + as.factor(year), data = gradeData,
            model = 'within', weights = meansize)
</code>```

Body:
I want to include university-specific linear time trends in the following regression.

The data is like this:

unitid
year

100654
1991

100654
1992

100654
1993

model <- plm(gradrate4yr ~ block1 + block2 + instatetuition + faculty + costs
       + per_urm + per_white + per_fem + as.factor(unitid) + as.factor(year), data = gradeData,
            model = 'within', weights = meansize)

I've tried these - year * unitid, and also unitid:year , both of them are likely not the right way.

model <- plm(gradrate4yr ~ year * unitid + block1 + block2 + instatetuition + faculty + costs
            + per_urm + per_white + per_fem + as.factor(unitid) + as.factor(year), data = gradeData,
            model = 'within', weights = meansize)


问:
Why are navigator.share and navigator.clipboard.write failing on some Android devices?
I got navigator.share() and navigator.clipboard.write() working on all my devices: Android, iPhone, and Windows PC.

However, the same web page doesn't work for other users. navigator.share() results in this error:

```TypeError: navigator.share is not a function```

And navigator.clipboard.write() results in this error:

```Write permission denied.```

I believe both are related to device permissions. I am serving the page from HTTPS, as required. And I am puzzled why it works on my Android device, but not other Android devices. Since I can't reproduce this error on my own devices, what is the best way to debug this issue?

A live version can be tested here: https://blues-978dizsk2-leftium.vercel.app/?share=1

The left button calls navigator.share(). It is supposed to open the device's native share dialog.

The right button calls navigator.clipboard.write(). It is supposed to paste an image to the device's clipboard.

Sometimes the buttons don't work right away; if they worked, the message below them immediately changes.

Error messages are in English.

The relevant code is here:

Code that calls navigator.share() (left button):

```<code>async function handleClickShare() {

    let options = {
        x: window.scrollX,
        y: window.scrollY,
    }

    shareMessage = '공유 준비중...'

    try {
        const canvas = await html2canvas(shareElement, options);
        const blob = await canvasToBlob(canvas)

        await navigator.share({
            files: [new File([blob], 'blues.png', { type: blob.type })],
            // url: 'https://www.modu-blues.com/',
            text: `${title}\n${numTotal}명 신청 (남${numMen} 여${numWomen})`,
            title
        });
        shareMessage = '공유 됐어요!'
    } catch (e) {
        shareMessage = e
    }
}
</code>```

Code that calls navigator.clipboard.write() (right button):

```<code>async function handleClickCopy() {
    let options = {
        x: window.scrollX,
        y: window.scrollY,
    }
    shareMessage = '복사 준비중...'
    const makeImagePromise = async () => {
        try {
            const canvas = await html2canvas(shareElement, options);
            return canvasToBlob(canvas)
        } catch (error) {
            shareMessage = error.message
        }
    }
    try {
        await navigator.clipboard.write([new ClipboardItem({ "image/png": makeImagePromise() })]);
        shareMessage = '클립보드로 복사 됐어요!'
    } catch (error) {
        shareMessage = error.message
    }
}
</code>```

Interestingly, the navigator.clipboard.write() button used to not work on iPhone until I wrapped the await code in makeImagePromise(). Perhaps is there a problem that some devices don't like these navigator methods being called from an async method?

Body:
I got navigator.share() and navigator.clipboard.write() working on all my devices: Android, iPhone, and Windows PC.

However, the same web page doesn't work for other users. navigator.share() results in this error:

TypeError: navigator.share is not a function

And navigator.clipboard.write() results in this error:

Write permission denied.

I believe both are related to device permissions. I am serving the page from HTTPS, as required. And I am puzzled why it works on my Android device, but not other Android devices. Since I can't reproduce this error on my own devices, what is the best way to debug this issue?

A live version can be tested here: https://blues-978dizsk2-leftium.vercel.app/?share=1

The left button calls navigator.share(). It is supposed to open the device's native share dialog.

The right button calls navigator.clipboard.write(). It is supposed to paste an image to the device's clipboard.

Sometimes the buttons don't work right away; if they worked, the message below them immediately changes.

Error messages are in English.

The relevant code is here:

Code that calls navigator.share() (left button):

async function handleClickShare() {

    let options = {
        x: window.scrollX,
        y: window.scrollY,
    }

    shareMessage = '공유 준비중...'

    try {
        const canvas = await html2canvas(shareElement, options);
        const blob = await canvasToBlob(canvas)

        await navigator.share({
            files: [new File([blob], 'blues.png', { type: blob.type })],
            // url: 'https://www.modu-blues.com/',
            text: `${title}\n${numTotal}명 신청 (남${numMen} 여${numWomen})`,
            title
        });
        shareMessage = '공유 됐어요!'
    } catch (e) {
        shareMessage = e
    }
}

Code that calls navigator.clipboard.write() (right button):

async function handleClickCopy() {
    let options = {
        x: window.scrollX,
        y: window.scrollY,
    }
    shareMessage = '복사 준비중...'
    const makeImagePromise = async () => {
        try {
            const canvas = await html2canvas(shareElement, options);
            return canvasToBlob(canvas)
        } catch (error) {
            shareMessage = error.message
        }
    }
    try {
        await navigator.clipboard.write([new ClipboardItem({ "image/png": makeImagePromise() })]);
        shareMessage = '클립보드로 복사 됐어요!'
    } catch (error) {
        shareMessage = error.message
    }
}

Interestingly, the navigator.clipboard.write() button used to not work on iPhone until I wrapped the await code in makeImagePromise(). Perhaps is there a problem that some devices don't like these navigator methods being called from an async method?


问:
How to completely ignore Date from Moment.js?
I have a start date and end date.
I want to calculate the time difference between the two, but without taking into account the Date.

```<code>var startTime = moment('02-01-2021 13:01:01'); {/* Mon Feb 01 2021 13:01:01 GMT+0100 */}
var endTime = moment('02-01-2022 17:01:01'); {/* Tue Feb 01 2022 17:01:01 GMT+0100 */}
</code>```

If we only look at the Time, the difference between the two (in hours) is 8764.

```<code>endTime.diff(startTime,'hours')
</code>```

My desired result would be 4.

Body:
I have a start date and end date.
I want to calculate the time difference between the two, but without taking into account the Date.

var startTime = moment('02-01-2021 13:01:01'); {/* Mon Feb 01 2021 13:01:01 GMT+0100 */}
var endTime = moment('02-01-2022 17:01:01'); {/* Tue Feb 01 2022 17:01:01 GMT+0100 */}

If we only look at the Time, the difference between the two (in hours) is 8764.

endTime.diff(startTime,'hours')

My desired result would be 4.


问:
Socket.IO giving constant polling 404 error (Socket.IO new user)
Im using a Express server and trying to implement Socket.io for the first time, and I keep getting this whenever I open it:

```<code>GET /socket.io/?EIO=4&transport=polling&t=OKgNATB 404 0.526 ms - 149
GET /socket.io/?EIO=4&transport=polling&t=OKgNBww 404 0.332 ms - 149
GET /socket.io/?EIO=4&transport=polling&t=OKgNDOV 404 0.411 ms - 149

</code>```

app.ts:

```<code> import express from 'express';
 import morgan from 'morgan';
 import favicon from 'serve-favicon';
 import path from 'path';
 import cors from 'cors';

 import { errorManager } from './middlewares/errors_middleware.js';
 import { ordersRouter } from './routers/OrdersRouter.js';
 import { usersRouter } from './routers/UsersRouter.js';

 import { createServer } from 'http';
 import { Server } from 'socket.io';

 export const app = express();
 const httpServer = createServer(app);
 const io = new Server(httpServer, {
 cors: {
 origin: '*',
     },
 });

 io.on('connection', (socket) => {
 console.log('HELLO');
 });

 app.use(favicon(path.join('.', 'public', 'favicon.ico')));
 app.use(cors());
 app.use(morgan('dev'));
 app.use(express.json());

 app.get('/', (_req, res, next) => {
 res.send('H');
 next();
 });

 Routers
 app.use('/orders', ordersRouter);
 app.use('/users', usersRouter);

 app.use(errorManager);

</code>```

index.ts:

```<code> import http from 'http';
 import createDebug from 'debug';
 import { app } from './app.js';
 import { dbConnect } from './dbconnect/dbconnect.js';

 const debug = createDebug('StoryLine:INDEX');

 const port = 3300;
 const server = http.createServer(app);

 server.on('listening', () => {
 const addr = server.address();
 if (addr === null) return;
 let bind: string;
 if (typeof addr === 'string') {
 bind = 'pipe ' + addr;
 else {
 bind =
 addr.address === '::'
                 ? `http://localhost:${addr?.port}`
                 : `port ${addr?.port}`;
     }
 debug(`SERVER: Listening on: ${bind}`);
 });

 server.on('error', (error: Error, response: http.ServerResponse) => {
 response.write(error.message);
 response.end();
 });

 dbConnect()
     .then((mongoose) => {
 debug(
             'Database connection -> SUCCESSFUL: ',
 mongoose.connection.db.databaseName
         );
 server.listen(port);
     })
     .catch((error) => {
 debug('Database connection -> COULD NOT CONNECT');
 server.emit(error);
     });
</code>```

I simply want to get a console.log telling me that a user is connecting. I have tried following the Socket.io docs for express but its not working for me.

Body:
Im using a Express server and trying to implement Socket.io for the first time, and I keep getting this whenever I open it:

GET /socket.io/?EIO=4&transport=polling&t=OKgNATB 404 0.526 ms - 149
GET /socket.io/?EIO=4&transport=polling&t=OKgNBww 404 0.332 ms - 149
GET /socket.io/?EIO=4&transport=polling&t=OKgNDOV 404 0.411 ms - 149

app.ts:

 import express from 'express';
 import morgan from 'morgan';
 import favicon from 'serve-favicon';
 import path from 'path';
 import cors from 'cors';

 import { errorManager } from './middlewares/errors_middleware.js';
 import { ordersRouter } from './routers/OrdersRouter.js';
 import { usersRouter } from './routers/UsersRouter.js';

 import { createServer } from 'http';
 import { Server } from 'socket.io';

 export const app = express();
 const httpServer = createServer(app);
 const io = new Server(httpServer, {
 cors: {
 origin: '*',
     },
 });

 io.on('connection', (socket) => {
 console.log('HELLO');
 });

 app.use(favicon(path.join('.', 'public', 'favicon.ico')));
 app.use(cors());
 app.use(morgan('dev'));
 app.use(express.json());

 app.get('/', (_req, res, next) => {
 res.send('H');
 next();
 });

 Routers
 app.use('/orders', ordersRouter);
 app.use('/users', usersRouter);

 app.use(errorManager);

index.ts:

 import http from 'http';
 import createDebug from 'debug';
 import { app } from './app.js';
 import { dbConnect } from './dbconnect/dbconnect.js';

 const debug = createDebug('StoryLine:INDEX');

 const port = 3300;
 const server = http.createServer(app);

 server.on('listening', () => {
 const addr = server.address();
 if (addr === null) return;
 let bind: string;
 if (typeof addr === 'string') {
 bind = 'pipe ' + addr;
 else {
 bind =
 addr.address === '::'
                 ? `http://localhost:${addr?.port}`
                 : `port ${addr?.port}`;
     }
 debug(`SERVER: Listening on: ${bind}`);
 });

 server.on('error', (error: Error, response: http.ServerResponse) => {
 response.write(error.message);
 response.end();
 });

 dbConnect()
     .then((mongoose) => {
 debug(
             'Database connection -> SUCCESSFUL: ',
 mongoose.connection.db.databaseName
         );
 server.listen(port);
     })
     .catch((error) => {
 debug('Database connection -> COULD NOT CONNECT');
 server.emit(error);
     });

I simply want to get a console.log telling me that a user is connecting. I have tried following the Socket.io docs for express but its not working for me.


问:
TypeError while trying to add a custom property to BPMN Service Tasks
I am trying to customize bpmn-js-properties-panel according to this example here.

I am trying to add a custom property destination to all the service tasks.

Please refer to my codesandbox.

I get this below error when I try to add Service Task:

I am not sure how to resolve this. Any help would be appreciated. Thanks!


问:
Two querys with same execution time, but different execution time inside an insert
So, I have two selects, that costs the same amount of time ~2,5 minutes. But when I try insert into... select(query1) and insert into... select(query2), one takes a lot of time more than the other.

The only difference between the two query is a case, with the case being inside an inner join or outside.

I really don´t know why there is so much performance difference.

I tried the first one and it only takes like 5 minutes to insert. And the second one never goes to an end, being active for more than an hour. The amount of rows to insert is around 5 million.


问:
Issue with routing http flow with Traefik
I have a small lab setup on docker lab server where I have several containers. I wanted to set up a proxy with Traefik, but I stuck on one thing.

Looks like routing works fine but I am having err_connection_refused when I try to access routed services by the browser.

It works fine with the curl command.

Using DNSMasq to manage records - traefik for proxy.

Below docker-compose files for traefik and test container which I am using for testing the proxy.

Heimdall Dashboard:

```<code>---
version: "2.1"
services:
  heimdall:
    image: lscr.io/linuxserver/heimdall:latest
    container_name: heimdall
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
    volumes:
      - /path/to/appdata/config:/config
    restart: unless-stopped
    labels:
    - "traefik.http.routers.heimdall-www.rule=Host(`heimdall.lab`)"
    - "traefik.http.services.heimdall-www.loadbalancer.server.port=80"
networks:
  default:
    name: traefik_default
</code>```

Traefik container:

```<code>version: '3'
services:
  reverse-proxy:
    # The official v2 Traefik docker image
    image: traefik:v2.9
    # Enables the web UI and tells Traefik to listen to Docker
    command: --api.insecure=true --providers.docker
    ports:
      # The HTTP port
      - "80:80"
      # The Web UI (enabled by --api.insecure=true)
      - "8080:8080"
    volumes:
      # So that Traefik can listen to the Docker events
      - /var/run/docker.sock:/var/run/docker.sock
  whoami:
    # A container that exposes an API to show its IP address
    image: traefik/whoami
    labels:
      - "traefik.http.routers.whoami.rule=Host(`whoami.lab`)"
      - "traefik.http.services.whoami.loadbalancer.server.port=80"
</code>```

DNSmasq entry

```<code>address=/.lab/127.0.0.1
</code>```

I dont understand why curling works fine e.g.:

```<code>curl -H Host:whoami.lab http://192.168.0.150
Hostname: 1ad1e42dd818
IP: 127.0.0.1
IP: 172.21.0.4
RemoteAddr: 172.21.0.2:54128
GET / HTTP/1.1
Host: whoami.lab
User-Agent: curl/7.84.0
Accept: */*
Accept-Encoding: gzip
X-Forwarded-For: 192.168.0.100
X-Forwarded-Host: whoami.lab
X-Forwarded-Port: 80
X-Forwarded-Proto: http
X-Forwarded-Server: ca631c80565a
X-Real-Ip: 192.168.0.100
</code>```

Body:
I have a small lab setup on docker lab server where I have several containers. I wanted to set up a proxy with Traefik, but I stuck on one thing.

Looks like routing works fine but I am having err_connection_refused when I try to access routed services by the browser.

It works fine with the curl command.

Using DNSMasq to manage records - traefik for proxy.

Below docker-compose files for traefik and test container which I am using for testing the proxy.

Heimdall Dashboard:

---
version: "2.1"
services:
  heimdall:
    image: lscr.io/linuxserver/heimdall:latest
    container_name: heimdall
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
    volumes:
      - /path/to/appdata/config:/config
    restart: unless-stopped
    labels:
    - "traefik.http.routers.heimdall-www.rule=Host(`heimdall.lab`)"
    - "traefik.http.services.heimdall-www.loadbalancer.server.port=80"
networks:
  default:
    name: traefik_default

Traefik container:

version: '3'
services:
  reverse-proxy:
    # The official v2 Traefik docker image
    image: traefik:v2.9
    # Enables the web UI and tells Traefik to listen to Docker
    command: --api.insecure=true --providers.docker
    ports:
      # The HTTP port
      - "80:80"
      # The Web UI (enabled by --api.insecure=true)
      - "8080:8080"
    volumes:
      # So that Traefik can listen to the Docker events
      - /var/run/docker.sock:/var/run/docker.sock
  whoami:
    # A container that exposes an API to show its IP address
    image: traefik/whoami
    labels:
      - "traefik.http.routers.whoami.rule=Host(`whoami.lab`)"
      - "traefik.http.services.whoami.loadbalancer.server.port=80"

DNSmasq entry

address=/.lab/127.0.0.1

I dont understand why curling works fine e.g.:

curl -H Host:whoami.lab http://192.168.0.150
Hostname: 1ad1e42dd818
IP: 127.0.0.1
IP: 172.21.0.4
RemoteAddr: 172.21.0.2:54128
GET / HTTP/1.1
Host: whoami.lab
User-Agent: curl/7.84.0
Accept: */*
Accept-Encoding: gzip
X-Forwarded-For: 192.168.0.100
X-Forwarded-Host: whoami.lab
X-Forwarded-Port: 80
X-Forwarded-Proto: http
X-Forwarded-Server: ca631c80565a
X-Real-Ip: 192.168.0.100


问:
Unable to select all rows of information_schema.triggers
I have two kinds of users in my Postgres database. One has access to everything in the database and has admin access. The other kind has SELECT access on public schema and USAGE access on information_schema.

When I run the following query, the second kind of user sees only a subset of all results which the first kind of user can see.

SELECT action_statement, event_object_table
FROM information_schema.triggers;
```

I am not able to understand what could be happening here. Triggers on the table from same public schema are present, but miraculously some triggers are missing for other tables in the same public schema.

Body:
I have two kinds of users in my Postgres database. One has access to everything in the database and has admin access. The other kind has SELECT access on public schema and USAGE access on information_schema.

When I run the following query, the second kind of user sees only a subset of all results which the first kind of user can see.

SELECT action_statement, event_object_table
FROM information_schema.triggers;

I am not able to understand what could be happening here. Triggers on the table from same public schema are present, but miraculously some triggers are missing for other tables in the same public schema.


问:
Sumproduct in Netezza
I want to calculate sumproduct in netezza table, where one column is fixed. In frist column (A) I have some numbers in DISCOUNT are discount factors. As a result I want to get sumproduct bewteen A and DISCOUNT, where DISCOUNT always start from first row.

Number in RESULTS:

14,54535 = 5/(1+2%)+3/(1+3%)+7/(1+4%),

9.737293 = 3/(1+2%)+7/(1+3%)

6.862745 = 7/(1+2%)

Always when copunting the next number in columns RESULT, we ignore the previous values from A, but always use the DISCOUNT from MATURITY=1 forward.

MATURITY
A
R
DISCOUNT
RESULT

1
5
2%
98.0392...%
14,54535...

2
3
3%
97.0874...%
9.737293...

3
7
4%
97.0874...%
6.862745...

Is the any way to do that in Neteza? Without using multiple joins for rates/discounts? Since the dimension of data can vary.

Title: Sumproduct in Netezza


问:
Getting error while integrating Socket io and cloudflare
Server-side code:

```<code>const express = require("express");
const app = express();
const http = require("http");
const { Server } = require("socket.io");
const cors = require("cors");

app.use(cors());

const server = http.createServer(app);

const io = new Server(server, {
  cors: {
    origin: "http://localhost:3000",
    methods: ["GET", "POST"],
  },
});

io.on("connection", (socket) => {
  console.log(`User Connected: ${socket.id}`);

  socket.on("join_room", (data) => {
    socket.join(data);
  });
</code>```

Client-side code:

```<code>import io from "socket.io-client";

const socket = io.connect("http://localhost:8080");

function App() {

  const joinRoom = () => {
    if (room !== "") {
      socket.emit("join_room", room);
    }
  };
</code>```

But getting the following error after hosting it to cloudflare which works fine in local.:

polling.js:311          GET http://localhost:8080/socket.io/?EIO=4&transport=polling&t=OKgPK3u net::ERR_CONNECTION_REFUSED

I tried giving different port but still facing the same problem. Can anyone please help me?

Body:
Server-side code:

const express = require("express");
const app = express();
const http = require("http");
const { Server } = require("socket.io");
const cors = require("cors");

app.use(cors());

const server = http.createServer(app);

const io = new Server(server, {
  cors: {
    origin: "http://localhost:3000",
    methods: ["GET", "POST"],
  },
});

io.on("connection", (socket) => {
  console.log(`User Connected: ${socket.id}`);

  socket.on("join_room", (data) => {
    socket.join(data);
  });

Client-side code:

import io from "socket.io-client";

const socket = io.connect("http://localhost:8080");

function App() {

  const joinRoom = () => {
    if (room !== "") {
      socket.emit("join_room", room);
    }
  };

But getting the following error after hosting it to cloudflare which works fine in local.:

polling.js:311          GET http://localhost:8080/socket.io/?EIO=4&transport=polling&t=OKgPK3u net::ERR_CONNECTION_REFUSED

I tried giving different port but still facing the same problem. Can anyone please help me?