问:
Solved the problem of "a parameter list without types is only allowed in a function definition" error
I am a beginner in program C, and I have a problem when running the code for student management program on VScode which I cannot run the displayStudent and searchstudentbyID functions and I cannot find out what causes these errors

Here is my programming code (p/s: as i am a vietnamese student, so some of the names in printfs and in comments section are in vietnamese).

```<code>//Seach by id
#include <stdio.h>
#include <stdlib.h>

struct student //ten cau truc
{
    int id;
    char name[50];
    float marks;
};
struct student *st;

int main(){
    int i,n;
    printf("\nBan muon luu bao nhieu sv: ");
    scanf("%d",&n);
    //cap phat bo nho dong cho struct
    st = (struct student*)malloc(n*sizeof(struct student));

    for(i =0; i< n; i++){
        //input information
        printf("\nEnter student information ");
        printf("\n--------------------------");

        printf("\nStudent id: ");
        scanf("%d",&(st+i)->id);//scanf("%d",&st[i].id);
        fflush(stdin);
        printf("\nStudent name:");
        scanf("%s",&(st+i)->name);

        printf("\nStudent Marks: ");
        scanf("%f",&(st+i)->marks);
    }
}
    searchStudentById(st,n);
    displayStudent(st,n);
void displayStudent(struct student *st, int n){
    int i;
    for(i=0; i<n; i++){
        printf("\nId: %d, name: %s, Marks: %f",(st+i)->id, (st+i)->name, (st+i)->marks );
    }
}
void searchStudentById(struct student *st, int n){
    int search;
    int i;
    printf("\nNhap id sv can tim: ");
    scanf("%d",&search);
    for(i=0; i<n; i++){
        if((st+i)->id==search){
            printf("\nId: %d, name: %s, Marks: %f",(st+i)->id, (st+i)->name, (st+i)->marks );
        }
    }
}
</code>```

And here is the errors

```<code>tempCodeRunnerFile.c:35:5: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
    searchStudentById(st,n);
    ^
tempCodeRunnerFile.c:35:23: error: a parameter list without types is only allowed in a function definition
    searchStudentById(st,n);
                      ^
tempCodeRunnerFile.c:36:5: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
    displayStudent(st,n);
    ^
tempCodeRunnerFile.c:36:20: error: a parameter list without types is only allowed in a function definition
    displayStudent(st,n);
                   ^
3 warnings and 2 errors generated.
</code>```

Body:
I am a beginner in program C, and I have a problem when running the code for student management program on VScode which I cannot run the displayStudent and searchstudentbyID functions and I cannot find out what causes these errors

Here is my programming code (p/s: as i am a vietnamese student, so some of the names in printfs and in comments section are in vietnamese).

//Seach by id
#include <stdio.h>
#include <stdlib.h>

struct student //ten cau truc
{
    int id;
    char name[50];
    float marks;
};
struct student *st;

int main(){
    int i,n;
    printf("\nBan muon luu bao nhieu sv: ");
    scanf("%d",&n);
    //cap phat bo nho dong cho struct
    st = (struct student*)malloc(n*sizeof(struct student));

    for(i =0; i< n; i++){
        //input information
        printf("\nEnter student information ");
        printf("\n--------------------------");

        printf("\nStudent id: ");
        scanf("%d",&(st+i)->id);//scanf("%d",&st[i].id);
        fflush(stdin);
        printf("\nStudent name:");
        scanf("%s",&(st+i)->name);

        printf("\nStudent Marks: ");
        scanf("%f",&(st+i)->marks);
    }
}
    searchStudentById(st,n);
    displayStudent(st,n);
void displayStudent(struct student *st, int n){
    int i;
    for(i=0; i<n; i++){
        printf("\nId: %d, name: %s, Marks: %f",(st+i)->id, (st+i)->name, (st+i)->marks );
    }
}
void searchStudentById(struct student *st, int n){
    int search;
    int i;
    printf("\nNhap id sv can tim: ");
    scanf("%d",&search);
    for(i=0; i<n; i++){
        if((st+i)->id==search){
            printf("\nId: %d, name: %s, Marks: %f",(st+i)->id, (st+i)->name, (st+i)->marks );
        }
    }
}

And here is the errors

tempCodeRunnerFile.c:35:5: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
    searchStudentById(st,n);
    ^
tempCodeRunnerFile.c:35:23: error: a parameter list without types is only allowed in a function definition
    searchStudentById(st,n);
                      ^
tempCodeRunnerFile.c:36:5: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
    displayStudent(st,n);
    ^
tempCodeRunnerFile.c:36:20: error: a parameter list without types is only allowed in a function definition
    displayStudent(st,n);
                   ^
3 warnings and 2 errors generated.


来源: stackexchange

问:
Vercel fails to resolve MongoDB cluster's URL
I have a SvelteKit app hosted on Vercel, along with which I would like to use a MongoDB database. Specifically, I would like to build a Vercel edge function that would query the database and return the result to the caller.

I have already installed the Vercel and MongoDB integration. Here's the function I've written:

```<code>import { MongoClient } from "mongodb"

export const config = {
  runtime: 'experimental-edge',
};

const client = new MongoClient(process.env.MONGODB_URI as string);

export default async (req: Request) => {
  await client.connect();
  const db = client.db('db').collection('coll')

  const res = await db.findOne();

  return new Response(JSON.stringify({ result: res }));
}
</code>```

however the deploy fails with the following errors:

```<code>> Using @sveltejs/adapter-vercel
  ✔ done
Using TypeScript 4.9.3 (local user-provided)

Build Completed in /vercel/output [13s]

Build failed with 73 errors:

vc-file-system:node_modules/@aws-sdk/credential-provider-imds/dist-es/fromContainerMetadata.js:2:22: ERROR: Could not resolve "url"

vc-file-system:node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/httpRequest.js:2:23: ERROR: Could not resolve "buffer" vc-file-system:node_modules/@aws-sdk/

credential-provider-imds/dist-es/remoteProvider/httpRequest.js:3:24: ERROR: Could not resolve "http"vc-file-system:node_modules/@aws-sdk/

credential-provider-process/dist-esresolveProcessCredentials.js:2:21: ERROR: Could not resolve "child_process"

vc-file-system:node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js:3:26: ERROR: Could not resolve "util"
...
</code>```

Considering my Mongo cluster is indeed hosted on AWS, to me this reads as the adapter failing to resolve the cluster's URL. However I've tried connecting to said cluster using the connection string via MongoDB Compass and it worked flawlessly, so I don't think the env var is the one to blame.

I have no network filters active on my database and am accepting connections from any IP address.

ContentLicense: CC BY-SA 4.0

Body:
I have a SvelteKit app hosted on Vercel, along with which I would like to use a MongoDB database. Specifically, I would like to build a Vercel edge function that would query the database and return the result to the caller.

I have already installed the Vercel and MongoDB integration. Here's the function I've written:

import { MongoClient } from "mongodb"

export const config = {
  runtime: 'experimental-edge',
};

const client = new MongoClient(process.env.MONGODB_URI as string);

export default async (req: Request) => {
  await client.connect();
  const db = client.db('db').collection('coll')

  const res = await db.findOne();

  return new Response(JSON.stringify({ result: res }));
}

however the deploy fails with the following errors:

> Using @sveltejs/adapter-vercel
  ✔ done
Using TypeScript 4.9.3 (local user-provided)

Build Completed in /vercel/output [13s]

Build failed with 73 errors:

vc-file-system:node_modules/@aws-sdk/credential-provider-imds/dist-es/fromContainerMetadata.js:2:22: ERROR: Could not resolve "url"

vc-file-system:node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/httpRequest.js:2:23: ERROR: Could not resolve "buffer" vc-file-system:node_modules/@aws-sdk/

credential-provider-imds/dist-es/remoteProvider/httpRequest.js:3:24: ERROR: Could not resolve "http"vc-file-system:node_modules/@aws-sdk/

credential-provider-process/dist-esresolveProcessCredentials.js:2:21: ERROR: Could not resolve "child_process"

vc-file-system:node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js:3:26: ERROR: Could not resolve "util"
...

Considering my Mongo cluster is indeed hosted on AWS, to me this reads as the adapter failing to resolve the cluster's URL. However I've tried connecting to said cluster using the connection string via MongoDB Compass and it worked flawlessly, so I don't think the env var is the one to blame.

I have no network filters active on my database and am accepting connections from any IP address.


问:
Pandas - KeyError when dropping columns
I have df (attached).
I want to drop one column "image" but I keep getting KeyError 'image' not found in axis.

Code used for dropping column:

