问:
iOS - How to remove implicit imports?
In my team, we develop several frameworks and in one of the apps integrating said frameworks, they want to enforce the imports of FooBar framework to a specific folder and throw a compile time warning if someone tries to import FooBar outside that folder.

I created a swiftlint rule to detect imports of FooBar outside the folder and it turns out that it also detects some implicit imports that should not be there and throws a warning from my lint rule. Even if the file doesn't explictly import FooBar, it seems to have access to it.

Note: FooBar is an static framework that has both ObjC and swift support and the app project also uses both ObjC and swift to access the framework's functionality.

How can I get rid of implicit imports in an iOS project?

Here's the rule I created

```<code>oneplayer_import:
    exclude: "somepath"
    regex: "^#?import .*FooBar.*$"
    message: "FooBar frameworks should not be imported outside somepath"
    severity: warning
</code>```

Title: iOS - How to remove implicit imports?

Body:
In my team, we develop several frameworks and in one of the apps integrating said frameworks, they want to enforce the imports of FooBar framework to a specific folder and throw a compile time warning if someone tries to import FooBar outside that folder.

I created a swiftlint rule to detect imports of FooBar outside the folder and it turns out that it also detects some implicit imports that should not be there and throws a warning from my lint rule. Even if the file doesn't explictly import FooBar, it seems to have access to it.

Note: FooBar is an static framework that has both ObjC and swift support and the app project also uses both ObjC and swift to access the framework's functionality.

How can I get rid of implicit imports in an iOS project?

Here's the rule I created

oneplayer_import:
    exclude: "somepath"
    regex: "^#?import .*FooBar.*$"
    message: "FooBar frameworks should not be imported outside somepath"
    severity: warning


来源: stackexchange

问:
Replacing Rabbit when using expo-crypto in react native
In our react-native app we were doing this to encrypt:

```<code>  return CryptoJS.Rabbit.encrypt(hexString, hash).toString();
</code>```

But now with the expo-crypto package, this is handled differently:

```<code>import * as CryptoJS from 'expo-crypto';
</code>```

That being the case, what should the new syntax be for encrypting, instead of this?

```<code> return CryptoJS.Rabbit.encrypt(hexString, hash).toString();
</code>```

I don't see this mentioned in the expo-crypto documentation.

ContentLicense: CC BY-SA 4.0

Body:
In our react-native app we were doing this to encrypt:

  return CryptoJS.Rabbit.encrypt(hexString, hash).toString();

But now with the expo-crypto package, this is handled differently:

import * as CryptoJS from 'expo-crypto';

That being the case, what should the new syntax be for encrypting, instead of this?

 return CryptoJS.Rabbit.encrypt(hexString, hash).toString();

I don't see this mentioned in the expo-crypto documentation.


问:
Different measure in a drill up scenario - Power BI
This case is data sensitive, so i've created a example.
The goal is to agreggate two assets and change how the measure behaves when i do so.

Data: (1)

Measure:

Measure =

Var Datafim = MAX('NAVPS'[date])

Var DataInicio = MIN(NAVPS[date])

Return

CALCULATE(PRODUCTX('NAVPS','NAVPS'[profitability + 1]),FILTER('NAVPS','NAVPS'[date] >= DataInicio && 'NAVPS'[date] <= Datafim))) - 1

The result it shows: (2)

The result i want after drilling up: (3)

When i drill up the Product function just multiples all [profitability + 1] values from Asset A and Asset B, but the correct way would be (1+[Asset A Measure])*(1+[Asset B Measure]).

Asset A and B are the only ones that i want to see aggregated, the other ones just are repeated on the [Classf] column.

The tricky part here is that both assets A and B can come with different names, so i can't put a IF scenario that states [Asset] = Asset A or [Asset] = Asset B.

Do you guys see another way of showing this result ?
It doesnt need to be just like the image (3), as long as it shows what i want.

Best regards!


问:
Move rows in gridview and automatically update column
I have a gridview that functions as a visual for a schedule. It is sorted by an "order" column in ascending order.
Ex. The very top of the gridview has the number '1' in the order column and the very bottom would have the number '100'.

Is it possible to have it where I can move a row down the gridview by clicking and moving with my mouse and then have order column update automatically?
Ex. If I click and move row '5' below row '20', then the '5' in the order column would automatically update to 20.1 (As to not move every other row behind row 20 up one number every time a row is moved down the schedule).


问:
Create multiple rects for one data row using join
I have the following data structure:

```<code>{
{date: <dd-mm-yyyy>,
uname: frank,
x: 3,
nr: 45},{
date: <dd-mm-yyyy>,
uname: john,
x: 4,
nr: 40},
...
}
</code>```

I'd like to create a rect for every integer that constitutes nr. So in Frank's case: 45 rects. In John's case 40.

Currently I am creating a rect for every row as such:

```<code>        var blocks = contentGroup
                .selectAll("rect")
                .data(data)
                .join("rect")
                .attr("x", d => d.x)
                .attr("y", function(d) { return y(d.uname)})
          .attr("width", 5)
          .attr("height", 5)
                .attr("fill", d => z(d.date))

</code>```

I noticed that d3 associates one DOM element with one datum. I thought about creating a new dataset with 45 entries for Frank and 40 entries for John, but that seems off. Equally, I thought about brute forcing the rect generation, simply by iterating through the nr (45/40 times respectively), but my fear here is I lose power of join and enter.

Any other suggestions on how to create <nr> of rects with this setup?

Body:
I have the following data structure:

{
{date:
,
uname: frank,
x: 3,
nr: 45},{
date:
,
uname: john,
x: 4,
nr: 40},
...
}

I'd like to create a rect for every integer that constitutes nr. So in Frank's case: 45 rects. In John's case 40.

Currently I am creating a rect for every row as such:

        var blocks = contentGroup
                .selectAll("rect")
                .data(data)
                .join("rect")
                .attr("x", d => d.x)
                .attr("y", function(d) { return y(d.uname)})
          .attr("width", 5)
          .attr("height", 5)
                .attr("fill", d => z(d.date))

I noticed that d3 associates one DOM element with one datum. I thought about creating a new dataset with 45 entries for Frank and 40 entries for John, but that seems off. Equally, I thought about brute forcing the rect generation, simply by iterating through the nr (45/40 times respectively), but my fear here is I lose power of join and enter.

Any other suggestions on how to create <nr> of rects with this setup?


问:
How to make chrome.scripting.executeScript run same file again?
I am using executeScript to open a html file (sidebar) when clicking on my extension icon. This is the code:

```<code>import toggleExtension from './toggleExtension.ts?script'

chrome.action.onClicked.addListener(() => {
  chrome.tabs.query({ active: true, windowId: chrome.windows.WINDOW_ID_CURRENT }, tabs => {
      chrome.scripting.executeScript({
        target: {
          tabId: tabs[0].id as number,
        },
        files: [toggleExtension],
      })
  })
})
</code>```

I can make it work with the func parameter, but I would like to reuse the same code for other html files. However this only executes the file on the first run, and subsequent clicks run executeScript successfully but the file is not run again.

toggleExtension file:

```<code>const createIframe = (pageUrl: string, id: string) => {
  const iframeEl = document.createElement('iframe')
  iframeEl.id = id
  iframeEl.setAttribute(
    'style',
    `
      z-index: 9999999999;
      position: fixed;
      height: 100%;
      width: 100%;
      top: 0px;
      right: 0px;
      bottom: 0px;
      left: 0px;
      border: 0;
    `
  )
  iframeEl.src = chrome.runtime.getURL(pageUrl)
  iframeEl.allow = 'clipboard-write'
  return iframeEl
}

const togglePanel = (mountId: string, htmlPath: string) => {
  const dialog = document.getElementById(mountId)
  if (dialog) {
    dialog.parentElement?.removeChild(dialog)
  } else {
    const iframeEl = createIframe(htmlPath, mountId)
    document.body.appendChild(iframeEl)
  }
}

togglePanel('extension-sidebar-id', 'pages/sidebar.html')
</code>```

Body:
I am using executeScript to open a html file (sidebar) when clicking on my extension icon. This is the code:

import toggleExtension from './toggleExtension.ts?script'

chrome.action.onClicked.addListener(() => {
  chrome.tabs.query({ active: true, windowId: chrome.windows.WINDOW_ID_CURRENT }, tabs => {
      chrome.scripting.executeScript({
        target: {
          tabId: tabs[0].id as number,
        },
        files: [toggleExtension],
      })
  })
})

I can make it work with the func parameter, but I would like to reuse the same code for other html files. However this only executes the file on the first run, and subsequent clicks run executeScript successfully but the file is not run again.

toggleExtension file:

const createIframe = (pageUrl: string, id: string) => {
  const iframeEl = document.createElement('iframe')
  iframeEl.id = id
  iframeEl.setAttribute(
    'style',
    `
      z-index: 9999999999;
      position: fixed;
      height: 100%;
      width: 100%;
      top: 0px;
      right: 0px;
      bottom: 0px;
      left: 0px;
      border: 0;
    `
  )
  iframeEl.src = chrome.runtime.getURL(pageUrl)
  iframeEl.allow = 'clipboard-write'
  return iframeEl
}

const togglePanel = (mountId: string, htmlPath: string) => {
  const dialog = document.getElementById(mountId)
  if (dialog) {
    dialog.parentElement?.removeChild(dialog)
  } else {
    const iframeEl = createIframe(htmlPath, mountId)
    document.body.appendChild(iframeEl)
  }
}

togglePanel('extension-sidebar-id', 'pages/sidebar.html')


问:
MountVolume.SetUp failed for volume: mount failed: exit status 32
I have 1 master node and 2 worker nodes built using Amazon Linux in my dev kubernetes cluster.

I have correctly mounted AWS EFS at /share on worker1 and worker2.

Now, I am trying to create pvc, pv and deploy using the below manifests:

PersistentVolume YAML

```<code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: c2labs
spec:
  capacity:
    storage: 5Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  mountOptions:
    - hard
    - nfsvers=4.1
  nfs:
    path: /share
    server: fs-0djdd8320680f8f98.efs.us-east-1.amazonaws.com
</code>```