monarchs_df = df.drop(columns =['image'], axis=1, inplace=True)
or
monarchs_df = df.drop(['image'], axis=1, inplace=True)

still error. What am I doing wrong?

different approach to the code - still the same error

Title: Pandas - KeyError when dropping columns


问:
Can't find a proper way to get my groupped by results inside a JSON_ARRAY of JSON_OBJECT, ERROR 1111 (HY000): Invalid use of group function
i'm facing a problem when i'm doing a subquery on a big table of more than 100k of lines.

```<code>SELECT
  JSON_ARRAYAGG(
    JSON_OBJECT(
      'date_interpreted',
      date_interpreted,
      'humidity',
      AVG(humidity),
      'battery',
      AVG(battery),
      'groundTemperature',
      AVG(Temperature_Soil)
    )
  )
FROM
  interpreteddata
WHERE
  ID_Sensor = 2
GROUP BY
  DATE(date_interpreted);
</code>```

ERROR 1111 (HY000): Invalid use of group function

This is a subquery so i need only 1 result, which is the main problem here, i can't set the results inside an array or concat them with GROUP_CONCAT() due to AVG() AND GROUP BY().

Do you know a way to use AVG() and GROUP BY on a JSON_OBJECT() inside JSON_ARRAYAGG() ?

Or any tricks that could help me with groupped object by date ?

I'm stuck like hell and after hours of browsing potentials solution i just can't get one who will finally works.

Due to the amount of data inside that table, i can't just get all the data and order/make average on my backend.

Thanks you by advance

Body:
i'm facing a problem when i'm doing a subquery on a big table of more than 100k of lines.

SELECT
  JSON_ARRAYAGG(
    JSON_OBJECT(
      'date_interpreted',
      date_interpreted,
      'humidity',
      AVG(humidity),
      'battery',
      AVG(battery),
      'groundTemperature',
      AVG(Temperature_Soil)
    )
  )
FROM
  interpreteddata
WHERE
  ID_Sensor = 2
GROUP BY
  DATE(date_interpreted);

ERROR 1111 (HY000): Invalid use of group function

This is a subquery so i need only 1 result, which is the main problem here, i can't set the results inside an array or concat them with GROUP_CONCAT() due to AVG() AND GROUP BY().

Do you know a way to use AVG() and GROUP BY on a JSON_OBJECT() inside JSON_ARRAYAGG() ?

Or any tricks that could help me with groupped object by date ?

I'm stuck like hell and after hours of browsing potentials solution i just can't get one who will finally works.

Due to the amount of data inside that table, i can't just get all the data and order/make average on my backend.

Thanks you by advance


问:
Using multiple cases for same lookup in Object literal
I'm using an object literal to return a value based on a portion of a URL. However, there are many cases where a value passed to the function will have the same return value. How can I update my function to return the same value for multiple similar lookups?

```<code>const useQueue = (type) => {
  return {
    'mer':'perm',
    'acx':'perm',
    'chcm':'perm',
    'cloud':'technology',
    'storage':'technology',
    'database':'technology',
    'news':'corporate'
  }[type]
}

useQueue(url.split("/")[3])
</code>```

How can I use an || to combine similar lookups for the same value such as

```<code>mer || acx || chcm : 'perm'
</code>```

Body:
I'm using an object literal to return a value based on a portion of a URL. However, there are many cases where a value passed to the function will have the same return value. How can I update my function to return the same value for multiple similar lookups?

const useQueue = (type) => {
  return {
    'mer':'perm',
    'acx':'perm',
    'chcm':'perm',
    'cloud':'technology',
    'storage':'technology',
    'database':'technology',
    'news':'corporate'
  }[type]
}

useQueue(url.split("/")[3])

How can I use an || to combine similar lookups for the same value such as

mer || acx || chcm : 'perm'


问:
remove a file from a jar using shell
I want to remove a file from a jar. However this file should only be removed from a specific folder. I am using below command but no luck

```<code>zip -d abc.jar /myfolder/test1.txt
</code>```

Kindly suggest

Title: remove a file from a jar using shell

Body:
I want to remove a file from a jar. However this file should only be removed from a specific folder. I am using below command but no luck

zip -d abc.jar /myfolder/test1.txt

Kindly suggest


问:
Unable to reverse proxy on Nuxt3
I am trying to change the base url when my nuxt3 app is deployed.

I am using the package nuxt-proxy on "nuxt": "3.0.0-rc.11",

I then add the following code to my nuxt.config.ts

```<code>  modules: ['@nuxtjs/tailwindcss', '@pinia/nuxt', '@nuxtjs/i18n', 'nuxt-proxy'],
  proxy: {
    options: [
      {
        target: 'http://localhost:3003',
        changeOrigin: true,
        pathRewrite: {
          '^/api/todos': '/todoz'
        },
        pathFilter: [
          '/api/todos',
        ],
      }],
  },
</code>```

And then try to trigger this with

```<code>await useFetch<unknown>('http://localhost:3001/api/todos');
</code>```

Checking my network tab to see if the the url appends /todoz at the end of the request url.

Nothing is happening, I cannot seem to trigger anything. I am completely fobbed.

Any ideas what I can do?

Title: Unable to reverse proxy on Nuxt3

Body:
I am trying to change the base url when my nuxt3 app is deployed.

I am using the package nuxt-proxy on "nuxt": "3.0.0-rc.11",

I then add the following code to my nuxt.config.ts

  modules: ['@nuxtjs/tailwindcss', '@pinia/nuxt', '@nuxtjs/i18n', 'nuxt-proxy'],
  proxy: {
    options: [
      {
        target: 'http://localhost:3003',
        changeOrigin: true,
        pathRewrite: {
          '^/api/todos': '/todoz'
        },
        pathFilter: [
          '/api/todos',
        ],
      }],
  },

And then try to trigger this with

await useFetch<unknown>('http://localhost:3001/api/todos');

Checking my network tab to see if the the url appends /todoz at the end of the request url.

Nothing is happening, I cannot seem to trigger anything. I am completely fobbed.

Any ideas what I can do?


问:
Javascript console warn function not working?
Using the console.log(), error() and warn() a lot but for some reason warn() no longer works. Chrome seems to still work but FireFox and Brave both don't output anything to the console. I use it a lot in the dev tools for testing snippits and it's helpful to call out things while testing where an error is too stong a notice. All the other console functions seem to work it's just warn().

```<code><!doctype html>
<html lang="en-us">
<head>
    <meta charset="utf-8">
    <title>console test</title>
    <meta name="description" content="console test">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

<body>
    <script>
        console.log('ddd');
        console.warn('ddd');
        console.error('ddd');
    </script>
</body>
</html>
</code>```

maybe a setting in the current updates that i'm missing but can't seem to find an answer. Could create my own override but wondering if anyone else has seen why the native function doesn't work. It does return 'undefined' like the other functions when in the dev tools.

Body:
Using the console.log(), error() and warn() a lot but for some reason warn() no longer works. Chrome seems to still work but FireFox and Brave both don't output anything to the console. I use it a lot in the dev tools for testing snippits and it's helpful to call out things while testing where an error is too stong a notice. All the other console functions seem to work it's just warn().

<!doctype html>

    <meta charset="utf-8">
    <title>console test</title>
    <meta name="description" content="console test">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

maybe a setting in the current updates that i'm missing but can't seem to find an answer. Could create my own override but wondering if anyone else has seen why the native function doesn't work. It does return 'undefined' like the other functions when in the dev tools.


问:
JavaFX WebView on openJDK-11 not able to load website with ADFS NTLM auto-login
While trying to run a website with SSO and auto-login feature using ADFS and NTLM on JavaFX WebView I am unable to load it as the application pop-up shows a blank screen.

This happens when I try to run the program on openJDK-11. When I run the same program with Oracle's Java8 it works just fine, and I want it to work the same way with openJDK.

What I noticed while trying to debug using com.mohamnag.javafx-webview-debugger v0.0.2 is that when I ran the application with openJDK-11, the network calls stopped after a GET request was made to NTLM using client id, session id and time as payload. It returns with 401 Unauthorized and the network calls stop there. When I run the same app with Oracle Java8, the same NTLM call mentioned above is made and it returns with the same 401 Unauthorized message. But, right after that other network calls are made which loads the webpage successfully.

I tried openJDK-11 with openJFX v19 with runtime build 11 and v13.0.2 with runtime build 1, but the issue is reproduced in both the cases. Java8, v1.8.0_181, has its own javafx so it must be using that.

Please help me find what is different in Java8 that is making it work and how can I replicate the same for openJDK-11.


问:
Support a custom instruction in RISC-V simulator
I've developed a RISC-V  CPU simulator that only supports the base instruction set("I" extension). Now for a test, I need to make my simulator support a custom instruction. I'm wondering if there is a way to do it except to add the custom instruction to the RISC-V GNU-GCC toolchain. Because I only need this instruction once for a test and I won't need it anymore. Any suggestion?</p>


问:
Associating countries to a grid cell in python
I am trying to solve an issue, i want to associate countries to each grid cell so if i call out a country by name or code, it plots the particular country for me, I have seen a similar thing done in R but since i have no knowledge in R, i want to know if anyone have tried something like that in python. I have seen a similar thing done with R and would like to know if anyone has tried something like this with python.
https://gis.stackexchange.com/questions/228706/associating-country-to-grid-cell-in-r


问:
SSH to Docker Container from remote (AWS EC2 host)
I'm trying to SSH to Docker container remotely.
enter image description here
I tried to map -p x:22 with x increase auto when user create a new container.
Then user can SSH into that container.
I follow this one: https://gist.github.com/destan/b708d11bd4f403506d6d5bb5fe6a82c5 to create keypair in host and add it to container.
My code in java:

privateKeyContent = privateKeyContent.replaceAll("\\n", "").replace("-----BEGIN PRIVATE KEY-----", "").replace("-----END PRIVATE KEY-----", "");
KeyFactory kf = KeyFactory.getInstance("RSA");
PKCS8EncodedKeySpec keySpecPKCS8 = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(privateKeyContent));
PrivateKey privKey = kf.generatePrivate(keySpecPKCS8);
PEMWriter writer = new PEMWriter(new FileWriter(new File(pathKey+"key.pem")));
PKCS8Generator encryptorBuilder = new PKCS8Generator(privKey);
PemObject obj = encryptorBuilder.generate();
writer.writeObject(obj);
writer.flush();
writer.close();

System.out.println(privKey);
```
<p>And when user create a key, they can download private with this code</p>
<pre class="lang-java prettyprint-override"><code>ServletContext context = getServletContext();
String fullPath = context.getRealPath("/key.pem");

Path path = Paths.get(fullPath);
byte[] data = Files.readAllBytes(path);
response.setContentType("application/x-pem-file");
response.setHeader("Content-disposition", "attachment; filename=key.pem");
response.setContentLength(data.length);
InputStream inputStream = new BufferedInputStream(new ByteArrayInputStream(data));
OutputStream outStream = response.getOutputStream();
byte[] buffer = new byte[4096];
int bytesRead = -1;
while ((bytesRead = inputStream.read(buffer)) != -1) {
    outStream.write(buffer, 0, bytesRead);
}
inputStream.close();
outStream.close();
</code>```

But when i compare public and private key, they don't match
enter image description here
Anyone can help me fix this please :(
Thank you very much

Body:
I'm trying to SSH to Docker container remotely.
enter image description here
I tried to map -p x:22 with x increase auto when user create a new container.
Then user can SSH into that container.
I follow this one: https://gist.github.com/destan/b708d11bd4f403506d6d5bb5fe6a82c5 to create keypair in host and add it to container.
My code in java:

privateKeyContent = privateKeyContent.replaceAll("\\n", "").replace("-----BEGIN PRIVATE KEY-----", "").replace("-----END PRIVATE KEY-----", "");
KeyFactory kf = KeyFactory.getInstance("RSA");
PKCS8EncodedKeySpec keySpecPKCS8 = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(privateKeyContent));
PrivateKey privKey = kf.generatePrivate(keySpecPKCS8);
PEMWriter writer = new PEMWriter(new FileWriter(new File(pathKey+"key.pem")));
PKCS8Generator encryptorBuilder = new PKCS8Generator(privKey);
PemObject obj = encryptorBuilder.generate();
writer.writeObject(obj);
writer.flush();
writer.close();

System.out.println(privKey);

And when user create a key, they can download private with this code

ServletContext context = getServletContext();
String fullPath = context.getRealPath("/key.pem");

Path path = Paths.get(fullPath);
byte[] data = Files.readAllBytes(path);
response.setContentType("application/x-pem-file");
response.setHeader("Content-disposition", "attachment; filename=key.pem");
response.setContentLength(data.length);
InputStream inputStream = new BufferedInputStream(new ByteArrayInputStream(data));
OutputStream outStream = response.getOutputStream();
byte[] buffer = new byte[4096];
int bytesRead = -1;
while ((bytesRead = inputStream.read(buffer)) != -1) {
    outStream.write(buffer, 0, bytesRead);
}
inputStream.close();
outStream.close();