PersistentVolumeClaim YAML

```<code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: c2labs-files
spec:
  storageClassName: ""
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 5Gi
</code>```

Deploy YAML

```<code>apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: test
  name: test
spec:
  replicas: 2
  selector:
    matchLabels:
      app: test
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: test
    spec:
      containers:
      - image: nginx
        name: nginx
        volumeMounts:
          - mountPath: "/usr/share/nginx/html"
            name: logs-files
      volumes:
        - name: logs-files
          persistentVolumeClaim:
            claimName: c2labs-files
</code>```

Now, I am getting an error - MountVolume.SetUp failed for volume "c2labs" : mount failed: exit status 32

Need help to determine what is causing this error.

Body:
I have 1 master node and 2 worker nodes built using Amazon Linux in my dev kubernetes cluster.

I have correctly mounted AWS EFS at /share on worker1 and worker2.

Now, I am trying to create pvc, pv and deploy using the below manifests:

PersistentVolume YAML

apiVersion: v1
kind: PersistentVolume
metadata:
  name: c2labs
spec:
  capacity:
    storage: 5Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  mountOptions:
    - hard
    - nfsvers=4.1
  nfs:
    path: /share
    server: fs-0djdd8320680f8f98.efs.us-east-1.amazonaws.com

PersistentVolumeClaim YAML

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: c2labs-files
spec:
  storageClassName: ""
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 5Gi

Deploy YAML

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: test
  name: test
spec:
  replicas: 2
  selector:
    matchLabels:
      app: test
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: test
    spec:
      containers:
      - image: nginx
        name: nginx
        volumeMounts:
          - mountPath: "/usr/share/nginx/html"
            name: logs-files
      volumes:
        - name: logs-files
          persistentVolumeClaim:
            claimName: c2labs-files

Now, I am getting an error - MountVolume.SetUp failed for volume "c2labs" : mount failed: exit status 32

Need help to determine what is causing this error.


问:
K3S cluster master node error: can't set flannel backend to anything but 'none'
I'm a Kubernetes newbie and I want to set up a basic K3S cluster with a master nodes and two worker nodes. I installed K3s with the option --flannel-backend none like it said in the documentation. However, when I try and set up the flannel backend with the command:

k3s server --flannel-backend=vxlan

This is the output I get:

```<code>INFO[0000] Configuring sqlite3 database connection pooling: maxIdleConns=2, maxOpenConns=0, connMaxLifetime=0s
INFO[0000] Configuring database table schema and indexes, this may take a moment...
INFO[0000] Database tables and indexes are up to date
INFO[0000] Kine available at unix://kine.sock
FATA[0000] starting kubernetes: preparing server: bootstrap data already found and encrypted with different token```
```

What do I need to do to fix this issue?

Body:
I'm a Kubernetes newbie and I want to set up a basic K3S cluster with a master nodes and two worker nodes. I installed K3s with the option --flannel-backend none like it said in the documentation. However, when I try and set up the flannel backend with the command:

k3s server --flannel-backend=vxlan

This is the output I get:

INFO[0000] Configuring sqlite3 database connection pooling: maxIdleConns=2, maxOpenConns=0, connMaxLifetime=0s
INFO[0000] Configuring database table schema and indexes, this may take a moment...
INFO[0000] Database tables and indexes are up to date
INFO[0000] Kine available at unix://kine.sock
FATA[0000] starting kubernetes: preparing server: bootstrap data already found and encrypted with different token```

What do I need to do to fix this issue?


问:
Instantiating AmazonCognitoIdentityProviderClient in Unity 2020.3.26f, WebGL build, gives the error "Value cannot be null. Parameter name: stream"
I've been working on a Unity WebGL project, with Unity version 2020.3.26f, which aims to use AWS DynamoDB as its database. The project includes all the AWS SDK dll's, downloaded and compiled from the following link: https://www.nuget.org/packages?q=id%3AAWSSDK%20owner%3Aawsdotnet

The project builds without issues, but when run, the following line of code:
cognitoProvider = new AmazonCognitoIdentityProviderClient(new AnonymousAWSCredentials(), RegionAWS);