But when i compare public and private key, they don't match
enter image description here
Anyone can help me fix this please :(
Thank you very much


问:
AirWatch Workspace ONE Disable Heads-Up Notifcation Per App (Android)
How can I disable heads-up (Pop on screen) notifications per app or globally using AirWatch to push custom XML to managed Android devices?

Here are the logs off the phone when toggling heads-up notifications for a single app:

Enabling "Pop on screen" (heads up):

```<code>sysui_multi_action: [757,856,758,6,759,1,806,com.cisco.webapi,857,slnk_webapi_service_channel_1663791852359,858,4]
sysui_multi_action: [757,853,758,4,854,notification.ChannelNotificationSettings/high_importance,1089,1]
commit_sys_config_file: [notification-policy,22]
</code>```

Disabling "Pop on screen" (heads up):

```<code>sysui_multi_action: [757,856,758,6,759,1,806,com.cisco.webapi,857,slnk_webapi_service_channel_1663791852359,858,3]
sysui_multi_action: [757,853,758,4,854,notification.ChannelNotificationSettings/high_importance,1089,0]
commit_sys_config_file: [notification-policy,33]
</code>```

Other logs before toggling:

```<code>com.android.settings.applications.appinfo.AppNotificationPreferenceController
com.android.settings.notification.AppNotificationSettings
sysui_multi_action: [324,1,757,1090,758,12,806,com.android.settings,871,com.android.settings.SubSettings,1091,254]
sysui_multi_action: [319,514,322,511,325,440,757,761,758,8,759,2,806,com.android.settings,871,com.android.settings.SubSettings,904,com.android.settings,905,0,1320,9,1321,5]
com.android.settings.notification.ChannelNotificationSettings
sysui_multi_action: [324,1,757,1090,758,12,806,com.android.settings,871,com.android.settings.SubSettings,1091,201]
</code>```

With root access I know it's possible with adb tool using this:

```<code>adb shell settings put global heads_up_notifications_enabled 1
</code>```

This isn't feasible for our environment due to security restrictions and number of devices managed.

Not sure where to start with this but looking at Android's source code it appears these are the global flags for these type of notifications:

```<code>@UnsupportedAppUsage
public static final String HEADS_UP_NOTIFICATIONS_ENABLED = "heads_up_notifications_enabled";

/** @hide */
@UnsupportedAppUsage
public static final int HEADS_UP_OFF = 0;
/** @hide */
@UnsupportedAppUsage
public static final int HEADS_UP_ON = 1;

</code>```

Ideally, I'd like to disable these per app but I'd be okay with disabling globally too. If anyone has samples of custom attribute XML or anything else that modify notifications per app through AirWatch, please share your examples.

Body:
How can I disable heads-up (Pop on screen) notifications per app or globally using AirWatch to push custom XML to managed Android devices?

Here are the logs off the phone when toggling heads-up notifications for a single app:

Enabling "Pop on screen" (heads up):

sysui_multi_action: [757,856,758,6,759,1,806,com.cisco.webapi,857,slnk_webapi_service_channel_1663791852359,858,4]
sysui_multi_action: [757,853,758,4,854,notification.ChannelNotificationSettings/high_importance,1089,1]
commit_sys_config_file: [notification-policy,22]

Disabling "Pop on screen" (heads up):

sysui_multi_action: [757,856,758,6,759,1,806,com.cisco.webapi,857,slnk_webapi_service_channel_1663791852359,858,3]
sysui_multi_action: [757,853,758,4,854,notification.ChannelNotificationSettings/high_importance,1089,0]
commit_sys_config_file: [notification-policy,33]

Other logs before toggling:

com.android.settings.applications.appinfo.AppNotificationPreferenceController
com.android.settings.notification.AppNotificationSettings
sysui_multi_action: [324,1,757,1090,758,12,806,com.android.settings,871,com.android.settings.SubSettings,1091,254]
sysui_multi_action: [319,514,322,511,325,440,757,761,758,8,759,2,806,com.android.settings,871,com.android.settings.SubSettings,904,com.android.settings,905,0,1320,9,1321,5]
com.android.settings.notification.ChannelNotificationSettings
sysui_multi_action: [324,1,757,1090,758,12,806,com.android.settings,871,com.android.settings.SubSettings,1091,201]

With root access I know it's possible with adb tool using this:

adb shell settings put global heads_up_notifications_enabled 1

This isn't feasible for our environment due to security restrictions and number of devices managed.

Not sure where to start with this but looking at Android's source code it appears these are the global flags for these type of notifications:

@UnsupportedAppUsage
public static final String HEADS_UP_NOTIFICATIONS_ENABLED = "heads_up_notifications_enabled";

/** @hide */
@UnsupportedAppUsage
public static final int HEADS_UP_OFF = 0;
/** @hide */
@UnsupportedAppUsage
public static final int HEADS_UP_ON = 1;

Ideally, I'd like to disable these per app but I'd be okay with disabling globally too. If anyone has samples of custom attribute XML or anything else that modify notifications per app through AirWatch, please share your examples.


问:
Count users who moved by identifying areas users moved to
```<code>user <- c("a", "a", "a", "b", "b", "b", "c", "c", "c", "d", "d", "d", "a", "b", "c", "d")
time <- seq.POSIXt(as.POSIXct("12/01/22 21:05", format="%m/%d/%y %H:%M", tz="America/Chicago"), by="5 min", length.out=16)
area <- c(1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 3)
df<-data.frame(user, time, area)
</code>```

1st: Count users who were not in area 2 then went to area 2. User a is an example.
2nd: Count users who were in area 2 then left area 2. User c is an example.
3rd: Count users who were not in area 2 then moved to area 2, then returned to their original area. User b is an example.
4th: Count users who were not in area 2 then moved to area 2, then didn't return to their original area. User d is an example.

This line will create a column counting number of times a user moved.

```<code>df$times_moved <- ave(df$area,df$user,FUN=function(x){length(rle(x)$lengths)-1})
</code>```

Body:
user <- c("a", "a", "a", "b", "b", "b", "c", "c", "c", "d", "d", "d", "a", "b", "c", "d")
time <- seq.POSIXt(as.POSIXct("12/01/22 21:05", format="%m/%d/%y %H:%M", tz="America/Chicago"), by="5 min", length.out=16)
area <- c(1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 3)
df<-data.frame(user, time, area)

1st: Count users who were not in area 2 then went to area 2. User a is an example.
2nd: Count users who were in area 2 then left area 2. User c is an example.
3rd: Count users who were not in area 2 then moved to area 2, then returned to their original area. User b is an example.
4th: Count users who were not in area 2 then moved to area 2, then didn't return to their original area. User d is an example.

This line will create a column counting number of times a user moved.

df$times_moved <- ave(df$area,df$user,FUN=function(x){length(rle(x)$lengths)-1})


问:
UI5 CheckBox Issue in sap.m.Table
I have an sap.m.Table populated with a number of items. One of the columns in the table contains a checkbox allowing the user to select / deselect it for a particular item.

I have an issue where the table scrolls automatically in the following case:

I change focus to another application on my computer. The specific application makes no difference.

I return to the UI5 application containing the table but I do NOT click anywhere in the application.

I scroll down the list using my mouse scroll wheel. I still have not clicked in the UI5 app in any way including the table's scroll bars so focus is still not in the UI5 app.

I select / deselect the check box for any random item in the list that within view which obviously places focus back to the UI5 app.

The list then scrolls on it's own as if it returns to the position in the list prior to the scroll being performed in step #3 above and selects / deselects a checkbox for a completely different item. It as if the list is retaining it's visible position on the screen and returns to that position to make it visible again on the screen.

If anyone can shed some light on this, requires further clarifying details and/or can suggest a work-a-round that would be great.

Thank you

*** UPDATE ***
December 16, 2022:
Here is an example in CodePen. I additionally noticed that it only happens if I first select a check box for an item, change focus to another application, then return to the UI5 app as per step #2 above.

*** UPDATE #2 ***
Thank you @Marc who identified work-a-rounds as per his comment below.

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

Title: UI5 CheckBox Issue in sap.m.Table

Body:
I have an sap.m.Table populated with a number of items. One of the columns in the table contains a checkbox allowing the user to select / deselect it for a particular item.

I have an issue where the table scrolls automatically in the following case:

I change focus to another application on my computer. The specific application makes no difference.

I return to the UI5 application containing the table but I do NOT click anywhere in the application.

I scroll down the list using my mouse scroll wheel. I still have not clicked in the UI5 app in any way including the table's scroll bars so focus is still not in the UI5 app.

I select / deselect the check box for any random item in the list that within view which obviously places focus back to the UI5 app.

The list then scrolls on it's own as if it returns to the position in the list prior to the scroll being performed in step #3 above and selects / deselects a checkbox for a completely different item. It as if the list is retaining it's visible position on the screen and returns to that position to make it visible again on the screen.

If anyone can shed some light on this, requires further clarifying details and/or can suggest a work-a-round that would be great.

Thank you

*** UPDATE ***
December 16, 2022:
Here is an example in CodePen. I additionally noticed that it only happens if I first select a check box for an item, change focus to another application, then return to the UI5 app as per step #2 above.

*** UPDATE #2 ***
Thank you @Marc who identified work-a-rounds as per his comment below.

 z


问:
VBA: Excel Crashes on last Macro (when sheet is deleted)
I wrote several macros for workbook and I have noticed that all the macros run but then at the last action, Excel crashes.

After much troubleshooting, I found the trigger: "Activesheet.move" or "Activesheet.delete." It seems whenever a sheet is deleted from a workbook (or moved to a new workbook), Excel crashes.

Below is the final macro which triggers Excel to crash. The workbook (Template.xlsm) has 3 other sheets so deleting one should not prompt it to close. Essentially, I press the "FinishButton" which is assigned the SaveTemplate() macro. The Macro makes sure there is data in D8 before continuing. It then deletes the "FinishButton" before deleting the activesheet.

Can someone please advise what I am doing wrong or what is causing the crash?

```<code>Sub SaveTemplate()

Dim dtToday As String
Dim workdoc As String
dtToday = Format(Date, "mm_dd_yyyy")
workdoc = "Working_Doc_" & dtToday
Workbooks("Template.xlsm").Activate

If Sheets(workdoc).Range("D8").Value = "" Then Exit Sub

Sheets(workdoc).Unprotect Password:="password"
Sheets(workdoc).Shapes.Range(Array("FinishButton")).Select
Selection.Delete
Sheets(workdoc).Protect Password:="password"

Application.DisplayAlerts = False
Sheets(workdoc).Delete
Application.DisplayAlerts = True
Workbooks("Template.xlsm").Save
End Sub
</code>```

Thank you

Body:
I wrote several macros for workbook and I have noticed that all the macros run but then at the last action, Excel crashes.

After much troubleshooting, I found the trigger: "Activesheet.move" or "Activesheet.delete." It seems whenever a sheet is deleted from a workbook (or moved to a new workbook), Excel crashes.

Below is the final macro which triggers Excel to crash. The workbook (Template.xlsm) has 3 other sheets so deleting one should not prompt it to close. Essentially, I press the "FinishButton" which is assigned the SaveTemplate() macro. The Macro makes sure there is data in D8 before continuing. It then deletes the "FinishButton" before deleting the activesheet.

Can someone please advise what I am doing wrong or what is causing the crash?

Sub SaveTemplate()

Dim dtToday As String
Dim workdoc As String
dtToday = Format(Date, "mm_dd_yyyy")
workdoc = "Working_Doc_" & dtToday
Workbooks("Template.xlsm").Activate

If Sheets(workdoc).Range("D8").Value = "" Then Exit Sub

Sheets(workdoc).Unprotect Password:="password"
Sheets(workdoc).Shapes.Range(Array("FinishButton")).Select
Selection.Delete
Sheets(workdoc).Protect Password:="password"

Application.DisplayAlerts = False
Sheets(workdoc).Delete
Application.DisplayAlerts = True
Workbooks("Template.xlsm").Save
End Sub

Thank you


问:
Compare arrays and divide it based on duplicate from specific array key
I try to compare arrays and divide it for three different arrays based on subarray with key "ProductID"

Input data look like:
Cat Array:

```<code>Array
(
    [0] => Array
        (
            [catID] => Array
                (
                    [0] => 65
                    [1] =>66
                )

            [discount] => 10
            [productID] => Array
                (
                    [0] => 10887
                    [1] => 8508
                    [2] => 8056
                )

            [startDate] => 05/12/2022 12:00 am
            [endDate] => 10/12/2022 12:00 am
        )

)
</code>```

Tax Array:

```<code>Array
(
    [0] => Array
        (
            [taxID] => 2436
            [discount] => 5
            [productID] => Array
                (
                    [0] => 8018
                    [1] => 8009
                )
        )
    [1] => Array
        (
            [taxID] => 2438
            [discount] => 10
            [productID] => Array
                (
                    [0] => 13184
                    [1] => 8009
                )
        )
)
</code>```

When in tax array does not exists any productID from Cat Array, output for this array should look like:

```<code>$taxNoDuplicates = [
    'discount'   => '',
    'productIds' => []
];
</code>```

When in Cat Array does not exists any productID from Tax Array, output for this array should look like:

```<code>$catNoDuplicates  = [
    'discount'   => '',
    'startDate'  => '',
    'endDate'    => '',
    'productIds' => []
];
</code>```

And if duplicates exsits in Cat Array and Tax Array output for this array should look like: :

```<code>$taxAndCatCombine = [
    'discountTax' => '',
    'discountCat' => '',
    'startDate'   => '',
    'endDate'     => '',
    'productIds'  => []
];
</code>```

Is it possible to create output arrays the way I provided?

Body:
I try to compare arrays and divide it for three different arrays based on subarray with key "ProductID"

Input data look like:
Cat Array:

Array
(
    [0] => Array
        (
            [catID] => Array
                (
                    [0] => 65
                    [1] =>66
                )

            [discount] => 10
            [productID] => Array
                (
                    [0] => 10887
                    [1] => 8508
                    [2] => 8056
                )

            [startDate] => 05/12/2022 12:00 am
            [endDate] => 10/12/2022 12:00 am
        )

)

Tax Array:

Array
(
    [0] => Array
        (
            [taxID] => 2436
            [discount] => 5
            [productID] => Array
                (
                    [0] => 8018
                    [1] => 8009
                )
        )
    [1] => Array
        (
            [taxID] => 2438
            [discount] => 10
            [productID] => Array
                (
                    [0] => 13184
                    [1] => 8009
                )
        )
)

When in tax array does not exists any productID from Cat Array, output for this array should look like:

$taxNoDuplicates = [
    'discount'   => '',
    'productIds' => []
];

When in Cat Array does not exists any productID from Tax Array, output for this array should look like:

$catNoDuplicates  = [
    'discount'   => '',
    'startDate'  => '',
    'endDate'    => '',
    'productIds' => []
];

And if duplicates exsits in Cat Array and Tax Array output for this array should look like: :

$taxAndCatCombine = [
    'discountTax' => '',
    'discountCat' => '',
    'startDate'   => '',
    'endDate'     => '',
    'productIds'  => []
];

Is it possible to create output arrays the way I provided?


问:
Could not open the space navigator device. Did you remember to run spacenavd (as root)?
I am running the demo  MoveIt Servoing,I am using the following commands

```<code>1. roslaunch ur_gazebo ur5.launch
2. roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true
3. roslaunch ur5_moveit_config moveit_rviz.launch config:=true
</code>```

After running the following command

```<code>4. roslaunch moveit_servo spacenav_cpp.launch
</code>```

I am getting the following error Could not open the space navigator device. Did you remember to run spacenavd (as root)? I tried resolving the issue using the [website Link Solution], however I am getting the following error

```<code>root@abc-ThinkPad-P17-Gen-2i:/home/abc/ws_moveit# rosrun spacenav spacenavd

Command 'rosrun' not found, but can be installed with:

apt install rosbash

root@abc-ThinkPad-P17-Gen-2i:/home/abc/ws_moveit# sudo apt install rosbash
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 rosbash : Depends: catkin but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@abc-ThinkPad-P17-Gen-2i:/home/abc/ws_moveit#
</code>```

I am using Ubuntu 20.04 and ROS Noetic

Body:
I am running the demo  MoveIt Servoing,I am using the following commands

1. roslaunch ur_gazebo ur5.launch
2. roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true
3. roslaunch ur5_moveit_config moveit_rviz.launch config:=true

After running the following command

4. roslaunch moveit_servo spacenav_cpp.launch

I am getting the following error Could not open the space navigator device. Did you remember to run spacenavd (as root)? I tried resolving the issue using the [website Link Solution], however I am getting the following error

root@abc-ThinkPad-P17-Gen-2i:/home/abc/ws_moveit# rosrun spacenav spacenavd

Command 'rosrun' not found, but can be installed with:

apt install rosbash

root@abc-ThinkPad-P17-Gen-2i:/home/abc/ws_moveit# sudo apt install rosbash
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 rosbash : Depends: catkin but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@abc-ThinkPad-P17-Gen-2i:/home/abc/ws_moveit#

I am using Ubuntu 20.04 and ROS Noetic


问:
Cannot get correct tag using docker/metadata-action
I have a github workflow to build a docker image. The workflow runs after another one that runs semantic release on the repository, so that the code version is updated and a new tag is created.

What I want to achieve is to build the docker image and push it to the registry both with the main tag and with the updated version tag (i.e., an image tag equal to the git tag).
I'm using the docker/metadata-action for this. I've read the documentation and other relevant (1, 2), but I can't understand how the tags parameter works.

What I tried is the following:

```<code>
name: Build
on:
  workflow_run:
    workflows: ["Semantic Release"]
    types:
      - completed

env:
  REGISTRY: <azure-registry>
  IMAGE_NAME: ${{ github.repository }}

jobs:

  build-app:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write

    steps:
      - uses: actions/checkout@v3

      - name: Log in to the Container registry
        uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ secrets.REGISTRY_USERNAME }}
          password: ${{ secrets.REGISTRY_PASSWORD }}

      - name: Extract metadata (tags, labels) for Docker
        id: meta
        uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
          # Catching tag is not working
          tags: |
            type=ref,event=branch
            type=semver,pattern={{raw}}
            type=ref,event=tag

      - name: Build and push Docker image
        uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
        with:
          context: .
          push: true
          file: docker/Dockerfile
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
</code>```

The job is correctly running after the commit done by the semantic release action, so that I think that all needed information (branch main and latest version tag) are available for the build job, but the metadata-action doesn't catch the tag at all. The output of the relevant step is the following:

and the only tag that is created for the docker image is main.

Maybe it's a simple issue, but what am I missing?

Body:
I have a github workflow to build a docker image. The workflow runs after another one that runs semantic release on the repository, so that the code version is updated and a new tag is created.

What I want to achieve is to build the docker image and push it to the registry both with the main tag and with the updated version tag (i.e., an image tag equal to the git tag).
I'm using the docker/metadata-action for this. I've read the documentation and other relevant (1, 2), but I can't understand how the tags parameter works.

What I tried is the following:

name: Build
on:
  workflow_run:
    workflows: ["Semantic Release"]
    types:
      - completed

env:
  REGISTRY: <azure-registry>
  IMAGE_NAME: ${{ github.repository }}

jobs:

  build-app:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write

    steps:
      - uses: actions/checkout@v3

      - name: Log in to the Container registry
        uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ secrets.REGISTRY_USERNAME }}
          password: ${{ secrets.REGISTRY_PASSWORD }}

      - name: Extract metadata (tags, labels) for Docker
        id: meta
        uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
          # Catching tag is not working
          tags: |
            type=ref,event=branch
            type=semver,pattern={{raw}}
            type=ref,event=tag

      - name: Build and push Docker image
        uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
        with:
          context: .
          push: true
          file: docker/Dockerfile
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}

The job is correctly running after the commit done by the semantic release action, so that I think that all needed information (branch main and latest version tag) are available for the build job, but the metadata-action doesn't catch the tag at all. The output of the relevant step is the following:

and the only tag that is created for the docker image is main.

Maybe it's a simple issue, but what am I missing?


问:
SwiftUI: How to use Github package?
I am trying to use this package from Github https://github.com/yashthaker7/NumberPicker

I successfully manage to add pod 'NumberPicker' to my podfile, but when I try to implement the code I get a bunch of errors.

How I implement the code is by adding this to the action part of a simple button:

```<code>func openNumberPicker() {
    let numberPicker = NumberPicker(delegate: self, maxNumber: 300) // set max number
    numberPicker.bgGradients = [.red, .yellow]
    numberPicker.tintColor = .white
    numberPicker.heading = "Weight"
    numberPicker.defaultSelectedNumber = 150 // set default selected number

    self.present(numberPicker, animated: true, completion: nil)
}
</code>```

I am using SwiftUI and not Storyboard with which the package is originally written in.

Any ideas on what to do?

Title: SwiftUI: How to use Github package?

Body:
I am trying to use this package from Github https://github.com/yashthaker7/NumberPicker

I successfully manage to add pod 'NumberPicker' to my podfile, but when I try to implement the code I get a bunch of errors.