Generates the following error:
(https://i.stack.imgur.com/2zJAi.png)
`

```<code>ArgumentNullException: Value cannot be null.
Parameter name: stream
  at System.IO.StreamReader..ctor (System.IO.Stream stream, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize, System.Boolean leaveOpen) [0x00000] in <00000000000000000000000000000000>:0
</code>```

Has someone faced this issue before? Please let me know if you have any solution for this.

I have tried:

Updating the dlls

Change the unity version to 2019.x.x and to 2021.x.x

Building a clean project with only the specified line.

Body:
I've been working on a Unity WebGL project, with Unity version 2020.3.26f, which aims to use AWS DynamoDB as its database. The project includes all the AWS SDK dll's, downloaded and compiled from the following link: https://www.nuget.org/packages?q=id%3AAWSSDK%20owner%3Aawsdotnet

The project builds without issues, but when run, the following line of code:
cognitoProvider = new AmazonCognitoIdentityProviderClient(new AnonymousAWSCredentials(), RegionAWS);

Generates the following error:
(https://i.stack.imgur.com/2zJAi.png)
`

ArgumentNullException: Value cannot be null.
Parameter name: stream
  at System.IO.StreamReader..ctor (System.IO.Stream stream, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize, System.Boolean leaveOpen) [0x00000] in <00000000000000000000000000000000>:0

Has someone faced this issue before? Please let me know if you have any solution for this.

I have tried:

Updating the dlls

Change the unity version to 2019.x.x and to 2021.x.x

Building a clean project with only the specified line.


问:
ARM linux EasyCap + webRtc
I try to connect camera with video output to arm-device (OrangePi) over EasyCap. After connect I saw new device /dev/video1 and if use it over ffmpeg all streaming is ok. But if I try:

```<code>const devices = navigator.mediaDevices.enumerateDevices();
console.log (devices);
</code>```

there are no any videoinput device in list. With standard usb webcam work fine. Please, help, why EasyCap not show in mediaDevices?...

Title: ARM linux EasyCap + webRtc

Body:
I try to connect camera with video output to arm-device (OrangePi) over EasyCap. After connect I saw new device /dev/video1 and if use it over ffmpeg all streaming is ok. But if I try:

const devices = navigator.mediaDevices.enumerateDevices();
console.log (devices);

there are no any videoinput device in list. With standard usb webcam work fine. Please, help, why EasyCap not show in mediaDevices?...


问:
Acumatica integration with JAWS - integration for Blind business owner
Hello Acumatica Dev community,
A prospective client has approached my company about implementing Acumatica for them. The owner is blind and uses JAWS screen-reading. Has anyone implemented or customized Acumatica for the blind community? Are there any resources you can point me to?

JAWS uses standard HTML tags to read tables. I anticipate leaning heavily into GI's / reports exported to excel. Currently, the owner keeps track of his business primarily through excel sheets.

I've tested one screen-reader on Acumatica with mixed results. Forms are almost impossible.

Any suggestions?

Thanks,
Paul


问:
Function DocumentReference.set() called with invalid data
```<code>const onSignupPress = () => {
    console.log(userName, email, password);
    firebase.firestore().collection("users").doc("id0002").set({
      user_name: userName,
      user_email: email,
      user_password: password,
    });
  };
</code>```

Where Iam doing wrong?

I wanted to connect with my firebase but failing

Body:
const onSignupPress = () => {
    console.log(userName, email, password);
    firebase.firestore().collection("users").doc("id0002").set({
      user_name: userName,
      user_email: email,
      user_password: password,
    });
  };

Where Iam doing wrong?

I wanted to connect with my firebase but failing


问:
How to fetch documents from Firestore that has matching at least few items in array?
I am making social media app using SwiftUI and Firebase. I am trying to fetch users that has at least 3 interests in common, but I don't want to fetch all users and then filter out because it would be too heavy for bigger amount of users. Right now I have something like this:

```<code>func fetchAllUsers() {
        guard let uid = UserViewModel.shared.currentSession?.uid else { return }
        let ref = db
            .collection(Constants.Firebase.usersDB)
        ref.getDocuments { snapshot, error in
            if let error = error {
                self.errorService = .error(message: error.localizedDescription)
            }else if let snapshot = snapshot {
                do {
                    let allUsers = try snapshot.documents.compactMap({ try $0.data(as: User.self)})
                    self.allUser = allUsers.filter({$0.id != uid})
                } catch let error {
                    self.errorService = .error(message: error.localizedDescription)
                }
            }
        }
    }
</code>```

Each user has value of type interests which is an array of strings, I want to fetch only these users who has matching interests (at least 3).

Body:
I am making social media app using SwiftUI and Firebase. I am trying to fetch users that has at least 3 interests in common, but I don't want to fetch all users and then filter out because it would be too heavy for bigger amount of users. Right now I have something like this:

func fetchAllUsers() {
        guard let uid = UserViewModel.shared.currentSession?.uid else { return }
        let ref = db
            .collection(Constants.Firebase.usersDB)
        ref.getDocuments { snapshot, error in
            if let error = error {
                self.errorService = .error(message: error.localizedDescription)
            }else if let snapshot = snapshot {
                do {
                    let allUsers = try snapshot.documents.compactMap({ try $0.data(as: User.self)})
                    self.allUser = allUsers.filter({$0.id != uid})
                } catch let error {
                    self.errorService = .error(message: error.localizedDescription)
                }
            }
        }
    }

Each user has value of type interests which is an array of strings, I want to fetch only these users who has matching interests (at least 3).


问:
VS Code, Angular, ESLint & Prettier: Insert `⏎` prettier/prettier
I know I'm missing something simple, but I have an Angular component with the following inline template:

```<code>template: `<ng-content></ng-content>`
</code>```

ESLint is complaining because Prettier is saying there needs be a new line between the opening and closing tags, but if I do this, then Prettier just updates it to be as shown above.

I'm guessing the issue is a disparity between my ESLint setup, Prettier config and VS Code settings, so those are below. Can someone help me out? TIA.

.prettierrc

```<code>{
    "singleQuote": true,
    "printWidth": 140,
    "editor.formatOnSave": true,
    "proseWrap": "always",
    "tabWidth": 4,
    "requireConfig": false,
    "useTabs": true,
    "trailingComma": "none",
    "bracketSpacing": true,
    "bracketSameLine": true,
    "jsxBracketSameLine": true,
    "semi": true,
    "arrowParens": "avoid",
    "endOfLine": "auto",
    "overrides": [
        {
            "files": "*.component.html",
            "options": {
                "parser": "angular"
            }
        },
        {
            "files": "*.html",
            "options": {
                "parser": "angular"
            }
        }
    ]
}
</code>```

.eslintrc.json

```<code>{
  "root": true,
  "ignorePatterns": ["projects/**/*", "typings.d.ts"],
  "overrides": [
    {
      "files": ["*.ts"],
      "parserOptions": {
        "project": ["tsconfig.json", "e2e/tsconfig.e2e.json"],
        "createDefaultProgram": true
      },
      "extends": [
        "eslint:recommended",
        "plugin:@typescript-eslint/recommended",
        "plugin:@angular-eslint/recommended",
        "plugin:@angular-eslint/ng-cli-compat",
        "plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
        "plugin:@angular-eslint/template/process-inline-templates",
        "plugin:prettier/recommended"
      ],
      "rules": {
        "no-shadow": "off",
        "no-extra-boolean-cast": "off",
        "@typescript-eslint/no-shadow": ["error"],
        "@angular-eslint/component-selector": [
          "error",
          {
            "type": "element",
            "prefix": ["app", "tmt"],
            "style": "kebab-case"
          }
        ],
        "@angular-eslint/directive-selector": [
          "error",
          {
            "type": "attribute",
            "prefix": ["app", "tmt"],
            "style": "camelCase"
          }
        ],
        "@typescript-eslint/consistent-type-definitions": "error",
        "@typescript-eslint/dot-notation": "off",
        "@typescript-eslint/explicit-member-accessibility": [
          "off",
          {
            "accessibility": "explicit"
          }
        ],
        "@typescript-eslint/naming-convention": [
          "error",
          { "selector": "enumMember", "format": ["PascalCase"] },
          {
            "selector": "property",
            "format": ["camelCase", "snake_case", "UPPER_CASE"],
            "leadingUnderscore": "allow"
          },
          {
            "selector": "variable",
            "format": ["camelCase", "PascalCase", "UPPER_CASE"]
          }
        ],
        "@typescript-eslint/no-unused-vars": [
          "error",
          {
            "varsIgnorePattern": "^_",
            "argsIgnorePattern": "^_",
            "caughtErrorsIgnorePattern": "^_"
          }
        ],
        "@typescript-eslint/explicit-module-boundary-types": [
          "warn",
          { "allowArgumentsExplicitlyTypedAsAny": true }
        ],
        "brace-style": ["error", "1tbs"],
        "id-blacklist": "off",
        "id-match": "off",
        "max-len": [
          "error",
          {
            "code": 250
          }
        ],
        "no-underscore-dangle": "off",
        "prettier/prettier": [
          "error",
          {
            "endOfLine": "auto"
          }
        ],
        // NOTE: Remove when @angular-eslint/recommended--extra is available after Angular Upgrade
        "no-restricted-imports": [
          "error",
          {
            "paths": [
              {
                "name": "rxjs/Rx",
                "message": "Please import directly from 'rxjs' instead"
              }
            ]
          }
        ],
        "@typescript-eslint/member-ordering": [
          "error",
          {
            "default": [
              "static-field",
              "instance-field",
              "static-method",
              "instance-method"
            ]
          }
        ],
        "no-restricted-syntax": [
          "error",
          {
            "selector": "CallExpression[callee.object.name=\"console\"][callee.property.name=/^(debug|info|time|timeEnd|trace)$/]",
            "message": "Unexpected property on console object was called"
          }
        ],
        "@typescript-eslint/no-inferrable-types": [
          "error",
          { "ignoreParameters": true }
        ],
        "@typescript-eslint/no-non-null-assertion": "error",
        "no-fallthrough": "error"
      }
    },
    {
      "files": ["*.html"],
      "extends": [
        "plugin:@angular-eslint/template/recommended",
        "plugin:prettier/recommended"
      ],
      "rules": {}
    }
  ]
}
</code>```

VS Code Workspace Settings

```<code>{
  "angular.enable-strict-mode-prompt": false,
  "editor.insertSpaces": false,
  "editor.detectIndentation": false,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true,
  "eslint.options": {
    "extensions": [".ts", ".html"]
  },
  "eslint.probe": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "html",
    "markdown"
  ],
  "javascript.preferences.quoteStyle": "single",
  "prettier.bracketSameLine": true,
  "prettier.singleQuote": true,
  "prettier.tabWidth": 4,
  "prettier.useTabs": true,
  "typescript.preferences.quoteStyle": "single",
  "typescript.updateImportsOnFileMove.enabled": "always",
  "[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript]": {
    "editor.codeActionsOnSave": {
      "source.organizeImports": true
    },
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[markdown]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "editor.codeActionsOnSave": {
    "source.organizeImports": true
  }
}
</code>```

Body:
I know I'm missing something simple, but I have an Angular component with the following inline template:

template: `<ng-content></ng-content>`

ESLint is complaining because Prettier is saying there needs be a new line between the opening and closing tags, but if I do this, then Prettier just updates it to be as shown above.

I'm guessing the issue is a disparity between my ESLint setup, Prettier config and VS Code settings, so those are below. Can someone help me out? TIA.

.prettierrc

{
    "singleQuote": true,
    "printWidth": 140,
    "editor.formatOnSave": true,
    "proseWrap": "always",
    "tabWidth": 4,
    "requireConfig": false,
    "useTabs": true,
    "trailingComma": "none",
    "bracketSpacing": true,
    "bracketSameLine": true,
    "jsxBracketSameLine": true,
    "semi": true,
    "arrowParens": "avoid",
    "endOfLine": "auto",
    "overrides": [
        {
            "files": "*.component.html",
            "options": {
                "parser": "angular"
            }
        },
        {
            "files": "*.html",
            "options": {
                "parser": "angular"
            }
        }
    ]
}

.eslintrc.json

{
  "root": true,
  "ignorePatterns": ["projects/**/*", "typings.d.ts"],
  "overrides": [
    {
      "files": ["*.ts"],
      "parserOptions": {
        "project": ["tsconfig.json", "e2e/tsconfig.e2e.json"],
        "createDefaultProgram": true
      },
      "extends": [
        "eslint:recommended",
        "plugin:@typescript-eslint/recommended",
        "plugin:@angular-eslint/recommended",
        "plugin:@angular-eslint/ng-cli-compat",
        "plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
        "plugin:@angular-eslint/template/process-inline-templates",
        "plugin:prettier/recommended"
      ],
      "rules": {
        "no-shadow": "off",
        "no-extra-boolean-cast": "off",
        "@typescript-eslint/no-shadow": ["error"],
        "@angular-eslint/component-selector": [
          "error",
          {
            "type": "element",
            "prefix": ["app", "tmt"],
            "style": "kebab-case"
          }
        ],
        "@angular-eslint/directive-selector": [
          "error",
          {
            "type": "attribute",
            "prefix": ["app", "tmt"],
            "style": "camelCase"
          }
        ],
        "@typescript-eslint/consistent-type-definitions": "error",
        "@typescript-eslint/dot-notation": "off",
        "@typescript-eslint/explicit-member-accessibility": [
          "off",
          {
            "accessibility": "explicit"
          }
        ],
        "@typescript-eslint/naming-convention": [
          "error",
          { "selector": "enumMember", "format": ["PascalCase"] },
          {
            "selector": "property",
            "format": ["camelCase", "snake_case", "UPPER_CASE"],
            "leadingUnderscore": "allow"
          },
          {
            "selector": "variable",
            "format": ["camelCase", "PascalCase", "UPPER_CASE"]
          }
        ],
        "@typescript-eslint/no-unused-vars": [
          "error",
          {
            "varsIgnorePattern": "^_",
            "argsIgnorePattern": "^_",
            "caughtErrorsIgnorePattern": "^_"
          }
        ],
        "@typescript-eslint/explicit-module-boundary-types": [
          "warn",
          { "allowArgumentsExplicitlyTypedAsAny": true }
        ],
        "brace-style": ["error", "1tbs"],
        "id-blacklist": "off",
        "id-match": "off",
        "max-len": [
          "error",
          {
            "code": 250
          }
        ],
        "no-underscore-dangle": "off",
        "prettier/prettier": [
          "error",
          {
            "endOfLine": "auto"
          }
        ],
        // NOTE: Remove when @angular-eslint/recommended--extra is available after Angular Upgrade
        "no-restricted-imports": [
          "error",
          {
            "paths": [
              {
                "name": "rxjs/Rx",
                "message": "Please import directly from 'rxjs' instead"
              }
            ]
          }
        ],
        "@typescript-eslint/member-ordering": [
          "error",
          {
            "default": [
              "static-field",
              "instance-field",
              "static-method",
              "instance-method"
            ]
          }
        ],
        "no-restricted-syntax": [
          "error",
          {
            "selector": "CallExpression[callee.object.name=\"console\"][callee.property.name=/^(debug|info|time|timeEnd|trace)$/]",
            "message": "Unexpected property on console object was called"
          }
        ],
        "@typescript-eslint/no-inferrable-types": [
          "error",
          { "ignoreParameters": true }
        ],
        "@typescript-eslint/no-non-null-assertion": "error",
        "no-fallthrough": "error"
      }
    },
    {
      "files": ["*.html"],
      "extends": [
        "plugin:@angular-eslint/template/recommended",
        "plugin:prettier/recommended"
      ],
      "rules": {}
    }
  ]
}

VS Code Workspace Settings

{
  "angular.enable-strict-mode-prompt": false,
  "editor.insertSpaces": false,
  "editor.detectIndentation": false,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true,
  "eslint.options": {
    "extensions": [".ts", ".html"]
  },
  "eslint.probe": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "html",
    "markdown"
  ],
  "javascript.preferences.quoteStyle": "single",
  "prettier.bracketSameLine": true,
  "prettier.singleQuote": true,
  "prettier.tabWidth": 4,
  "prettier.useTabs": true,
  "typescript.preferences.quoteStyle": "single",
  "typescript.updateImportsOnFileMove.enabled": "always",
  "[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript]": {
    "editor.codeActionsOnSave": {
      "source.organizeImports": true
    },
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[markdown]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "editor.codeActionsOnSave": {
    "source.organizeImports": true
  }
}


问:
Problem when setting up Openstack Keystone
I am trying to setup an Openstack system and everything goes smoothly up to the point where I have to install Keystone. I follow the documentation for the Yoga release and when I type in the command to create a domain I receive the following error:
The request you have made requires authentication. (HTTP 401)

Does anyone else have the same problem? It is rather inexplicable since I'm following the documentation letter by letter.

I expected the command to succeed but I got an authorization error.

EDIT: Here is the output of the command with --debug:

```<code>openstack domain create --description "An example domain" example --debug
START with options: domain create --description An example domain example --debug
options: Namespace(verbose_level=3, log_file=None, deferred_help=False, debug=True, cloud='', region_name='', cacert=None, cert='', key='', verify=None, insecure=None, default_domain='default', interface='', service_provider='', remote_project_name='', remote_project_id='', remote_project_domain_name='', remote_project_domain_id='', timing=False, os_beta_command=False, profile='', os_compute_api_version='', os_identity_api_version='3', os_image_api_version='', os_network_api_version='', os_object_api_version='', os_volume_api_version='', os_key_manager_api_version='1', auth_type='', user_id='', project_id='', endpoint='', auth_url='http://hua.openstack.controller:5000/v3', system_scope='', domain_id='', domain_name='', project_name='admin', project_domain_id='', project_domain_name='Default', trust_id='', username='admin', user_domain_id='', user_domain_name='Default', password='***', identity_provider='', protocol='', client_id='', client_secret='***', openid_scope='', access_token_endpoint='', discovery_endpoint='', access_token_type='', redirect_uri='', code='', passcode='', token='***', identity_provider_url='', consumer_key='', consumer_secret='***', access_key='', access_secret='***', default_domain_id='', default_domain_name='', auth_methods='', access_token='***', application_credential_secret='***', application_credential_id='', application_credential_name='', service_provider_endpoint='', service_provider_entity_id='', os_project_name=None, os_project_id=None)
Auth plugin password selected
auth_config_hook(): {'api_timeout': None, 'verify': True, 'cacert': None, 'cert': None, 'key': None, 'baremetal_status_code_retries': '5', 'baremetal_introspection_status_code_retries': '5', 'image_status_code_retries': '5', 'disable_vendor_agent': {}, 'interface': 'public', 'floating_ip_source': 'neutron', 'image_api_use_tasks': False, 'image_format': 'qcow2', 'message': '', 'network_api_version': '2', 'object_store_api_version': '1', 'secgroup_source': 'neutron', 'status': 'active', 'auth': {'user_domain_name': 'Default', 'project_domain_name': 'Default', 'project_name': 'admin'}, 'verbose_level': 3, 'deferred_help': False, 'debug': True, 'default_domain': 'default', 'timing': False, 'auth_url': 'http://hua.openstack.controller:5000/v3', 'username': 'admin', 'password': '***', 'beta_command': False, 'identity_api_version': '3', 'key_manager_api_version': '1', 'region_name': '', 'auth_type': 'password', ': []}
defaults: {'api_timeout': None, 'verify': True, 'cacert': None, 'cert': None, 'key': None, 'auth_type': 'password', 'baremetal_status_code_retries': 5, 'baremetal_introspection_status_code_retries': 5, 'image_status_code_retries': 5, 'disable_vendor_agent': {}, 'interface': 'public', 'floating_ip_source': 'neutron', 'image_api_use_tasks': False, 'image_format': 'qcow2', 'message': '', 'network_api_version': '2', 'object_store_api_version': '1', 'secgroup_source': 'neutron', 'status': 'active'}
cloud cfg: {'api_timeout': None, 'verify': True, 'cacert': None, 'cert': None, 'key': None, 'baremetal_status_code_retries': '5', 'baremetal_introspection_status_code_retries': '5', 'image_status_code_retries': '5', 'disable_vendor_agent': {}, 'interface': 'public', 'floating_ip_source': 'neutron', 'image_api_use_tasks': False, 'image_format': 'qcow2', 'message': '', 'network_api_version': '2', 'object_store_api_version': '1', 'secgroup_source': 'neutron', 'status': 'active', 'auth': {'user_domain_name': 'Default', 'project_domain_name': 'Default', 'project_name': 'admin'}, 'verbose_level': 3, 'deferred_help': False, 'debug': True, 'default_domain': 'default', 'timing': False, 'auth_url': 'http://hua.openstack.controller:5000/v3', 'username': 'admin', 'password': '***', 'beta_command': False, 'identity_api_version': '3', 'key_manager_api_version': '1', 'region_name': '', 'auth_type': 'password', ': []}
compute API version 2.1, cmd group openstack.compute.v2
identity API version 3, cmd group openstack.identity.v3
image API version 2, cmd group openstack.image.v2
network API version 2, cmd group openstack.network.v2
object_store API version 1, cmd group openstack.object_store.v1
volume API version 3, cmd group openstack.volume.v3
/usr/lib/python3/dist-packages/barbicanclient/__init__.py:57: UserWarning: The secrets module is moved to barbicanclient/v1 directory, direct import of barbicanclient.secrets will be deprecated. Please import barbicanclient.v1.secrets instead.
  warnings.warn("The %s module is moved to barbicanclient/v1 "
key_manager API version 1, cmd group openstack.key_manager.v1
neutronclient API version 2, cmd group openstack.neutronclient.v2
command: domain create -> openstackclient.identity.v3.domain.CreateDomain (auth=True)
Auth plugin password selected
auth_config_hook(): {'api_timeout': None, 'verify': True, 'cacert': None, 'cert': None, 'key': None, 'baremetal_status_code_retries': '5', 'baremetal_introspection_status_code_retries': '5', 'image_status_code_retries': '5', 'disable_vendor_agent': {}, 'interface': 'public', 'floating_ip_source': 'neutron', 'image_api_use_tasks': False, 'image_format': 'qcow2', 'message': '', 'network_api_version': '2', 'object_store_api_version': '1', 'secgroup_source': 'neutron', 'status': 'active', 'auth': {'user_domain_name': 'Default', 'project_domain_name': 'Default', 'project_name': 'admin'}, 'additional_user_agent': [('osc-lib', '2.6.2')], 'verbose_level': 3, 'deferred_help': False, 'debug': True, 'default_domain': 'default', 'timing': False, 'auth_url': 'http://hua.openstack.controller:5000/v3', 'username': 'admin', 'password': '***', 'beta_command': False, 'identity_api_version': '3', 'key_manager_api_version': '1', 'region_name': '', 'auth_type': 'password', ': []}
Using auth plugin: password
Using parameters {'auth_url': 'http://hua.openstack.controller:5000/v3', 'project_name': 'admin', 'project_domain_name': 'Default', 'username': 'admin', 'user_domain_name': 'Default', 'password': '***'}
Get auth_ref
REQ: curl -g -i -X GET http://hua.openstack.controller:5000/v3 -H "Accept: application/json" -H "User-Agent: openstacksdk/0.101.0 keystoneauth1/5.0.0 python-requests/2.25.1 CPython/3.10.6"
Starting new HTTP connection (1): hua.openstack.controller:5000
http://hua.openstack.controller:5000 "GET /v3 HTTP/1.1" 200 264
RESP: [200] Connection: Keep-Alive Content-Length: 264 Content-Type: application/json Date: Sat, 10 Dec 2022 09:15:19 GMT Keep-Alive: timeout=5, max=100 Server: Apache/2.4.52 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-ccb595d2-2a41-4cc7-9283-a3986ad49c7a
RESP BODY: {"version": {"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "http://hua.openstack.controller:5000/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}}
GET call to http://hua.openstack.controller:5000/v3 used request id req-ccb595d2-2a41-4cc7-9283-a3986ad49c7a
Making authentication request to http://hua.openstack.controller:5000/v3/auth/tokens
http://hua.openstack.controller:5000 "POST /v3/auth/tokens HTTP/1.1" 401 109
Request returned failure status: 401
The request you have made requires authentication. (HTTP 401) (Request-ID: req-b5ce967b-36a1-436e-852e-a68ba247f5c7)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cliff/app.py", line 395, in run_subcommand
    self.prepare_to_run_command(cmd)
  File "/usr/lib/python3/dist-packages/osc_lib/shell.py", line 494, in prepare_to_run_command
    self.client_manager.auth_ref
  File "/usr/lib/python3/dist-packages/osc_lib/clientmanager.py", line 203, in auth_ref
    self._auth_ref = self.auth.get_auth_ref(self.session)
  File "/usr/lib/python3/dist-packages/keystoneauth1/identity/generic/base.py", line 208, in get_auth_ref
    return self._plugin.get_auth_ref(session, **kwargs)
  File "/usr/lib/python3/dist-packages/keystoneauth1/identity/v3/base.py", line 187, in get_auth_ref
    resp = session.post(token_url, json=body, headers=headers,
  File "/usr/lib/python3/dist-packages/keystoneauth1/session.py", line 1149, in post
    return self.request(url, 'POST', **kwargs)
  File "/usr/lib/python3/dist-packages/keystoneauth1/session.py", line 986, in request
    raise exceptions.from_response(resp, method, url)
keystoneauth1.exceptions.http.Unauthorized: The request you have made requires authentication. (HTTP 401) (Request-ID: req-b5ce967b-36a1-436e-852e-a68ba247f5c7)
clean_up CreateDomain: The request you have made requires authentication. (HTTP 401) (Request-ID: req-b5ce967b-36a1-436e-852e-a68ba247f5c7)
END return value: 1
</code>```

Body:
I am trying to setup an Openstack system and everything goes smoothly up to the point where I have to install Keystone. I follow the documentation for the Yoga release and when I type in the command to create a domain I receive the following error:
The request you have made requires authentication. (HTTP 401)

Does anyone else have the same problem? It is rather inexplicable since I'm following the documentation letter by letter.

I expected the command to succeed but I got an authorization error.

EDIT: Here is the output of the command with --debug:

openstack domain create --description "An example domain" example --debug
START with options: domain create --description An example domain example --debug
options: Namespace(verbose_level=3, log_file=None, deferred_help=False, debug=True, cloud='', region_name='', cacert=None, cert='', key='', verify=None, insecure=None, default_domain='default', interface='', service_provider='', remote_project_name='', remote_project_id='', remote_project_domain_name='', remote_project_domain_id='', timing=False, os_beta_command=False, profile='', os_compute_api_version='', os_identity_api_version='3', os_image_api_version='', os_network_api_version='', os_object_api_version='', os_volume_api_version='', os_key_manager_api_version='1', auth_type='', user_id='', project_id='', endpoint='', auth_url='http://hua.openstack.controller:5000/v3', system_scope='', domain_id='', domain_name='', project_name='admin', project_domain_id='', project_domain_name='Default', trust_id='', username='admin', user_domain_id='', user_domain_name='Default', password='***', identity_provider='', protocol='', client_id='', client_secret='***', openid_scope='', access_token_endpoint='', discovery_endpoint='', access_token_type='', redirect_uri='', code='', passcode='', token='***', identity_provider_url='', consumer_key='', consumer_secret='***', access_key='', access_secret='***', default_domain_id='', default_domain_name='', auth_methods='', access_token='***', application_credential_secret='***', application_credential_id='', application_credential_name='', service_provider_endpoint='', service_provider_entity_id='', os_project_name=None, os_project_id=None)
Auth plugin password selected
auth_config_hook(): {'api_timeout': None, 'verify': True, 'cacert': None, 'cert': None, 'key': None, 'baremetal_status_code_retries': '5', 'baremetal_introspection_status_code_retries': '5', 'image_status_code_retries': '5', 'disable_vendor_agent': {}, 'interface': 'public', 'floating_ip_source': 'neutron', 'image_api_use_tasks': False, 'image_format': 'qcow2', 'message': '', 'network_api_version': '2', 'object_store_api_version': '1', 'secgroup_source': 'neutron', 'status': 'active', 'auth': {'user_domain_name': 'Default', 'project_domain_name': 'Default', 'project_name': 'admin'}, 'verbose_level': 3, 'deferred_help': False, 'debug': True, 'default_domain': 'default', 'timing': False, 'auth_url': 'http://hua.openstack.controller:5000/v3', 'username': 'admin', 'password': '***', 'beta_command': False, 'identity_api_version': '3', 'key_manager_api_version': '1', 'region_name': '', 'auth_type': 'password', ': []}
defaults: {'api_timeout': None, 'verify': True, 'cacert': None, 'cert': None, 'key': None, 'auth_type': 'password', 'baremetal_status_code_retries': 5, 'baremetal_introspection_status_code_retries': 5, 'image_status_code_retries': 5, 'disable_vendor_agent': {}, 'interface': 'public', 'floating_ip_source': 'neutron', 'image_api_use_tasks': False, 'image_format': 'qcow2', 'message': '', 'network_api_version': '2', 'object_store_api_version': '1', 'secgroup_source': 'neutron', 'status': 'active'}
cloud cfg: {'api_timeout': None, 'verify': True, 'cacert': None, 'cert': None, 'key': None, 'baremetal_status_code_retries': '5', 'baremetal_introspection_status_code_retries': '5', 'image_status_code_retries': '5', 'disable_vendor_agent': {}, 'interface': 'public', 'floating_ip_source': 'neutron', 'image_api_use_tasks': False, 'image_format': 'qcow2', 'message': '', 'network_api_version': '2', 'object_store_api_version': '1', 'secgroup_source': 'neutron', 'status': 'active', 'auth': {'user_domain_name': 'Default', 'project_domain_name': 'Default', 'project_name': 'admin'}, 'verbose_level': 3, 'deferred_help': False, 'debug': True, 'default_domain': 'default', 'timing': False, 'auth_url': 'http://hua.openstack.controller:5000/v3', 'username': 'admin', 'password': '***', 'beta_command': False, 'identity_api_version': '3', 'key_manager_api_version': '1', 'region_name': '', 'auth_type': 'password', ': []}
compute API version 2.1, cmd group openstack.compute.v2
identity API version 3, cmd group openstack.identity.v3
image API version 2, cmd group openstack.image.v2
network API version 2, cmd group openstack.network.v2
object_store API version 1, cmd group openstack.object_store.v1
volume API version 3, cmd group openstack.volume.v3
/usr/lib/python3/dist-packages/barbicanclient/__init__.py:57: UserWarning: The secrets module is moved to barbicanclient/v1 directory, direct import of barbicanclient.secrets will be deprecated. Please import barbicanclient.v1.secrets instead.
  warnings.warn("The %s module is moved to barbicanclient/v1 "
key_manager API version 1, cmd group openstack.key_manager.v1
neutronclient API version 2, cmd group openstack.neutronclient.v2
command: domain create -> openstackclient.identity.v3.domain.CreateDomain (auth=True)
Auth plugin password selected
auth_config_hook(): {'api_timeout': None, 'verify': True, 'cacert': None, 'cert': None, 'key': None, 'baremetal_status_code_retries': '5', 'baremetal_introspection_status_code_retries': '5', 'image_status_code_retries': '5', 'disable_vendor_agent': {}, 'interface': 'public', 'floating_ip_source': 'neutron', 'image_api_use_tasks': False, 'image_format': 'qcow2', 'message': '', 'network_api_version': '2', 'object_store_api_version': '1', 'secgroup_source': 'neutron', 'status': 'active', 'auth': {'user_domain_name': 'Default', 'project_domain_name': 'Default', 'project_name': 'admin'}, 'additional_user_agent': [('osc-lib', '2.6.2')], 'verbose_level': 3, 'deferred_help': False, 'debug': True, 'default_domain': 'default', 'timing': False, 'auth_url': 'http://hua.openstack.controller:5000/v3', 'username': 'admin', 'password': '***', 'beta_command': False, 'identity_api_version': '3', 'key_manager_api_version': '1', 'region_name': '', 'auth_type': 'password', ': []}
Using auth plugin: password
Using parameters {'auth_url': 'http://hua.openstack.controller:5000/v3', 'project_name': 'admin', 'project_domain_name': 'Default', 'username': 'admin', 'user_domain_name': 'Default', 'password': '***'}
Get auth_ref
REQ: curl -g -i -X GET http://hua.openstack.controller:5000/v3 -H "Accept: application/json" -H "User-Agent: openstacksdk/0.101.0 keystoneauth1/5.0.0 python-requests/2.25.1 CPython/3.10.6"
Starting new HTTP connection (1): hua.openstack.controller:5000
http://hua.openstack.controller:5000 "GET /v3 HTTP/1.1" 200 264
RESP: [200] Connection: Keep-Alive Content-Length: 264 Content-Type: application/json Date: Sat, 10 Dec 2022 09:15:19 GMT Keep-Alive: timeout=5, max=100 Server: Apache/2.4.52 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-ccb595d2-2a41-4cc7-9283-a3986ad49c7a
RESP BODY: {"version": {"id": "v3.14", "status": "stable", "updated": "2020-04-07T00:00:00Z", "links": [{"rel": "self", "href": "http://hua.openstack.controller:5000/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}}
GET call to http://hua.openstack.controller:5000/v3 used request id req-ccb595d2-2a41-4cc7-9283-a3986ad49c7a
Making authentication request to http://hua.openstack.controller:5000/v3/auth/tokens
http://hua.openstack.controller:5000 "POST /v3/auth/tokens HTTP/1.1" 401 109
Request returned failure status: 401
The request you have made requires authentication. (HTTP 401) (Request-ID: req-b5ce967b-36a1-436e-852e-a68ba247f5c7)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cliff/app.py", line 395, in run_subcommand
    self.prepare_to_run_command(cmd)
  File "/usr/lib/python3/dist-packages/osc_lib/shell.py", line 494, in prepare_to_run_command
    self.client_manager.auth_ref
  File "/usr/lib/python3/dist-packages/osc_lib/clientmanager.py", line 203, in auth_ref
    self._auth_ref = self.auth.get_auth_ref(self.session)
  File "/usr/lib/python3/dist-packages/keystoneauth1/identity/generic/base.py", line 208, in get_auth_ref
    return self._plugin.get_auth_ref(session, **kwargs)
  File "/usr/lib/python3/dist-packages/keystoneauth1/identity/v3/base.py", line 187, in get_auth_ref
    resp = session.post(token_url, json=body, headers=headers,
  File "/usr/lib/python3/dist-packages/keystoneauth1/session.py", line 1149, in post
    return self.request(url, 'POST', **kwargs)
  File "/usr/lib/python3/dist-packages/keystoneauth1/session.py", line 986, in request
    raise exceptions.from_response(resp, method, url)
keystoneauth1.exceptions.http.Unauthorized: The request you have made requires authentication. (HTTP 401) (Request-ID: req-b5ce967b-36a1-436e-852e-a68ba247f5c7)
clean_up CreateDomain: The request you have made requires authentication. (HTTP 401) (Request-ID: req-b5ce967b-36a1-436e-852e-a68ba247f5c7)
END return value: 1


问:
SVG filter in HTML lagging on phone
I was trying to implement the following filter to some elements on my website. When I run it locally on my PC it works fine but it does not on my iphone. It is very slow and laggy. I tried Safari and Chrome. Is there any workaround or is it just not possible on phones because of hardware?

```<code><svg xmlns="http://www.w3.org/2000/svg" style="display: none;" version="1.1">
    <defs>
        <filter id="gooey-effect">
            <feGaussianBlur
            in="SourceGraphic"
            stdDeviation="10"
            result="blur"
            />
            <feColorMatrix
            in="blur"
            mode="matrix"
            values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 20 -9"
            result="gooey-effect"
            />
            <feComposite
            in="SourceGraphic"
            in2="gooey-effect"
            operator="atop"
            />
        </filter>
    </defs>
</svg>

</code>```

I expected it to work on iphones.

Title: SVG filter in HTML lagging on phone

Body:
I was trying to implement the following filter to some elements on my website. When I run it locally on my PC it works fine but it does not on my iphone. It is very slow and laggy. I tried Safari and Chrome. Is there any workaround or is it just not possible on phones because of hardware?

<svg xmlns="http://www.w3.org/2000/svg" style="display: none;" version="1.1">
    <defs>
        <filter id="gooey-effect">
            <feGaussianBlur
            in="SourceGraphic"
            stdDeviation="10"
            result="blur"
            />
            <feColorMatrix
            in="blur"
            mode="matrix"
            values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 20 -9"
            result="gooey-effect"
            />
            <feComposite
            in="SourceGraphic"
            in2="gooey-effect"
            operator="atop"
            />
        </filter>
    </defs>
</svg>

I expected it to work on iphones.


Title: output of `pmdarima`(python pkg) is different with output of `forecast`(R pkg) when difference order isn't zero

Body:
I find out that the output of predict_in_sample() in pmdarima(python pkg) is different with output of fitted() in forecast(R pkg) when difference order isn't zero.

I try to compare them in three difference order:

par(mfrow=c(3,1))

# output of predict_in_sample() for each difference order
pred_val_py_diff_ord = rbind(c(-0.007880175267916512, 0.49169989404457004, 0.28841210348688023, 0.5696976455105438, 0.32260810264909945, 0.5077959474596667, 0.47801250879611523, 0.4985613475136129, 0.07088064549811457, 0.1008287770281715, 0.3425456601541411, 0.6408112270989074, 0.15507516379071695, 0.21370781747047746, 0.21008435474885973, 0.3850643917676375, 0.4155697579047887, 0.18344750047620495, 0.27881111807639414, 0.4178551640573445, 0.23041397621421822),
                             c(0.006965460018175224, 0.7598183999091976, -0.18935901503724428, 0.9169934990855064, 0.4433484668316683, 0.35237566312822355, -0.34776516890780296, 0.21444433609188196, 0.5553043926598136, 0.9436076058879592, 0.0395336961477053, 0.31321992958241585, 0.21116818372891794, 0.6250668776266268, 0.4624525102200333, 0.15295908421139226, 0.2733396734717508, 0.2968495632295873, 0.23032370622077558, 0.02165174802208386, 0.48012563330174163),
                             c(0.005566657258041537, 1.0102938244669462, -0.44428684727769174, 2.6529682660405225, 0.3185732278045508, -0.22612855833146328, -1.1471031442185335, 0.6795229000616105, 1.595506218619741, 1.2694691997522631, -1.2341607448281202, 0.040570110630779865, 0.8778166427568617, 0.8866121795729558, 0.30225375086513107, -0.44107762925047367, 0.29536136817357606, 0.6619548819980223, -0.010701331460473806, -0.4242463222526414, 1.153699395736004))

ori_time_series <- c(0.49958017, 0.15162735, 0.86757565, 0.3093554, 0.20545085, -0.48288408, 0.6880291,
                     0.8461229, 0.8320223, -0.7372907, 0.6048833, 0.40874475, 0.57708055, 0.27590698,
                     -0.21213382, 0.4236031, 0.3324298, -0.076647766, -0.20372462, 0.93162024, 0.5740154)

for (diff_ord in seq(1:3)) {
  library(forecast)
  fit.model <- Arima(ori_time_series, order = c(2, diff_ord, 1))

  fitted_val_r_forecast_arima <- fitted(fit.model)
  fitted_val_py <- pred_val_py_diff_ord[diff_ord,]
  plot.ts(ori_time_series, xaxp = c(0, 21, 21), ylim = c(-1.5,1.5))
  lines(fitted_val_r_forecast_arima, col='green', lty=3)
  lines(fitted_val_py, col='red', lty=4)
  mtext(paste("Compare fitted vals of R and pred_in_sample vals of python for diff order:", diff_ord))
}

output image:

I observe that the first d(difference order) term has huge difference, then they getting close after d(difference order) term.

And I think the output of forecast(R package) is correct.

Based on first d term of original time-series(black line) and output of fitted() (green line)

My question is:

How should I adjust the parameters of predict_in_sample() in pmdarima to get the same output with fitted() in forecast?

I have tried the the parameter:start, but it only shorten the length of output of predict_in_sample().

PS. following codes are example of how I generate output of predict_in_sample():

import numpy as np
from pmdarima.arima import ARIMA, auto_arima

for diff_ord in range(1,4):
    model = ARIMA(order=(2,diff_ord,1), out_of_sample_size=0, mle_regression=True, suppress_warnings=True)

    ori_time_series = np.array([0.49958017, 0.15162735, 0.86757565, 0.3093554, 0.20545085, -0.48288408, 0.6880291,
                                0.8461229, 0.8320223, -0.7372907, 0.6048833, 0.40874475, 0.57708055, 0.27590698,
                                -0.21213382, 0.4236031, 0.3324298, -0.076647766, -0.20372462, 0.93162024, 0.5740154])

    model = model.fit(ori_time_series)
    pred_in_sample = np.array(model.predict_in_sample())
    print(f"pred_in_sample: {list(pred_in_sample)}")


问:
mov [rcx], rbx is moved to the start or end of the address from rcx?
I would like to ask you a question about registers. I am totally a beginner in this so forgive me if question is trivial.

I would like to know if I write in code:

```<code>mov rcx, DigitSpace
mov rbx, 10
mov [rcx], rbx
</code>```

A value of rbx will be added at the beginning of [rcx] address register or at the end of it?

I have tried to read about registers but did not find the answer....

Body:
I would like to ask you a question about registers. I am totally a beginner in this so forgive me if question is trivial.

I would like to know if I write in code:

mov rcx, DigitSpace
mov rbx, 10
mov [rcx], rbx

A value of rbx will be added at the beginning of [rcx] address register or at the end of it?

I have tried to read about registers but did not find the answer....


问:
Has anyone tried this facebook web hook restriction on feed subscription
My objective is to register all the likes of all the posts that are made on a facebook page, for this I found this facebook web hook solution that basically what it does is an http call to my api with the data of each action in the feed from my page. all good until there but I found a limitation in the facebook documentation that says the following

Notifications for Page likes will only be sent for Pages that have fewer than 10K likes.

For now this is not a problem for me since the page where I am implementing this does not have 10k likes but what will happen if I implement this solution on pages with more than 10k likes will I stop receiving the likes of the posts on the page?

There is clearly no way that I can test this limitation until I exceed 10k likes on the page, so I was hoping that one of you could tell me about his experience on this and how they solved it.

I leave the documentation link you have to scroll to the feed part:
https://developers.facebook.com/docs/graph-api/webhooks/reference/page/


问:
Troubleshooting scipy.ndimage.label on raster
I would like to process a geotif raster using scipy.ndimage.label into regions defined by adjacing equal raster values. The original file looks as below.

Landuse raster

When plotting using show_hist the histogram looks as follows.

Histogram values

Currently the raster is being processed as follows.

```<code>import io
import rasterio
import scipy

with rasterio.open('https://github.com/AaltoUrbanWater/GisToSWMM5/blob/master/demo_catchment/GIS/raster_landuse.tif?raw=true', nodata=0) as ds:
    print(ds.read(1).astype(int))
    labeled_array, num_features = scipy.ndimage.label(ds.read(1).astype(int)>0)
    print(num_features)
</code>```

In result num_features carries one value only. I would expect at least five from the histogram.

Body:
I would like to process a geotif raster using scipy.ndimage.label into regions defined by adjacing equal raster values. The original file looks as below.

Landuse raster

When plotting using show_hist the histogram looks as follows.

Histogram values

Currently the raster is being processed as follows.

import io
import rasterio
import scipy

with rasterio.open('https://github.com/AaltoUrbanWater/GisToSWMM5/blob/master/demo_catchment/GIS/raster_landuse.tif?raw=true', nodata=0) as ds:
    print(ds.read(1).astype(int))
    labeled_array, num_features = scipy.ndimage.label(ds.read(1).astype(int)>0)
    print(num_features)

In result num_features carries one value only. I would expect at least five from the histogram.


问:
requests.get generates a continuous loop of the webhook
I built a simple webhook listener in django.
The webhook sends me a JSON. I am able to get all the info stored in the JSON correctly.
Then I need to download locally an image file from url.

```<code>from django.views.decorators.csrf import csrf_exempt
import requests

@csrf_exempt
def webhook(request):
    if request.method == 'POST':
        print('Webhook received')

        # I extract all the information I need and I initialize an object
        received_data = get_all_data_from_json(request.body)

        x = requests.get(received_data.url)
        open("myimage.jpg", "wb").write(x.content)
        .....
        .....
        .....
        return HttpResponse("Webhook received!")

</code>```

The problem is that the requests.get causes the webhook listener to loop endlessly.
If I remove it, everything works just fine.
Where am I wrong?

Body:
I built a simple webhook listener in django.
The webhook sends me a JSON. I am able to get all the info stored in the JSON correctly.
Then I need to download locally an image file from url.

from django.views.decorators.csrf import csrf_exempt
import requests

@csrf_exempt
def webhook(request):
    if request.method == 'POST':
        print('Webhook received')

        # I extract all the information I need and I initialize an object
        received_data = get_all_data_from_json(request.body)

        x = requests.get(received_data.url)
        open("myimage.jpg", "wb").write(x.content)
        .....
        .....
        .....
        return HttpResponse("Webhook received!")

The problem is that the requests.get causes the webhook listener to loop endlessly.
If I remove it, everything works just fine.
Where am I wrong?


问:
Echarts Custom Legend based on graph data range
I have a simple bar graph that I would want the legend to show specific range value with its corresponding color. In the example below, I'd like to have two legends:

blue color with text '0-70%'

redcolor with text '71-100%'

This is to inform the user on what the bar color represents.

var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);
var option;

option = {
  legend: {
    type: 'plain',
    formatter: function(name) {
      return '0 - 70%';
    },
    data: [{
      name: 'days',
      icon: 'rect'
    }],
    show: true
  },
  tooltip: {},
  xAxis: [{
    data: ['MON', 'TUE', 'WED', 'THU'],
    gridIndex: 0
  }],
  yAxis: [{
    gridIndex: 0,
    max: 100,
    splitNumber: 2
  }],
  grid: [{
    height: 200,
    width: 400
  }],
  series: [
    // These series are in the first grid.
    {
      name: 'days',
      type: 'bar',
      xAxisIndex: 0,
      yAxisIndex: 0,
      data: [{
          value: 90,
          itemStyle: {
            color: getColor(80)
          }
        },
        22,
        56,
        76
      ]
    }
  ]
};

function getColor(value) {
  if (value > 70) return 'rgba(179, 26, 26, 1)';
  else return 'rgba(26, 179, 179, 1)';
}

option && myChart.setOption(option);```
<pre class="snippet-code-html lang-html prettyprint-override"><code><html>
      <header><script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.4.1/echarts.min.js" integrity="sha512-OTbGFYPLe3jhy4bUwbB8nls0TFgz10kn0TLkmyA+l3FyivDs31zsXCjOis7YGDtE2Jsy0+fzW+3/OVoPVujPmQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
      </header>
      <body>
        <div id="main" style="width: 100%; height: 400px">
        </div>
      </body>
    </html></code>```


问:
Javascript need to set the field delimiter for tsv output file when opened in excel
I am outputting to a tsv file headers and then their fields.

each field is separated by a tab. when opened in notepad the output looks good
but when opening in excel the everything is in one column, but I want the two fields to be in separate column.

how can I set the delimiter for when opened by excel so they are separate column?

this is the tsv opened
TSV
this is the excel opened
excel

this is my code so far

```<code>try{

    const tsvString = [
        [
          "header1",
          "header2"
        ],
        ...kvObjs.map(item => [
          item.field1,
          item.fiedl2
        ])
      ]
      .map(e => e.join("\t"))
          .join("\n");

    var tsvContent = "\ufeff"+tsvString;

   fs.writeFileSync("/document/outputDoc.tsv", tsvContent);

   } catch (err){
        winston.error(`Error outputDocFile :: ${err}`);
   }
</code>```

Body:
I am outputting to a tsv file headers and then their fields.

each field is separated by a tab. when opened in notepad the output looks good
but when opening in excel the everything is in one column, but I want the two fields to be in separate column.

how can I set the delimiter for when opened by excel so they are separate column?

this is the tsv opened
TSV
this is the excel opened
excel

this is my code so far

try{

    const tsvString = [
        [
          "header1",
          "header2"
        ],
        ...kvObjs.map(item => [
          item.field1,
          item.fiedl2
        ])
      ]
      .map(e => e.join("\t"))
          .join("\n");

    var tsvContent = "\ufeff"+tsvString;

   fs.writeFileSync("/document/outputDoc.tsv", tsvContent);

   } catch (err){
        winston.error(`Error outputDocFile :: ${err}`);
   }


问:
"Query failed: 'NoneType' object has no attribute 'shutdown'" when using Neo4J-Python driver on AWS Lambda despite working on Jupyter
I am currently having an issue where I am scraping data from Wikipedia using BeautifulSoup, organising it into sets of lists, and relaying it back to Neo4J. This has worked fine when running the code on my Jupyter Notebook, but doesn't seem to work when I run it on AWS Lambda.

For reference, I am certain that the issue is that I'm using the localhost URL, however I'm on Neo4J Desktop (as it's free) and I cannot find the unique database identifier URL on the app. I also don't understand why that results in the above error rather than just signifying that the "database doesn't exist" or a something like that.

I've done some testing and I'm certain it's the last line that seems to be offending here. To reiterate my main questions are:

Why am I getting this specific error rather than a "database doesn't exist" error, I'm not sure where the 'shutdown' function that apparently doesn't exist is located as I have so many files packaged in this Lambda script.

How can I find the actual Neo4J database URL? Whenever I look on Neo4J Desktop it just shows me the localhost one which obviously doesn't work here.

Forgive me if some of these questions seem dumb. I haven't used Neo in a few months so getting back to grips with everything.

Here is my code:

```<code>from bs4 import BeautifulSoup
from neo4j import __version__ as neo4j_version
from neo4j import GraphDatabase

def lambda_handler(event, context):
    headers = {
    'Accept-Encoding': 'gzip, deflate, sdch',
    'Accept-Language': 'en-US,en;q=0.8',
    'Upgrade-Insecure-Requests': '1',
    'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
    'Cache-Control': 'max-age=0',
    'Connection': 'keep-alive',
    }

    class Neo4jConnection:

        def __init__(self, uri, user, pwd):
            self.__uri = uri
            self.__user = user
            self.__pwd = pwd
            self.__driver = None
            try:
                self.__driver = GraphDatabase.driver(self.__uri, auth=(self.__user, self.__pwd))
            except Exception as e:
                print("Failed to create the driver:", e)

        def close(self):
            if self.__driver is not None:
                self.__driver.close()

        def query(self, query, db=None):
            assert self.__driver is not None, "Driver not initialized!"
            session = None
            response = None
            try:
                session = self.__driver.session(database=db) if db is not None else self.__driver.session()
                response = list(session.run(query))
            except Exception as e:
                print("Query failed:", e)
            finally:
                if session is not None:
                    session.close()
            return response

    conn = Neo4jConnection(uri="bolt://localhost:7687", user="username", pwd="password")

    query = 'List_of_' + event['console'].replace(' ', '_') + '_games'

    soups = BeautifulSoup(requests.get('website' + str(query), allow_redirects=False, headers=headers).text, 'html.parser')

    game_names = []
    for x in range(len(soups.find_all('tbody')[1].find_all('tr'))-2):
        game_names.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('th')[0].text.replace('\n', ''))
        print(x)

    game_href = []
    for x in range(len(soups.find_all('tbody')[1].find_all('tr'))-2):
        try:
            game_href.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('th')[0].find('a')['href'])
        except Exception:
            game_href.append('NA')
        print(x)

    table_genre = []
    dev_names = []
    pub_names = []
    jp_rel = []
    na_rel = []
    pal_rel = []
    for x in range(len(soups.find_all('tbody')[1].find_all('tr'))-2):
        table_genre.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('td')[0].text.replace('\n', ''))
        dev_names.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('td')[1].text.replace('\n', ''))
        pub_names.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('td')[2].text.replace('\n', ''))
        jp_rel.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('td')[3].text.replace('\n', ''))
        na_rel.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('td')[4].text.replace('\n', ''))
        pal_rel.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('td')[5].text.replace('\n', ''))

    #RELAY TO GAMESTRUCTURE DATABASE ITERATIVELY

    query_string = []
    for x in range(len(table_genre)):
        query_string.append('''CREATE (n:Game {game_name:"''' + str(game_names[x]) + '''", href: "''' + str(game_href[x]) + '''", table_genre: "''' + str(table_genre[x]) + '''", dev_name: "''' + str(dev_names[x]) + '''", pub_name: "''' + str(pub_names[x]) + '''", japan_release_date: "''' + str(jp_rel[x]) + '''", na_release_date: "''' + str(na_rel[x]) + '''", pal_release_date: "''' + str(pal_rel[x]) + '''"})''')

    for x in range(len(table_genre)):
        conn.query(query_string[x], db='gamestructure')
</code>```

Body:
I am currently having an issue where I am scraping data from Wikipedia using BeautifulSoup, organising it into sets of lists, and relaying it back to Neo4J. This has worked fine when running the code on my Jupyter Notebook, but doesn't seem to work when I run it on AWS Lambda.

For reference, I am certain that the issue is that I'm using the localhost URL, however I'm on Neo4J Desktop (as it's free) and I cannot find the unique database identifier URL on the app. I also don't understand why that results in the above error rather than just signifying that the "database doesn't exist" or a something like that.

I've done some testing and I'm certain it's the last line that seems to be offending here. To reiterate my main questions are:

Why am I getting this specific error rather than a "database doesn't exist" error, I'm not sure where the 'shutdown' function that apparently doesn't exist is located as I have so many files packaged in this Lambda script.

How can I find the actual Neo4J database URL? Whenever I look on Neo4J Desktop it just shows me the localhost one which obviously doesn't work here.

Forgive me if some of these questions seem dumb. I haven't used Neo in a few months so getting back to grips with everything.

Here is my code:

from bs4 import BeautifulSoup
from neo4j import __version__ as neo4j_version
from neo4j import GraphDatabase

def lambda_handler(event, context):
    headers = {
    'Accept-Encoding': 'gzip, deflate, sdch',
    'Accept-Language': 'en-US,en;q=0.8',
    'Upgrade-Insecure-Requests': '1',
    'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
    'Cache-Control': 'max-age=0',
    'Connection': 'keep-alive',
    }

    class Neo4jConnection:

        def __init__(self, uri, user, pwd):
            self.__uri = uri
            self.__user = user
            self.__pwd = pwd
            self.__driver = None
            try:
                self.__driver = GraphDatabase.driver(self.__uri, auth=(self.__user, self.__pwd))
            except Exception as e:
                print("Failed to create the driver:", e)

        def close(self):
            if self.__driver is not None:
                self.__driver.close()

        def query(self, query, db=None):
            assert self.__driver is not None, "Driver not initialized!"
            session = None
            response = None
            try:
                session = self.__driver.session(database=db) if db is not None else self.__driver.session()
                response = list(session.run(query))
            except Exception as e:
                print("Query failed:", e)
            finally:
                if session is not None:
                    session.close()
            return response

    conn = Neo4jConnection(uri="bolt://localhost:7687", user="username", pwd="password")

    query = 'List_of_' + event['console'].replace(' ', '_') + '_games'

    soups = BeautifulSoup(requests.get('website' + str(query), allow_redirects=False, headers=headers).text, 'html.parser')

    game_names = []
    for x in range(len(soups.find_all('tbody')[1].find_all('tr'))-2):
        game_names.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('th')[0].text.replace('\n', ''))
        print(x)

    game_href = []
    for x in range(len(soups.find_all('tbody')[1].find_all('tr'))-2):
        try:
            game_href.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('th')[0].find('a')['href'])
        except Exception:
            game_href.append('NA')
        print(x)

    table_genre = []
    dev_names = []
    pub_names = []
    jp_rel = []
    na_rel = []
    pal_rel = []
    for x in range(len(soups.find_all('tbody')[1].find_all('tr'))-2):
        table_genre.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('td')[0].text.replace('\n', ''))
        dev_names.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('td')[1].text.replace('\n', ''))
        pub_names.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('td')[2].text.replace('\n', ''))
        jp_rel.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('td')[3].text.replace('\n', ''))
        na_rel.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('td')[4].text.replace('\n', ''))
        pal_rel.append(soups.find_all('tbody')[1].find_all('tr')[x+2].find_all('td')[5].text.replace('\n', ''))

    #RELAY TO GAMESTRUCTURE DATABASE ITERATIVELY

    query_string = []
    for x in range(len(table_genre)):
        query_string.append('''CREATE (n:Game {game_name:"''' + str(game_names[x]) + '''", href: "''' + str(game_href[x]) + '''", table_genre: "''' + str(table_genre[x]) + '''", dev_name: "''' + str(dev_names[x]) + '''", pub_name: "''' + str(pub_names[x]) + '''", japan_release_date: "''' + str(jp_rel[x]) + '''", na_release_date: "''' + str(na_rel[x]) + '''", pal_release_date: "''' + str(pal_rel[x]) + '''"})''')

    for x in range(len(table_genre)):
        conn.query(query_string[x], db='gamestructure')


问:
Can I filter out files shared on Teams from MS Graph sharedWithMe API reponse?
I have been trying to retrieve files shared with me from the Graph API sharedWithMe endpoint but I see no option to specify the source / origin of the files, specifically those coming from MS Teams. Is there maybe some attribute inside the response that I'm missing and that might indicate that origin?

I have gone through the docs at https://learn.microsoft.com/en-us/graph/api/drive-sharedwithme?view=graph-rest-1.0&tabs=http and tried to go over the response the API is returning.


问:
React: Validate dynamic fields using Formik and Yup
I have a couple of fields dynamically generated which I need to validate. The validations required are presence check and type checking (only numbers).

Following is the Form:

```<code>export const CampaignForm = (index: number) => ({
  formId: 'CampaignForm',
  formField: {
    campaignName: {
      name: 'campaignName',
      label: 'Name of your Campaign',
      placeholder: "Campaign's Name",
      requiredErrorMsg: 'Campaign name is required',
    },
    startDate: {
      name: 'startDate',
      label: 'Start Date',
      placeholder: 'Enter Start Date for Campaign',
      requiredErrorMsg: 'Start Date is required',
    },
    endDate: {
      name: 'endDate',
      label: 'End Date (Optional)',
      placeholder: 'Enter End Date for Campaign',
      requiredErrorMsg: 'Please enter a valid End Date',
    },
    ruleValue: {
      name: `campaignRules[${index}].value`,
      label: 'Value',
      placeholder: 'Select value',
      requiredErrorMsg: `Value for Rule ${index + 1} can't be left blank`,
    },
  },
})
</code>```

I have defined following validation schema:

```<code>export const CampaignEditValidationSchema = Yup.object({
  campaignName: Yup.string().required(campaignName.requiredErrorMsg),
  startDate: Yup.date().nullable().required(startDate.requiredErrorMsg),
  content: Yup.string().required(content.requiredErrorMsg),
  ruleValue: Yup.string().required(ruleValue.requiredErrorMsg),
})
</code>```

"ruleValue" is the dynamic validation I want. The problem is that despite value being present in the "Value" field Formik is still complaining about 'missing value'.

This is the Formik component I have:

```<code>const FormikLabelledTextInput: React.FC<IFormikLabelledTextInputProps> = (
  props,
) => {
  const [field, meta] = useField(props)
  console.log('My field:', field, ' and meta:', meta)
  const _renderErrorText = () => {
    const touched = meta.touched
    const error = meta.error
    if (touched && error) {
      return error
    } else return null
  }

  const error = _renderErrorText()

  return (
    <Container>
      <Label htmlFor={props.name}>
        <BodyText>{props.label}</BodyText>
      </Label>
      <Spacer height={6} />
      <ErrorSpan>{error}</ErrorSpan>
      <FormikTextInput isError={error !== null} {...field} {...props} />
    </Container>
  )
}
</code>```

These Rules are laid down using Field Array:

```<code><FieldArray name="campaignRules">
        {(fieldArrayProps) => {
          const { push, remove } = fieldArrayProps
          const { campaignRules } = fieldArrayProps.form.values
          return (
            <RulesBody>
              {campaignRules?.map((rule, index) => {
                return (
                  <RuleCard
                    key={rule.id}
                    ruleInfo={rule}
                    ruleNumber={index}
                    onDelete={remove}
                  />
                )
              })}
            </RulesBody>
          )
        }}
      </FieldArray>