How I implement the code is by adding this to the action part of a simple button:

func openNumberPicker() {
    let numberPicker = NumberPicker(delegate: self, maxNumber: 300) // set max number
    numberPicker.bgGradients = [.red, .yellow]
    numberPicker.tintColor = .white
    numberPicker.heading = "Weight"
    numberPicker.defaultSelectedNumber = 150 // set default selected number

    self.present(numberPicker, animated: true, completion: nil)
}

I am using SwiftUI and not Storyboard with which the package is originally written in.

Any ideas on what to do?


问:
Overflow hidden causes subgrid to break on mobile
I have an incredibly frustrating issue, regarding CSS grids, the overflow keyword, and mobile development.

I am using Javascript to toggle overflow: hidden on a container element, which happens to have display: grid and grid-template-columns: subgrid.

This works fine on my desktop, but I have tested on my iPhone 12 (iOS 16.1.2), both using Safari and Firefox, and the browser collapses all of the grid columns into one when the container's overflow property is set to hidden.

This was tested using alerts, and displaying the computed grid-template-columns value for the container before and after using Javascript to set container.style.overflow = hidden;, which on desktop displays Columns: 5 before and Columns: 5 after, while on mobile it shows Columns: 5 before and Columns: 1 after.

I have also tested this without using the subgrid keyword, and it works. The columns don't rearrange when using an explicitly defined grid, but this doesn't achieve what I'm looking for.

Does anyone have any experience with subgrids and overflow issues on mobile?


问:
Mui styled component change hover state of two components
I have a checkbox component that also has a label. I'm using styled components to handle the styles when each component is hovered over.

```<code>// Checkbox Styled Component

const StyledCheckbox = styled(MUICheckbox)(({ theme }) => ({
  width: '32px',
  height: '32px',
  color: '#1673A3',
  ':hover': {
    backgroundColor: '#E5F2F7',
    color: '#0E567B',
  },
  borderRadius: '6px',
}));

</code>```
```<code>// Label Styled Component

  const StyledLabel = styled(Text)(({ theme }) => ({
    ':hover': {
      textDecoration: 'underline',
    },
  }));
</code>```
```<code>//Checkbox With Label Component

const checkboxWithLabel = (
    <FormControlLabel
      label={<StyledLabel variant="body-bold">{label}</StyledLabel>}
      labelPlacement={variant === 'boxed' ? 'start' : 'end'}
      onChange={handleChange}
      sx={[variant === 'boxed' && themeCallback]}
      control={
        <StyledCheckbox
          disableRipple
          color="primary"
          icon={(<StyledIcon />) as React.ReactNode}
          checkedIcon={(<StyledCheckedIcon />) as React.ReactNode}
          indeterminateIcon={(<StyledIndeterminateIcon />) as React.ReactNode}
          className={props.className}
          {...props}
        />
      }
    />
  );
</code>```

Is there any way to have both component appear hovered over when either the label ro checkbox are hovered? (e.g hover over label, checkbox also appears to be hovered. hover over checkbox, label also appears to be hovered). i.e.

I have tried using component selectors (emotion/styled/macro) within each of the styled components but that is throwing errors elsewhere

Body:
I have a checkbox component that also has a label. I'm using styled components to handle the styles when each component is hovered over.

// Checkbox Styled Component

const StyledCheckbox = styled(MUICheckbox)(({ theme }) => ({
  width: '32px',
  height: '32px',
  color: '#1673A3',
  ':hover': {
    backgroundColor: '#E5F2F7',
    color: '#0E567B',
  },
  borderRadius: '6px',
}));

// Label Styled Component

  const StyledLabel = styled(Text)(({ theme }) => ({
    ':hover': {
      textDecoration: 'underline',
    },
  }));

//Checkbox With Label Component

const checkboxWithLabel = (
    <FormControlLabel
      label={}
      labelPlacement={variant === 'boxed' ? 'start' : 'end'}
      onChange={handleChange}
      sx={[variant === 'boxed' && themeCallback]}
      control={


问:
Can Google Sheets be set up to propogate templates to existing children based on them?
I'm working for a company who want me to move their shared drive (NAS) to Google Drive get us working collaboratively.

Currently we have a central spreadsheet which has a bunch of information about each aircraft we work on, which mail merges into word docs. When we need to do a specific thing (like weigh the aircraft) we need to generate a document to store with the details on it. We open a template word doc and use the mail merge deature to find the reg of the aircraft and Word's mail merge pulls in the rest of the info into the doc. Great stuff!

We're moving to Google Drive to work more collaboratively. Is there a way of doing this same thing on GDrive? I can see ways of having a google sheet pull info from a master spreadsheet in this way, but not google Docs (which will work better because of the way you can format tables).

My research shows that this is easy with a google sheet but I need to use a google doc really, for the formatting flexibility.


问:
Is there a way to easily switch back and forth between the last two windows in VSCode on MacOS?
I know that I can use Cmd+` to easily switch between windows (even though I don't understand the logic it uses to decide which window to show me next) and that I can bind a keyboard shortcut to the command workbench.action.switchWindow to cycle through my open windows in an orderly fashion, but if I want to just flip back and forth between the last two windows I've viewed, is there a way to do that?  Thanks!


问:
React Native ERROR. Cannot access input property '$1' of task ':app:bundleReleaseJsAndAssets'

npx react-native init g
cd g/android/
./gradlew assembleRelease --warning-mode all
```
</b>
<p>Result is:</p>
```> Task :react-native-gradle-plugin:compileKotlin
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (10, 37): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (119, 30): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (135, 26): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (157, 32): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (163, 31): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (171, 36): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactPlugin.kt: (114, 48): 'reactRoot: DirectoryProperty' is deprecated. reactRoot was confusing and has been replace with root to point to your root project and reactNativeDir to point to the folder of the react-native NPM package
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (10, 37): 'ApplicationVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (11, 37): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (12, 37): 'LibraryVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (27, 51): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (130, 12): 'ApplicationVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (131, 12): 'LibraryVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (251, 14): 'BaseVariant' is deprecated. Deprecated in Java

> Configure project :app
IncrementalTaskInputs has been deprecated. This is scheduled to be removed in Gradle 8.0. On method 'IncrementalTask.taskAction$gradle_core' use 'org.gradle.work.InputChanges' instead. Consult the upgrading guide for further information: https://docs.gradle.org/7.5.1/userguide/upgrading_version_7.html#incremental_task_inputs_deprecation
        at react_5q6md5u2ow299b673ul33sbqr$_run_closure8$_closure11$_closure14.doCall(D:\Dev\DeleteLater\g\node_modules\react-native\react.gradle:395)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)

> Task :app:bundleReleaseJsAndAssets
Cannot access input property '$1' of task ':app:bundleReleaseJsAndAssets' (see --info log for details). Accessing unreadable inputs or outputs has been deprecated. This will fail with an error in Gradle 8.0. Dec
> Task :app:bundleReleaseJsAndAssets FAILED

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'cmd'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 13s
6 actionable tasks: 6 executed

```

I was generating a Release.

Note: This is NOT about Keystore.

Body:
npx react-native init g
cd g/android/
./gradlew assembleRelease --warning-mode all

Result is:

> Task :react-native-gradle-plugin:compileKotlin
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (10, 37): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (119, 30): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (135, 26): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (157, 32): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (163, 31): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (171, 36): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactPlugin.kt: (114, 48): 'reactRoot: DirectoryProperty' is deprecated. reactRoot was confusing and has been replace with root to point to your root project and reactNativeDir to point to the folder of the react-native NPM package
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (10, 37): 'ApplicationVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (11, 37): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (12, 37): 'LibraryVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (27, 51): 'BaseVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (130, 12): 'ApplicationVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (131, 12): 'LibraryVariant' is deprecated. Deprecated in Java
w: D:\Dev\DeleteLater\g\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (251, 14): 'BaseVariant' is deprecated. Deprecated in Java

> Configure project :app
IncrementalTaskInputs has been deprecated. This is scheduled to be removed in Gradle 8.0. On method 'IncrementalTask.taskAction$gradle_core' use 'org.gradle.work.InputChanges' instead. Consult the upgrading guide for further information: https://docs.gradle.org/7.5.1/userguide/upgrading_version_7.html#incremental_task_inputs_deprecation
        at react_5q6md5u2ow299b673ul33sbqr$_run_closure8$_closure11$_closure14.doCall(D:\Dev\DeleteLater\g\node_modules\react-native\react.gradle:395)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)

> Task :app:bundleReleaseJsAndAssets
Cannot access input property '$1' of task ':app:bundleReleaseJsAndAssets' (see --info log for details). Accessing unreadable inputs or outputs has been deprecated. This will fail with an error in Gradle 8.0. Dec
> Task :app:bundleReleaseJsAndAssets FAILED

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'cmd'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 13s
6 actionable tasks: 6 executed

I was generating a Release.

Note: This is NOT about Keystore.


问:
I tried installing brew core utilities and I got this error "Installing... Warning: No available formula with the name "coreutils""
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...

I tried installing core utilities for SHELLS by 4ndr34z


问:
Node: 'Cast_1' Cast string to float is not supported [[{{node Cast_1}}]] [Op:__inference_train_function_24202] for Roberta
I am getting this problem called "

```<code>Node: 'Cast_1'
Cast string to float is not supported
     [[{{node Cast_1}}]] [Op:__inference_train_function_24202]
</code>```

"
enter image description here

```<code>

</code>```

I wrote a code about IMDB sentiment analysis for 5000 data in Google Colab

```<code>#importing the necessary libraries
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.preprocessing.text import Tokenizer

#importing the data
data = pd.read_excel('/content/drive/MyDrive/499A_Project/Dataset/IMDB5000.xlsx')

#spliting the dataset into train and test
train_data, test_data = train_test_split(data, test_size = 0.3, random_state = 42)

#preprocessing the data
#tokenizng the text
tokenizer = Tokenizer()
tokenizer.fit_on_texts(data['Review'].values)

#converting the text into sequences
train_sequences = tokenizer.texts_to_sequences(train_data['Review'].values)
test_sequences = tokenizer.texts_to_sequences(test_data['Review'].values)

#padding the sequences
max_length = max([len(s.split()) for s in data['Review']])
train_padded = pad_sequences(train_sequences, maxlen = max_length)
test_padded = pad_sequences(test_sequences, maxlen = max_length)

#preparing the labels
train_labels = train_data['Sentiment'].values
test_labels = test_data['Sentiment'].values

#importing Roberta model from transformers
from transformers import TFBertForSequenceClassification

#instantiating the Roberta model
model = TFBertForSequenceClassification.from_pretrained('roberta-base')

#compiling the model
model.compile(loss = 'sparse_categorical_crossentropy',
              optimizer = 'adam',
              metrics = ['accuracy'])

#training the model
model.fit(train_padded, train_labels,
          batch_size = 32,
          epochs = 10,
          validation_data = (test_padded, test_labels))

</code>```

This is the code I wrote for my dataset but it is not working and show the erros

Body:
I am getting this problem called "

Node: 'Cast_1'
Cast string to float is not supported
     [[{{node Cast_1}}]] [Op:__inference_train_function_24202]

"
enter image description here

I wrote a code about IMDB sentiment analysis for 5000 data in Google Colab

#importing the necessary libraries
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.preprocessing.text import Tokenizer

#importing the data
data = pd.read_excel('/content/drive/MyDrive/499A_Project/Dataset/IMDB5000.xlsx')

#spliting the dataset into train and test
train_data, test_data = train_test_split(data, test_size = 0.3, random_state = 42)

#preprocessing the data
#tokenizng the text
tokenizer = Tokenizer()
tokenizer.fit_on_texts(data['Review'].values)

#converting the text into sequences
train_sequences = tokenizer.texts_to_sequences(train_data['Review'].values)
test_sequences = tokenizer.texts_to_sequences(test_data['Review'].values)

#padding the sequences
max_length = max([len(s.split()) for s in data['Review']])
train_padded = pad_sequences(train_sequences, maxlen = max_length)
test_padded = pad_sequences(test_sequences, maxlen = max_length)

#preparing the labels
train_labels = train_data['Sentiment'].values
test_labels = test_data['Sentiment'].values

#importing Roberta model from transformers
from transformers import TFBertForSequenceClassification

#instantiating the Roberta model
model = TFBertForSequenceClassification.from_pretrained('roberta-base')

#compiling the model
model.compile(loss = 'sparse_categorical_crossentropy',
              optimizer = 'adam',
              metrics = ['accuracy'])

#training the model
model.fit(train_padded, train_labels,
          batch_size = 32,
          epochs = 10,
          validation_data = (test_padded, test_labels))

This is the code I wrote for my dataset but it is not working and show the erros


问:
How to alter the emitted
  <link rel="stylesheet" href="./assets/index.73758c4d.css">
```
<p>This page is intended to be embedded in a third-party software. Due to the limitation of the software, we need to remove <code>type="module"</code> while adding <code>defer</code> to the <code><script></code> tag. So, the intended output should look like as follows:</p>
<pre class="lang-html prettyprint-override"><code>  <script crossorigin src="./assets/index.3d52369b.js" defer></script>
  <link rel="stylesheet" href="./assets/index.73758c4d.css">
</code>```

The generated app works correctly after we change these two things manually. However, we found no way to instruct the build tools to generate the altered code, except running a string replace hack as a post-build step.

If we add defer attribute in the source

Title: How to alter the emitted <script> tag attributes while building a vue.js v3 app?

Body:
We're building a vue.js v3 application using vite with vitejs/plugin-vue. The following two lines are added to the HTML by the tools:

  <link rel="stylesheet" href="./assets/index.73758c4d.css">

This page is intended to be embedded in a third-party software. Due to the limitation of the software, we need to remove type="module" while adding defer to the
  <link rel="stylesheet" href="./assets/index.73758c4d.css">

The generated app works correctly after we change these two things manually. However, we found no way to instruct the build tools to generate the altered code, except running a string replace hack as a post-build step.

If we add defer attribute in the source


问:
Can't connect to mongoose/mongodb
When I'm trying to add an item to my database I get the following error on the terminal:

```<code>const serverSelectionError = new ServerSelectionError();
                               ^

MongooseServerSelectionError: connect ECONNREFUSED ::1:27017
    at Connection.openUri (C:\Users\88cro\Desktop\blog\node_modules\mongoose\lib\connection.js:825:32)
    at C:\Users\88cro\Desktop\blog\node_modules\mongoose\lib\index.js:417:10
    at C:\Users\88cro\Desktop\blog\node_modules\mongoose\lib\helpers\promiseOrCallback.js:41:5
    at new Promise (<anonymous>)
    at promiseOrCallback (C:\Users\88cro\Desktop\blog\node_modules\mongoose\lib\helpers\promiseOrCallback.js:40:10)
    at Mongoose._promiseOrCallback (C:\Users\88cro\Desktop\blog\node_modules\mongoose\lib\index.js:1270:10)
    at Mongoose.connect (C:\Users\88cro\Desktop\blog\node_modules\mongoose\lib\index.js:416:20)
    at Object.<anonymous> (C:\Users\88cro\Desktop\blog\server.js:6:10)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10) {
  reason: TopologyDescription {
    type: 'Unknown',
    servers: Map(1) {
      'localhost:27017' => ServerDescription {
        address: 'localhost:27017',
        type: 'Unknown',
        hosts: [],
        passives: [],
        arbiters: [],
        tags: {},
        minWireVersion: 0,
        maxWireVersion: 0,
        roundTripTime: -1,
        lastUpdateTime: 162133351,
        lastWriteDate: 0,
        error: MongoNetworkError: connect ECONNREFUSED ::1:27017
            at connectionFailureError (C:\Users\88cro\Desktop\blog\node_modules\mongodb\lib\cmap\connect.js:387:20)
            at Socket.<anonymous> (C:\Users\88cro\Desktop\blog\node_modules\mongodb\lib\cmap\connect.js:310:22)
            at Object.onceWrapper (node:events:628:26)
            at Socket.emit (node:events:513:28)
            at emitErrorNT (node:internal/streams/destroy:151:8)
            at emitErrorCloseNT (node:internal/streams/destroy:116:3)
            at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
          cause: Error: connect ECONNREFUSED ::1:27017
              at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1284:16) {
            errno: -4078,
            code: 'ECONNREFUSED',
            syscall: 'connect',
            address: '::1',
            port: 27017
          },
          [Symbol(errorLabels)]: Set(1) { 'ResetPool' }
        },
        topologyVersion: null,
        setName: null,
        setVersion: null,
        electionId: null,
        logicalSessionTimeoutMinutes: null,
        primary: null,
        me: null,
        '$clusterTime': null
      }
    },
    stale: false,
    compatible: true,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    setName: null,
    maxElectionId: null,
    maxSetVersion: null,
    commonWireVersion: 0,
    logicalSessionTimeoutMinutes: null
  },
  code: undefined
}

Node.js v19.0.1
[nodemon] app crashed - waiting for file changes before starting...

</code>```

I have MongoDB Atlas and mongoshell installed and running but that doesn't seem to fix the problem.
This is how I setup express and mongoose, I tried to change the url in mongoose.connect but it doesn't seem to work

```<code>const express = require('express')
const mongoose = require('mongoose')
const articleRouter = require('./routes/articles')
const app = express()

mongoose.connect('mongodb://localhost/blog', {useNewUrlParser: true})

app.set('view engine', 'ejs')

app.use(express.urlencoded({ extended: false }))

app.get('/', (req, res) => {
    const articles = [{
        title: 'Test title',
        createdAt: new Date(),
        description: 'Test description'
    }]
    res.render('articles/index', { articles: articles })
})

app.use('/articles', articleRouter)

app.listen(5000)
</code>```

Any ideas about how to fix this? Thanks!

Title: Can't connect to mongoose/mongodb

Body:
When I'm trying to add an item to my database I get the following error on the terminal:

const serverSelectionError = new ServerSelectionError();
                               ^

MongooseServerSelectionError: connect ECONNREFUSED ::1:27017
    at Connection.openUri (C:\Users\88cro\Desktop\blog\node_modules\mongoose\lib\connection.js:825:32)
    at C:\Users\88cro\Desktop\blog\node_modules\mongoose\lib\index.js:417:10
    at C:\Users\88cro\Desktop\blog\node_modules\mongoose\lib\helpers\promiseOrCallback.js:41:5
    at new Promise (<anonymous>)
    at promiseOrCallback (C:\Users\88cro\Desktop\blog\node_modules\mongoose\lib\helpers\promiseOrCallback.js:40:10)
    at Mongoose._promiseOrCallback (C:\Users\88cro\Desktop\blog\node_modules\mongoose\lib\index.js:1270:10)
    at Mongoose.connect (C:\Users\88cro\Desktop\blog\node_modules\mongoose\lib\index.js:416:20)
    at Object.<anonymous> (C:\Users\88cro\Desktop\blog\server.js:6:10)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10) {
  reason: TopologyDescription {
    type: 'Unknown',
    servers: Map(1) {
      'localhost:27017' => ServerDescription {
        address: 'localhost:27017',
        type: 'Unknown',
        hosts: [],
        passives: [],
        arbiters: [],
        tags: {},
        minWireVersion: 0,
        maxWireVersion: 0,
        roundTripTime: -1,
        lastUpdateTime: 162133351,
        lastWriteDate: 0,
        error: MongoNetworkError: connect ECONNREFUSED ::1:27017
            at connectionFailureError (C:\Users\88cro\Desktop\blog\node_modules\mongodb\lib\cmap\connect.js:387:20)
            at Socket.<anonymous> (C:\Users\88cro\Desktop\blog\node_modules\mongodb\lib\cmap\connect.js:310:22)
            at Object.onceWrapper (node:events:628:26)
            at Socket.emit (node:events:513:28)
            at emitErrorNT (node:internal/streams/destroy:151:8)
            at emitErrorCloseNT (node:internal/streams/destroy:116:3)
            at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
          cause: Error: connect ECONNREFUSED ::1:27017
              at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1284:16) {
            errno: -4078,
            code: 'ECONNREFUSED',
            syscall: 'connect',
            address: '::1',
            port: 27017
          },
          [Symbol(errorLabels)]: Set(1) { 'ResetPool' }
        },
        topologyVersion: null,
        setName: null,
        setVersion: null,
        electionId: null,
        logicalSessionTimeoutMinutes: null,
        primary: null,
        me: null,
        '$clusterTime': null
      }
    },
    stale: false,
    compatible: true,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    setName: null,
    maxElectionId: null,
    maxSetVersion: null,
    commonWireVersion: 0,
    logicalSessionTimeoutMinutes: null
  },
  code: undefined
}