</code>```

RuleCard contains the FormikLabelledTextInput

```<code>const RuleCard: React.FC<ICardProps> = ({ ruleInfo, ruleNumber, onDelete }) => {
  return (
    <Card>
      <Header>
        <H3>{`Rule ${ruleNumber + 1}`}</H3>
        <Trash onClickHandler={() => onDelete(ruleNumber)} />
      </Header>
      <Spacer height={16} />
      <Row>
        <FormikLabelledTextInput
          type="text"
          name={CampaignForm(ruleNumber).formField.ruleValue.name}
          label={CampaignForm(ruleNumber).formField.ruleValue.label}
          placeholder={CampaignForm(ruleNumber).formField.ruleValue.placeholder}
        />
      </Row>
    </Card>
  )
}

</code>```

The expected result is that if for Rule X, rule value is defined Formik shouldn't complain about the missing value.

Body:
I have a couple of fields dynamically generated which I need to validate. The validations required are presence check and type checking (only numbers).

Following is the Form:

export const CampaignForm = (index: number) => ({
  formId: 'CampaignForm',
  formField: {
    campaignName: {
      name: 'campaignName',
      label: 'Name of your Campaign',
      placeholder: "Campaign's Name",
      requiredErrorMsg: 'Campaign name is required',
    },
    startDate: {
      name: 'startDate',
      label: 'Start Date',
      placeholder: 'Enter Start Date for Campaign',
      requiredErrorMsg: 'Start Date is required',
    },
    endDate: {
      name: 'endDate',
      label: 'End Date (Optional)',
      placeholder: 'Enter End Date for Campaign',
      requiredErrorMsg: 'Please enter a valid End Date',
    },
    ruleValue: {
      name: `campaignRules[${index}].value`,
      label: 'Value',
      placeholder: 'Select value',
      requiredErrorMsg: `Value for Rule ${index + 1} can't be left blank`,
    },
  },
})

I have defined following validation schema:

export const CampaignEditValidationSchema = Yup.object({
  campaignName: Yup.string().required(campaignName.requiredErrorMsg),
  startDate: Yup.date().nullable().required(startDate.requiredErrorMsg),
  content: Yup.string().required(content.requiredErrorMsg),
  ruleValue: Yup.string().required(ruleValue.requiredErrorMsg),
})

"ruleValue" is the dynamic validation I want. The problem is that despite value being present in the "Value" field Formik is still complaining about 'missing value'.

This is the Formik component I have:

const FormikLabelledTextInput: React.FC<IFormikLabelledTextInputProps> = (
  props,
) => {
  const [field, meta] = useField(props)
  console.log('My field:', field, ' and meta:', meta)
  const _renderErrorText = () => {
    const touched = meta.touched
    const error = meta.error
    if (touched && error) {
      return error
    } else return null
  }

  const error = _renderErrorText()

  return (
    <Container>

        <BodyText>{props.label}</BodyText>

      <Spacer height={6} />
      <ErrorSpan>{error}</ErrorSpan>
      <FormikTextInput isError={error !== null} {...field} {...props} />
    </Container>
  )
}

These Rules are laid down using Field Array:

<FieldArray name="campaignRules">
        {(fieldArrayProps) => {
          const { push, remove } = fieldArrayProps
          const { campaignRules } = fieldArrayProps.form.values
          return (
            <RulesBody>
              {campaignRules?.map((rule, index) => {
                return (
                  <RuleCard
                    key={rule.id}
                    ruleInfo={rule}
                    ruleNumber={index}
                    onDelete={remove}
                  />
                )
              })}
            </RulesBody>
          )
        }}
      </FieldArray>

RuleCard contains the FormikLabelledTextInput

const RuleCard: React.FC<ICardProps> = ({ ruleInfo, ruleNumber, onDelete }) => {
  return (
    <Card>

{`Rule ${ruleNumber + 1}`}

        <Trash onClickHandler={() => onDelete(ruleNumber)} />

      <Spacer height={16} />
      <Row>
        <FormikLabelledTextInput
          type="text"
          name={CampaignForm(ruleNumber).formField.ruleValue.name}
          label={CampaignForm(ruleNumber).formField.ruleValue.label}
          placeholder={CampaignForm(ruleNumber).formField.ruleValue.placeholder}
        />
      </Row>
    </Card>
  )
}

The expected result is that if for Rule X, rule value is defined Formik shouldn't complain about the missing value.