Node.js v19.0.1
[nodemon] app crashed - waiting for file changes before starting...

I have MongoDB Atlas and mongoshell installed and running but that doesn't seem to fix the problem.
This is how I setup express and mongoose, I tried to change the url in mongoose.connect but it doesn't seem to work

const express = require('express')
const mongoose = require('mongoose')
const articleRouter = require('./routes/articles')
const app = express()

mongoose.connect('mongodb://localhost/blog', {useNewUrlParser: true})

app.set('view engine', 'ejs')

app.use(express.urlencoded({ extended: false }))

app.get('/', (req, res) => {
    const articles = [{
        title: 'Test title',
        createdAt: new Date(),
        description: 'Test description'
    }]
    res.render('articles/index', { articles: articles })
})

app.use('/articles', articleRouter)

app.listen(5000)

Any ideas about how to fix this? Thanks!


问:
Copy the foreign key data of one table to another in Livewire
Hi I am new to Laravel and Livewire. I have a shop table, shopping cart table and a product table. I am trying to insert the "shop_id" into the shopping cart table which is a foreign key of product table. Is there anyway I can do this?

I tried something like this in my Shopping Cart Component but I have no idea how to insert the shop_id

```<code>public function addToCart($productId){
        Cart::create([
            'user_id' => auth()->user()->id,
            'product_id' => $productId,
          //'shop_id' =>
            'quantity' => $this->quantityCount,

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

I tried something like this in my blade file

```<code>@foreach($shop->products as $product)
<button type="button" wire:click="addToCart({{$product->id}})">Add</button>
@endforeach
</code>```

Body:
Hi I am new to Laravel and Livewire. I have a shop table, shopping cart table and a product table. I am trying to insert the "shop_id" into the shopping cart table which is a foreign key of product table. Is there anyway I can do this?

I tried something like this in my Shopping Cart Component but I have no idea how to insert the shop_id

public function addToCart($productId){
        Cart::create([
            'user_id' => auth()->user()->id,
            'product_id' => $productId,
          //'shop_id' =>
            'quantity' => $this->quantityCount,

        ]);
        }
    }

I tried something like this in my blade file

@foreach($shop->products as $product)
<button type="button" wire:click="addToCart({{$product->id}})">Add</button>
@endforeach


问:
Aggregating daily to weekly data with categorical variables
my question doesn't regard any particular software, it's more of a broad question that could concern every type of data mining problem.

I have a data set with daily data and a bunch of attributes, like the above. 'Sales' is numeric and represents the revenue of sales on a given day. 'Open' is categorical and retrieves if a store is open (=1) or closed (=0). And 'Promo' is categorical, stating if a type of promo is happening at the given day (it takes the values a, b and c).

day
sales
open
promo

06/12/2022
15
1
a

05/12/2022
0
0
a

04/12/2022
12
1
b

Now, my goal is to develop a model that predicts weekly sales. In order to do this, I will need to aggregate daily data into weekly data.

For the variable sales this is quite straight forward because the value of weekly sales is the sum of daily sales within a certain week.

My question regards the categorical variables (open and promo), what kind of aggregation function should I use? I have tried to convert the variables to numerical and use the weekly mean as an aggregation method for this attributes, but i don't know if this is a common approach.

I would like to know if anyone knows what is the best/usual way to tackle this?

Thanks, anyway!


问:
How do I enable UILargeContentViewerInteraction on a UITabBar outside of a UITabBarController?
iOS 13 added the UILargeContentViewerInteraction class for showing a large title and icon when the user long-presses on a tab bar or similar UI that might be custom. It works out of the box with the tab bar in a UITabBarController, and it can be set up easily on custom views by setting the UILargeContentViewerItem-related properties on UIView.

My question is this: how do I enable it on a UITabBar in my app that's not connected to a UITabBarController? There don't appear to be any relevant properties on UITabBarItem.


问:
How to import Data from Microsoft Excel to Microsoft Dynamics GP?
Long story short I have a very long boring repetitive task at work.

I have norrowed it down to 9 clicks but how no idea how loop the macro and get it to select the sections in the spread sheet with the customers numbers that go into Microsoft Dynamics GP 13.
Normally I wouldn't bother but I learned a new way to do the long cancellation part and data entry in 5 mins per sales account.

I now have 23 rows + to do a necessary and repetitive action.

I've worked out that the best way until we go until Dynamics 365 in January/ Feb/ March would be to be able to do them in one go everyday enmasse.

Any advice on VBA and either Excel or Access would be appreciated.

Thank you :D

Currently I tried to make a macro in Dynamics, but it repeated a row in Excel that I had already done in GP. So I really need help.