问:
C# WinForms ListView - delete column doesn't actually remove data
I have a WinForms ListView table, which I load from a text file, which is comma delimited.  This is then split, line by line, by comma.  The resulting string is then added into a ListViewItem.  Example of what my ListView looks like after insert ListView

I have a couple of issues, the main one being that I have set up a listener on column header click, which allows deletion of the column.  This does result in the removal of the column data.  The code for this is (I'm still learning C# so I appreciate this may not be the correct way of doing things):

```<code>private void DataTable_ColClick(object sender, ColumnClickEventArgs e)
{
    Int32 colIndex = Convert.ToInt32(e.Column.ToString());
    PublicVars.ColClicked = colIndex;
    contextMenuStrip1.Show(Cursor.Position);
}

private void DeleteMenu_Click(object sender, EventArgs e)
{
    if (PublicVars.ColClicked >= 0)
    {
        RawCSVData.BeginUpdate();
        RawCSVData.Columns.RemoveAt(PublicVars.ColClicked);
        RawCSVData.EndUpdate();
        PublicVars.ColClicked = -1;
    }
}
</code>```

My problem starts when I want to add the contents of the visual ListView into a ListView which I pass to another class, when that happens it also includes all the column data that was "deleted".

This is the code used to create a new List<string>, using the visual ListView sub-items, created as a comma delimited string (this is the only way I could find of doing it - again, I'm still learning so this may not be the best way of achieving it).

```<code>public void UpdatedDataOkBtn_Click(object sender, EventArgs e)
{
    try
    {
        List<string> StringLV = new List<string>();

        for (int i = 0; i < RawCSVData.Items.Count; i++)
        {
            string EachLine = "";
            for (int j = 0; j < RawCSVData.Items[i].SubItems.Count; j++)
            {
                string element = RawCSVData.Items[i].SubItems[j].Text;
                if (element.Length > 0)
                {
                    EachLine += element + ",";
                }
            }
            StringLV.Add(EachLine.Remove(EachLine.Length - 1));

        }
        string[] StrArr = StringLV.ToArray();
        string FirstLineInArray = StrArr[0];

        List<string> Lines = new List<string>();
        Lines.AddRange(Regex.Split(FirstLineInArray, "[,]{1}(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))"));

        ActiveForm.Close();

        ConvertForm convertForm = new ConvertForm();

        int[] DataPosition = CheckCSVData.ScanArray(Lines);

        var (CSVListData, TotalAmount, NumRows) = PopulateLV.Populate(StringLV, DataPosition);

        convertForm.Show();

        convertForm.BuildDataTable(CSVListData, TotalAmount, NumRows);
    }
    catch (Exception error)
    {
        ConvertForm.ErrorState(error.ToString());
    }
}
</code>```

How do I just create a new ListView with only the visible items?

As a side question - I want to start at the first Col0 (I create the number of columns based on the number of comma delimited values), but as you can see, I end up with an initial Col0 (which is set in the ListView ColumnHeader Collection Editor), but then my data imported from the file begins in the next col (I assign the Col value using a counter).

And finally, I did attempt to allow column reordering, which worked OK, but again, when inserting into a new ListView, it didn't retain the visual ordering.

I have attempted several different possible solutions, but none seem to take only the remaining column data into the new ListView.

Body:
I have a WinForms ListView table, which I load from a text file, which is comma delimited.  This is then split, line by line, by comma.  The resulting string is then added into a ListViewItem.  Example of what my ListView looks like after insert ListView

I have a couple of issues, the main one being that I have set up a listener on column header click, which allows deletion of the column.  This does result in the removal of the column data.  The code for this is (I'm still learning C# so I appreciate this may not be the correct way of doing things):

private void DataTable_ColClick(object sender, ColumnClickEventArgs e)
{
    Int32 colIndex = Convert.ToInt32(e.Column.ToString());
    PublicVars.ColClicked = colIndex;
    contextMenuStrip1.Show(Cursor.Position);
}

private void DeleteMenu_Click(object sender, EventArgs e)
{
    if (PublicVars.ColClicked >= 0)
    {
        RawCSVData.BeginUpdate();
        RawCSVData.Columns.RemoveAt(PublicVars.ColClicked);
        RawCSVData.EndUpdate();
        PublicVars.ColClicked = -1;
    }
}

My problem starts when I want to add the contents of the visual ListView into a ListView which I pass to another class, when that happens it also includes all the column data that was "deleted".

This is the code used to create a new List<string>, using the visual ListView sub-items, created as a comma delimited string (this is the only way I could find of doing it - again, I'm still learning so this may not be the best way of achieving it).

public void UpdatedDataOkBtn_Click(object sender, EventArgs e)
{
    try
    {
        List<string> StringLV = new List<string>();

        for (int i = 0; i < RawCSVData.Items.Count; i++)
        {
            string EachLine = "";
            for (int j = 0; j < RawCSVData.Items[i].SubItems.Count; j++)
            {
                string element = RawCSVData.Items[i].SubItems[j].Text;
                if (element.Length > 0)
                {
                    EachLine += element + ",";
                }
            }
            StringLV.Add(EachLine.Remove(EachLine.Length - 1));

        }
        string[] StrArr = StringLV.ToArray();
        string FirstLineInArray = StrArr[0];

        List<string> Lines = new List<string>();
        Lines.AddRange(Regex.Split(FirstLineInArray, "[,]{1}(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))"));

        ActiveForm.Close();

        ConvertForm convertForm = new ConvertForm();

        int[] DataPosition = CheckCSVData.ScanArray(Lines);

        var (CSVListData, TotalAmount, NumRows) = PopulateLV.Populate(StringLV, DataPosition);

        convertForm.Show();

        convertForm.BuildDataTable(CSVListData, TotalAmount, NumRows);
    }
    catch (Exception error)
    {
        ConvertForm.ErrorState(error.ToString());
    }
}

How do I just create a new ListView with only the visible items?

As a side question - I want to start at the first Col0 (I create the number of columns based on the number of comma delimited values), but as you can see, I end up with an initial Col0 (which is set in the ListView ColumnHeader Collection Editor), but then my data imported from the file begins in the next col (I assign the Col value using a counter).

And finally, I did attempt to allow column reordering, which worked OK, but again, when inserting into a new ListView, it didn't retain the visual ordering.

I have attempted several different possible solutions, but none seem to take only the remaining column data into the new ListView.


来源: stackexchange

问:
Facebook oEmbed width
I'm trying to make a request for a Facebook oEmbed but it seems I'm unable to request a responsive width. It looks like the legacy API returned a responsive response, but the current API only seems to allow for a 'maxwidth' param to be passed, which in turn returns a hard-coded set width. Omitting 'maxwidth' returns a default 552px width response.

Is there anyway to get it to return a responsive width?

ContentLicense: CC BY-SA 4.0

Title: Facebook oEmbed width


问:
Yara match regex against variable from module
I've written my own module to parse a certain file format. Certain fields of this format are saved into variables with set_string https://yara.readthedocs.io/en/stable/writingmodules.html#setting-variable-s-values

Now I want to write a rule, that checks if a regex matches against this field. This approach works:

```<code>import "my-module"

rule dummy
{
        condition:
                my-module.my-variable matches /[a-z]/
}
</code>```

But this one does not. I'd like to define the regular expressions before hand and after that use them by their name.

```<code>import "my-module"

rule dummy
{
        strings:
                $re = /[a-z]/
        condition:
                my-module.my-variable matches $re
}
</code>```

This is the error: error: rule "dummy" in rule.yar(6): syntax error

Can someone tell me how to define a regex in a variable, and then match it against variables from my own module?

Body:
I've written my own module to parse a certain file format. Certain fields of this format are saved into variables with set_string https://yara.readthedocs.io/en/stable/writingmodules.html#setting-variable-s-values

Now I want to write a rule, that checks if a regex matches against this field. This approach works:

import "my-module"

rule dummy
{
        condition:
                my-module.my-variable matches /[a-z]/
}

But this one does not. I'd like to define the regular expressions before hand and after that use them by their name.

import "my-module"

rule dummy
{
        strings:
                $re = /[a-z]/
        condition:
                my-module.my-variable matches $re
}

This is the error: error: rule "dummy" in rule.yar(6): syntax error

Can someone tell me how to define a regex in a variable, and then match it against variables from my own module?


问:
How to add multiple conditions in lambda function
I have cloudwatch events for lambda functions, one is for success and one is for failed

success event:

```<code>{
  "version": "0",
  "id": "abcdef00-1234-5678-9abc-def01234567809",
  "detail-type": "Glue Job State Change",
  "source": "aws.glue",
  "account": "1230986569012",
  "time": "2017-09-07T18:57:21Z",
  "region": "us-east-1",
  "resources": [],
  "detail": {
    "jobName": "MyJob",
    "severity": "INFO",
    "state": "SUCCEEDED",
    "jobRunId": "jr_abcdef0123423456789abcdef0123456789",
    "message": "Job run succeeded"
  }
}
</code>```

Failed event:

```<code>{
  "version": "0",
  "id": "abcdef01-1234-5678-9abc-def012988678",
  "detail-type": "Glue Job State Change",
  "source": "aws.glue",
  "account": "1234509879012",
  "time": "2017-09-07T06:02:03Z",
  "region": "us-east-1",
  "resources": [],
  "detail": {
    "jobName": "MyJob",
    "severity": "ERROR",
    "state": "FAILED",
    "jobRunId": "jr_0123456789abcdef0126789abcdef0123456789abcdef",
    "message": "JobName:MyJob and JobRunId:jr_0123456789ab23456789abcdef0123456789abcdef failed to execute with exception Role arn:aws:iam::123897002012:role/Glue_Role should be given assume role permissions for Glue Service."
  }
}
</code>```

i created a lambda function if job success need to send success events message and if job failed need to send failed events message. It's sending notifications for success events but for failed events i am not receiving any notifications.

lambda:

```<code>import boto3
import json
import os
import logging

logger = logging.getLogger()
logger.setLevel(logging.INFO)

client = boto3.client('sns')

snsTopicARN = "arn:aws:sns:ap-northeast-1:439840230123:sns_topics"

def lambda_handler(event, context):
    logger.info('## INITIATED BY EVENT: ')
    print(event)
    logger.info(event['detail'])

    glueJobName = event['detail']['jobName']
    jobRunId = event['detail']['jobRunId']

    if event['detail']['state'] == 'SUCCEEDED':
        message = \
            "Job has been successed. " \
            + glueJobName + ", JobRunID: " + jobRunId + event['detail']['message']
        logger.info(message)
        response = client.publish(
            TargetArn=snsTopicARN,
            Message=json.dumps({'default': json.dumps(message)}),
            Subject='Glue Job Success Notifications',
            MessageStructure='json')

    elif event['detail']['state'] == 'FAILED':
        message = \
            "Job has been failed. JobName: " \
            + glueJobName + ", JobRunID: " + jobRunId + event['detail']['message']
        logger.info(message)
        response = client.publish(
            TargetArn=snsTopicARN,
            Message=json.dumps({'default': json.dumps(message)}),
            Subject='Glue Job Failed Notifications',
            MessageStructure='json')
</code>```

I have added two conditions for this but i am not understanding where is the error.

Body:
I have cloudwatch events for lambda functions, one is for success and one is for failed

success event:

{
  "version": "0",
  "id": "abcdef00-1234-5678-9abc-def01234567809",
  "detail-type": "Glue Job State Change",
  "source": "aws.glue",
  "account": "1230986569012",
  "time": "2017-09-07T18:57:21Z",
  "region": "us-east-1",
  "resources": [],
  "detail": {
    "jobName": "MyJob",
    "severity": "INFO",
    "state": "SUCCEEDED",
    "jobRunId": "jr_abcdef0123423456789abcdef0123456789",
    "message": "Job run succeeded"
  }
}

Failed event:

{
  "version": "0",
  "id": "abcdef01-1234-5678-9abc-def012988678",
  "detail-type": "Glue Job State Change",
  "source": "aws.glue",
  "account": "1234509879012",
  "time": "2017-09-07T06:02:03Z",
  "region": "us-east-1",
  "resources": [],
  "detail": {
    "jobName": "MyJob",
    "severity": "ERROR",
    "state": "FAILED",
    "jobRunId": "jr_0123456789abcdef0126789abcdef0123456789abcdef",
    "message": "JobName:MyJob and JobRunId:jr_0123456789ab23456789abcdef0123456789abcdef failed to execute with exception Role arn:aws:iam::123897002012:role/Glue_Role should be given assume role permissions for Glue Service."
  }
}

i created a lambda function if job success need to send success events message and if job failed need to send failed events message. It's sending notifications for success events but for failed events i am not receiving any notifications.

lambda:

import boto3
import json
import os
import logging

logger = logging.getLogger()
logger.setLevel(logging.INFO)

client = boto3.client('sns')

snsTopicARN = "arn:aws:sns:ap-northeast-1:439840230123:sns_topics"

def lambda_handler(event, context):
    logger.info('## INITIATED BY EVENT: ')
    print(event)
    logger.info(event['detail'])

    glueJobName = event['detail']['jobName']
    jobRunId = event['detail']['jobRunId']

    if event['detail']['state'] == 'SUCCEEDED':
        message = \
            "Job has been successed. " \
            + glueJobName + ", JobRunID: " + jobRunId + event['detail']['message']
        logger.info(message)
        response = client.publish(
            TargetArn=snsTopicARN,
            Message=json.dumps({'default': json.dumps(message)}),
            Subject='Glue Job Success Notifications',
            MessageStructure='json')

    elif event['detail']['state'] == 'FAILED':
        message = \
            "Job has been failed. JobName: " \
            + glueJobName + ", JobRunID: " + jobRunId + event['detail']['message']
        logger.info(message)
        response = client.publish(
            TargetArn=snsTopicARN,
            Message=json.dumps({'default': json.dumps(message)}),
            Subject='Glue Job Failed Notifications',
            MessageStructure='json')

I have added two conditions for this but i am not understanding where is the error.


问:
Is it possible to perform bit operations with LLVM TableGen？
Suppose I have a pattern ：

```<code>def SET : R<Opcode7<"SET",0b0000000>,
            (outs GPR:$rd),
            (ins GPR:$src, i32imm:$IMM5),
            "SET $rd, #$IMM5",
            [(set GPR:$rd, (or GPR:$src, imm:$IMM5))]>;
</code>```
```<code>class R<Opcode7 opcode, dag outs, dag ins, string asmstr, list<dag> pattern>
    : Inst16<outs, ins, asmstr, pattern, InstFormatR> {

  bits<7> Opcode = opcode.Value;

  bits<5> IMM5;
  bits<4> rd;

  let Inst{6-0} = Opcode;
  let Inst{8-7}   = IMM5{4-3};
  let Inst{12-9} = rd;
  let Inst{15-13} = IMM5{2-0};
}
</code>```

Although IMM5 matches the constant in bc well, it should minus 1 because the index starts from 0.

Expected behavior：
SET rd, 0

Actual behavior:
SET rd, 1

I don't know how and where to implement that.

Body:
Suppose I have a pattern ：

def SET : R<Opcode7<"SET",0b0000000>,
            (outs GPR:$rd),
            (ins GPR:$src, i32imm:$IMM5),
            "SET $rd, #$IMM5",
            [(set GPR:$rd, (or GPR:$src, imm:$IMM5))]>;

class R<Opcode7 opcode, dag outs, dag ins, string asmstr, list<dag> pattern>
    : Inst16<outs, ins, asmstr, pattern, InstFormatR> {

  bits<7> Opcode = opcode.Value;

  bits<5> IMM5;
  bits<4> rd;

  let Inst{6-0} = Opcode;
  let Inst{8-7}   = IMM5{4-3};
  let Inst{12-9} = rd;
  let Inst{15-13} = IMM5{2-0};
}

Although IMM5 matches the constant in bc well, it should minus 1 because the index starts from 0.

Expected behavior：
SET rd, 0

Actual behavior:
SET rd, 1

I don't know how and where to implement that.


问:
How to deduct usage by each user in MySQL
I would like to get data from two database by JOIN and display usage of items for each user.
There's are 3 servers and get 3 type of items(aaa for 50ea, bbb for 40ea, ccc for 20ea) from those servers.
The goal is to show each user took how many items from which server.

first query and table

SELECT timestamp, items, server_name, amount FROM server_info ORDER BY timestamp, items;
enter image description here

Second query and table

SELECT timestamp, items, user, used_acount FROM user_info ORDER BY timestamp, items;
enter image description here

Expected Output
enter image description here
Description for attached image :
(1) Kim used 40ea of aaa from server1.
(2) and then Lee used the remaining 10 from server1 and 20 from server2.
(3) and then Park used the remaining 20 from server2.
(4) and 20ea of aaa remained in server3.
(5) The cumulative deduction for usage has to apply only within the same time and item.
(6) The number of servers and users can be more than three.

Please, help to make the query syntax including all conditions if it's possible.
If it cannot be resolved just with a query, shell script or Python can be also used.
Thanks for your help!^^

I tried to use 'JOIN' option as like "SELECT a.timestamp, a.items, b.user, b.used_amount, a.server_name, a.amount FROM server_info a JOIN user_info b ON a.timestamp=b.timestamp AND a.items=b.items WHERE ..."
But, It's not easy to apply a cumulative deduction by each user.


问:
How do i Index more then 1 million product pages in Google Search Console?
I have a webshop which has over 1 million unique products (electronic parts). Now we are running into a problem, which is getting them all indexed in Google.

Somehow it is too much for Google to index.

We tried to write our own bot which scripts everything. After indexing about 400 to 600k it didnt work anymore.

So we are looking for other ways to get Google to index 1 million unique product pages.

Do you have any idea?


问:
Github action, npm run production, Missing script: "production"
I am trying to connect my github laravel repository to cpanel so I can update the file in cpanel more easily. So I follow the guide in the comments on this link, Is that possible to deploy Laravel web application to shared hosting using GitHub Action & GitHub FTP Deploy? . As I filled all the info required and ran it, the following are the errors that I get. I tried to solve the error and refer to guide on this stackoverflow link in the comments but it is not working, Github action: npm install -> Error: Process completed with exit code 1 . Please help.

```<code>Run npm run production
  npm run production
  shell: /usr/bin/bash -e {0}
  env:
    COMPOSER_PROCESS_TIMEOUT: 0
    COMPOSER_NO_INTERACTION: 1
    COMPOSER_NO_AUDIT: 1
npm ERR! Missing script: "production"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2022-12-06T11_58_08_283Z-debug-0.log
Error: Process completed with exit code 1.
</code>```

my package.json

```<code>{
    "private": true,
    "scripts": {
        "preinstall": "npx npm-force-resolutions",
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "@tailwindcss/forms": "^0.5.2",
        "@tailwindcss/typography": "^0.5.0",
        "alpinejs": "^3.0.6",
        "autoprefixer": "^10.4.7",
        "axios": "^0.25",
        "laravel-vite-plugin": "^0.5.0",
        "lodash": "^4.17.19",
        "postcss": "^8.4.14",
        "tailwindcss": "^3.1.0",
        "vite": "^3.0.0"
    },
    "dependencies": {
        "chart.js": "^3.8.0",
        "chartjs-adapter-moment": "^1.0.0",
        "flatpickr": "^4.6.13",
        "moment": "^2.29.4"
    },
    "resolutions": {
      "node-sass": "https://registry.npmjs.org/dart-sass/-/dart-sass-
       1.25.0.tgz"
    },
</code>```

}

my main.yaml file:

```<code>on:
  push:
    branches:
      - main
name:  Deploy website on push
jobs:
  web-deploy:
    name:  Deploy
    runs-on: ubuntu-latest
    steps:
    - name:  Get latest code
      uses: actions/checkout@v2

    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: 8.1.11

    - name: Cache Composer packages
      id: composer-cache
      uses: actions/cache@v2
      with:
        path: vendor
        key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          ${{ runner.os }}-php-

    - name: Save state
      run: echo "{name}={value}" >> $GITHUB_STATE

    - name: Set output
      run: echo "{name}={value}" >> $GITHUB_OUTPUT

    - name: Install dependencies
      run: composer install --prefer-dist --no-progress

    - name: install npm
      run:  npm install

    - name: run npm production
      run:  npm run production

    - name:  Sync files
      uses: SamKirkland/FTP-Deploy-Action@4.3.3
      with:
        server: ftp.sabahloka.com
        username: ${{ secrets.ftp_username }}
        password: ${{ secrets.ftp_password }}
        server-dir: /home/sabahlok/hackathon2.dfa-learning.sabahloka.com/
</code>```

Body:
I am trying to connect my github laravel repository to cpanel so I can update the file in cpanel more easily. So I follow the guide in the comments on this link, Is that possible to deploy Laravel web application to shared hosting using GitHub Action & GitHub FTP Deploy? . As I filled all the info required and ran it, the following are the errors that I get. I tried to solve the error and refer to guide on this stackoverflow link in the comments but it is not working, Github action: npm install -> Error: Process completed with exit code 1 . Please help.

Run npm run production
  npm run production
  shell: /usr/bin/bash -e {0}
  env:
    COMPOSER_PROCESS_TIMEOUT: 0
    COMPOSER_NO_INTERACTION: 1
    COMPOSER_NO_AUDIT: 1
npm ERR! Missing script: "production"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2022-12-06T11_58_08_283Z-debug-0.log
Error: Process completed with exit code 1.

my package.json

{
    "private": true,
    "scripts": {
        "preinstall": "npx npm-force-resolutions",
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "@tailwindcss/forms": "^0.5.2",
        "@tailwindcss/typography": "^0.5.0",
        "alpinejs": "^3.0.6",
        "autoprefixer": "^10.4.7",
        "axios": "^0.25",
        "laravel-vite-plugin": "^0.5.0",
        "lodash": "^4.17.19",
        "postcss": "^8.4.14",
        "tailwindcss": "^3.1.0",
        "vite": "^3.0.0"
    },
    "dependencies": {
        "chart.js": "^3.8.0",
        "chartjs-adapter-moment": "^1.0.0",
        "flatpickr": "^4.6.13",
        "moment": "^2.29.4"
    },
    "resolutions": {
      "node-sass": "https://registry.npmjs.org/dart-sass/-/dart-sass-
       1.25.0.tgz"
    },

}

my main.yaml file:

on:
  push:
    branches:
      - main
name:  Deploy website on push
jobs:
  web-deploy:
    name:  Deploy
    runs-on: ubuntu-latest
    steps:
    - name:  Get latest code
      uses: actions/checkout@v2

    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: 8.1.11

    - name: Cache Composer packages
      id: composer-cache
      uses: actions/cache@v2
      with:
        path: vendor
        key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          ${{ runner.os }}-php-

    - name: Save state
      run: echo "{name}={value}" >> $GITHUB_STATE

    - name: Set output
      run: echo "{name}={value}" >> $GITHUB_OUTPUT

    - name: Install dependencies
      run: composer install --prefer-dist --no-progress

    - name: install npm
      run:  npm install

    - name: run npm production
      run:  npm run production

    - name:  Sync files
      uses: SamKirkland/FTP-Deploy-Action@4.3.3
      with:
        server: ftp.sabahloka.com
        username: ${{ secrets.ftp_username }}
        password: ${{ secrets.ftp_password }}
        server-dir: /home/sabahlok/hackathon2.dfa-learning.sabahloka.com/


问:
if(function returns this) do that else if(function returns that) do that thing | Vanila Javascript | JS
So basically, I'm doing a weather app and I want a button that change between Fahrenheit and Celsius.
My problem is that when I click on the change button only 1 statement renders always.
I start in Celsius then I click on the button its switch to Fahrenheit so far so good but when I click on it again its stays the same and logs switchToFar.

```<code>function getCurrentSystem(){
    let system = '';
    if(temperature.textContent.includes("°C")){
    system = 'metric';
    }else if(temperature.textContent.includes("°F")){
    system = 'imperial';
    }
    console.log(system);
    return (system);

}

function convertSystem(tempNum, curTmp, btn){
    let currentTempChange = curTmp;
    let tempInCel = tempNum;
    let tempInFar = Math.round((tempNum * 1.8) + 32);
    if (getCurrentSystem = "metric" ){
        currentTempChange.textContent = `${tempInFar} °F`;
        btn.textContent = "Use Celsius";
        console.log("switchToFar");
    }else if(getCurrentSystem = "imperial" ){
        currentTempChange.textContent = `${tempInCel} °C`;
        btn.textContent = "Use Fahrenheit";
        console.log("switchToCel");
    }
}
</code>```

I have tried to add temperature to global scope (code above), tried it passing through with local variable, I tried the if statements with getCurrentSystem.bind(null, currentTempChange), and getCurrentSystem.call)
also tried with == and =
for some reason it always thing it's in Celsius even after it renders to Fahren

Body:
So basically, I'm doing a weather app and I want a button that change between Fahrenheit and Celsius.
My problem is that when I click on the change button only 1 statement renders always.
I start in Celsius then I click on the button its switch to Fahrenheit so far so good but when I click on it again its stays the same and logs switchToFar.

function getCurrentSystem(){
    let system = '';
    if(temperature.textContent.includes("°C")){
    system = 'metric';
    }else if(temperature.textContent.includes("°F")){
    system = 'imperial';
    }
    console.log(system);
    return (system);

}

function convertSystem(tempNum, curTmp, btn){
    let currentTempChange = curTmp;
    let tempInCel = tempNum;
    let tempInFar = Math.round((tempNum * 1.8) + 32);
    if (getCurrentSystem = "metric" ){
        currentTempChange.textContent = `${tempInFar} °F`;
        btn.textContent = "Use Celsius";
        console.log("switchToFar");
    }else if(getCurrentSystem = "imperial" ){
        currentTempChange.textContent = `${tempInCel} °C`;
        btn.textContent = "Use Fahrenheit";
        console.log("switchToCel");
    }
}

I have tried to add temperature to global scope (code above), tried it passing through with local variable, I tried the if statements with getCurrentSystem.bind(null, currentTempChange), and getCurrentSystem.call)
also tried with == and =
for some reason it always thing it's in Celsius even after it renders to Fahren


问:
Data collection on web site with web proxy using requests
I'm trying to collect data from a website, but the internet I'm using crashes some websites and a pop-up appears to enter the login and password for the proxy. This is the code I tried:

```<code>import requests
from requests.auth import HTTPProxyAuth

proxy_string = 'http://user:password@10.31.220.23:3218'

s = requests.Session()
s.proxies = {"http": proxy_string , "https": proxy_string}
s.auth = HTTPProxyAuth('user','password')

r = s.get('https://www.google.com/',
                    proxies={"http": proxy_string, "https": proxy_string})
print(r.text)
</code>```

it gives me this error message:

```<code>requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02C07628>: Failed to establish a new connection: [WinError 10060] Uma tentativa de conexão falhou porque o componente conectado não respondeu\r\ncorretamente após um período de tempo ou a conexão estabelecida falhou\r\nporque o host conectado não respondeu')))
</code>```

I tried starting sessions with a proxy but it didn't work

enter image description here

Body:
I'm trying to collect data from a website, but the internet I'm using crashes some websites and a pop-up appears to enter the login and password for the proxy. This is the code I tried:

import requests
from requests.auth import HTTPProxyAuth

proxy_string = 'http://user:password@10.31.220.23:3218'

s = requests.Session()
s.proxies = {"http": proxy_string , "https": proxy_string}
s.auth = HTTPProxyAuth('user','password')

r = s.get('https://www.google.com/',
                    proxies={"http": proxy_string, "https": proxy_string})
print(r.text)

it gives me this error message:

requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02C07628>: Failed to establish a new connection: [WinError 10060] Uma tentativa de conexão falhou porque o componente conectado não respondeu\r\ncorretamente após um período de tempo ou a conexão estabelecida falhou\r\nporque o host conectado não respondeu')))

I tried starting sessions with a proxy but it didn't work

enter image description here


问:
What do these symbols mean in XML .DTD? "?" "+" and "|"
I got this exercise for school in which I should write an XML file for this .dtd file but I dont know and cant find the meaning of the marked symbols. Does anyone know the meaning of them?

enter image description here


问:
Cmake alters path
I have got a shell script and a programme and try to debug the weird behaviour of the given shell script.
It looks like that:

```<code>#!/bin/bash
cd ~/codebase/build
rm bin/*
rm -R runs
cmake ~/codebase/
make
mkdir runs
for i in ./bin/*
do
    mkdir results
    mkdir results/indexes
    mkdir results/workloads
    echo "Executing $i"
    $i >checksum.txt
    mv checksum.txt runs/$(basename "$i")_checksum.txt
    mv results runs/$(basename "$i")_outputs
done
</code>```

It goes into build, deletes some folders in there and then runs cmake on the upper directory. Then it does make and then it loops around in the bin folder which was created by the cmake command.

My problem is the following: The cmake command resets the folder.
Before cmake, I am in ./build/, but after cmake, I am in ./ again. But if Cmake did not find changes from last compilation, it doesnt run so it stays in ./build/.
This is a weird behaviour I cannot really control.
Is there a trick to stop this?

Title: Cmake alters path

Body:
I have got a shell script and a programme and try to debug the weird behaviour of the given shell script.
It looks like that:

#!/bin/bash
cd ~/codebase/build
rm bin/*
rm -R runs
cmake ~/codebase/
make
mkdir runs
for i in ./bin/*
do
    mkdir results
    mkdir results/indexes
    mkdir results/workloads
    echo "Executing $i"
    $i >checksum.txt
    mv checksum.txt runs/$(basename "$i")_checksum.txt
    mv results runs/$(basename "$i")_outputs
done

It goes into build, deletes some folders in there and then runs cmake on the upper directory. Then it does make and then it loops around in the bin folder which was created by the cmake command.

My problem is the following: The cmake command resets the folder.
Before cmake, I am in ./build/, but after cmake, I am in ./ again. But if Cmake did not find changes from last compilation, it doesnt run so it stays in ./build/.
This is a weird behaviour I cannot really control.
Is there a trick to stop this?


问:
Recommended image base for spring-boot service coded in Kotlin
I have a spring-boot based service which is coded in Kotlin and i want to create a Dockerfile for it and i'm not sure what to base it off in the opening FROM command when creating the Dockerfile. Any recommendations???


问:
Getting critical vulnerability after adding some modules to Dockerfile
`

```<code>FROM php:8.1-apache

RUN apt-get update
...
...

RUN docker-php-ext-install mysqli pdo_mysql && docker-php-ext-enable mysqli pdo_mysql
**RUN docker-php-ext-install exif && docker-php-ext-enable exif
RUN apt-get update && apt-get install -y libmagickwand-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
# install imagick
# Version is not officially released https://pecl.php.net/get/imagick but following works for PHP 8
RUN mkdir -p /usr/src/php/ext/imagick; \
    curl -fsSL https://github.com/Imagick/imagick/archive/06116aa24b76edaf6b1693198f79e6c295eda8a9.tar.gz | tar xvz -C "/usr/src/php/ext/imagick" --strip 1; \
    docker-php-ext-install imagick;
#install some base extensions
RUN apt-get update && apt-get install -y \
    zlib1g-dev \
    libzip-dev
RUN docker-php-ext-install zip
#gd
#RUN docker-php-ext-install gd && docker-php-ext-enable gd
RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
    && docker-php-ext-install gd
#intl
RUN apt-get -y update \
&& apt-get install -y libicu-dev \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl**
RUN a2enmod rewrite
</code>```

`

Once the docker image is build and push to ECR, I'm getting the 1 critical on Vulnerability part, this happens after adding the modules into the Dockerfile. Can anyone help me to reduce the size and which image to use.

Body:
`

FROM php:8.1-apache

RUN apt-get update
...
...

RUN docker-php-ext-install mysqli pdo_mysql && docker-php-ext-enable mysqli pdo_mysql
**RUN docker-php-ext-install exif && docker-php-ext-enable exif
RUN apt-get update && apt-get install -y libmagickwand-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
# install imagick
# Version is not officially released https://pecl.php.net/get/imagick but following works for PHP 8
RUN mkdir -p /usr/src/php/ext/imagick; \
    curl -fsSL https://github.com/Imagick/imagick/archive/06116aa24b76edaf6b1693198f79e6c295eda8a9.tar.gz | tar xvz -C "/usr/src/php/ext/imagick" --strip 1; \
    docker-php-ext-install imagick;
#install some base extensions
RUN apt-get update && apt-get install -y \
    zlib1g-dev \
    libzip-dev
RUN docker-php-ext-install zip
#gd
#RUN docker-php-ext-install gd && docker-php-ext-enable gd
RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
    && docker-php-ext-install gd
#intl
RUN apt-get -y update \
&& apt-get install -y libicu-dev \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl**
RUN a2enmod rewrite

`

Once the docker image is build and push to ECR, I'm getting the 1 critical on Vulnerability part, this happens after adding the modules into the Dockerfile. Can anyone help me to reduce the size and which image to use.


问:
GetOldTweets3 - An error occured during an HTTP request: HTTP Error 403: Forbidden
I am trying to obtain tweets from a specific company and in a range date, but it gives the following error:

```<code>An error occured during an HTTP request: HTTP Error 403: Forbidden
Try to open in browser: https://twitter.com/search?q=MSFT&src=typd
An exception has occurred, use %tb to see the full traceback.
</code>```

I tried to clear the cache from the browser, but still the issue persists.

Body:
I am trying to obtain tweets from a specific company and in a range date, but it gives the following error:

An error occured during an HTTP request: HTTP Error 403: Forbidden
Try to open in browser: https://twitter.com/search?q=MSFT&src=typd
An exception has occurred, use %tb to see the full traceback.

I tried to clear the cache from the browser, but still the issue persists.


问:
Can't use swagger ui in chrome and intellij idea due to CORS
I can't send requests with swagger ui. Here's the error:

```<code>Access to fetch at 'http://localhost:8080/events' from origin 'https://editor.swagger.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
</code>```

The same in Intellij idea.

I've tried everything from here. In intellij I've checked "Allow unsigned requests" box in File | Settings | Build, Execution, Deployment | Debugger, but that also didn't work.

Does anybody know how to fix this CORS thing?

Body:
I can't send requests with swagger ui. Here's the error:

Access to fetch at 'http://localhost:8080/events' from origin 'https://editor.swagger.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

The same in Intellij idea.

I've tried everything from here. In intellij I've checked "Allow unsigned requests" box in File | Settings | Build, Execution, Deployment | Debugger, but that also didn't work.

Does anybody know how to fix this CORS thing?


问:
'vtkScalarBarActor' show error with vtkGenericOpenGLRenderWindow
vtk version = 9.2
qt version = 5.9

// ======================
I want to add vtkScalarBarActor in vtk widget under qt , but I have a problem. When using vtkGenericOpenGLRenderWindow, the displayed color bar has no color, and the label is normal. But if I switch vtkGenericOpenGLRenderWindow to vtkRenderWindow, everything is normal, but now I have to Use vtkGenericOpenGLRenderWindow, does anyone know why this is the case? Is it because vtkGenericOpenGLRenderWindow is any different from vtkRenderWindow?

anormal color bar
normal color bar

i can sure while switch vtkGenericOpenGLRenderWindow to vtkRenderWindow, everything is normal

i hope vtkScalarBarActor function can be us base vtkGenericOpenGLRenderWindow


问:
Relations in Nest JS (Type ORM using SQL DB)
I am unable to understand relations basically I know the concept of relations but I am unable to us them in my project like m not getting what I want.
I don't know what is wrong here

```<code>import { ApiProperty } from '@nestjs/swagger';

import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  OneToOne,
  JoinColumn,
} from 'typeorm';
import { Customer } from './Customer.entitye';
import { Sale } from './Sale.entity';

@Entity()
export class Mobile {
  @PrimaryGeneratedColumn()
  @ApiProperty()
  id: number;
  @Column()
  @ApiProperty()
  Mobile_name: string;
  @Column()
  @ApiProperty()
  Mobile_Model: string;
  @Column()
  @ApiProperty()
  Mobile_EMEI: String;
  @Column()
  @ApiProperty()
  Mobile_Price: number;
  @Column()
  @ApiProperty()
  Mobile_Color: string;
  @OneToOne(() => Sale)
  @JoinColumn()
  Profile: Sale;
  @OneToOne(() => Customer)
  @JoinColumn()
  customer: Customer;
}
</code>```

and the second entity is

```<code>import { ApiProperty } from '@nestjs/swagger';
import { Entity, Column, PrimaryGeneratedColumn, OneToOne, JoinColumn } from 'typeorm';
import { Mobile } from './Mobile.entity';

@Entity()
export class Sale{
    @PrimaryGeneratedColumn()
    id:number
     @Column()
     @ApiProperty()
     Sold_Mobile : String
     @OneToOne(() => Mobile, (mobile) => mobile.Mobile_EMEI)
     @JoinColumn()
      mobile: Mobile
}
</code>```

why this Mobileid is null
SS of DB

kindly give me the sol or just tell me the best source to learn thi thing

Body:
I am unable to understand relations basically I know the concept of relations but I am unable to us them in my project like m not getting what I want.
I don't know what is wrong here

import { ApiProperty } from '@nestjs/swagger';

import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  OneToOne,
  JoinColumn,
} from 'typeorm';
import { Customer } from './Customer.entitye';
import { Sale } from './Sale.entity';

@Entity()
export class Mobile {
  @PrimaryGeneratedColumn()
  @ApiProperty()
  id: number;
  @Column()
  @ApiProperty()
  Mobile_name: string;
  @Column()
  @ApiProperty()
  Mobile_Model: string;
  @Column()
  @ApiProperty()
  Mobile_EMEI: String;
  @Column()
  @ApiProperty()
  Mobile_Price: number;
  @Column()
  @ApiProperty()
  Mobile_Color: string;
  @OneToOne(() => Sale)
  @JoinColumn()
  Profile: Sale;
  @OneToOne(() => Customer)
  @JoinColumn()
  customer: Customer;
}

and the second entity is

import { ApiProperty } from '@nestjs/swagger';
import { Entity, Column, PrimaryGeneratedColumn, OneToOne, JoinColumn } from 'typeorm';
import { Mobile } from './Mobile.entity';

@Entity()
export class Sale{
    @PrimaryGeneratedColumn()
    id:number
     @Column()
     @ApiProperty()
     Sold_Mobile : String
     @OneToOne(() => Mobile, (mobile) => mobile.Mobile_EMEI)
     @JoinColumn()
      mobile: Mobile
}

why this Mobileid is null
SS of DB

kindly give me the sol or just tell me the best source to learn thi thing


问:
How do I generate a string type like 'AA|BB|CC'?
I have a type that looks like this:

```<code>type StrOr = 'A'|'B'|'C'
</code>```

Now, I need a type SplitStr that makes the SplitStr<StrOr>  of type 'A|B|C'

How do I do that?

Body:
I have a type that looks like this:

type StrOr = 'A'|'B'|'C'

Now, I need a type SplitStr that makes the SplitStr<StrOr>  of type 'A|B|C'

How do I do that?


问:
AVCaptureSession runtime error when another app is capturing a video (NSOSStatusErrorDomain -12983)
My app records a video by using AVCaptureSession. It works fine unless other app is using camera as well (e.g. start video call in Zoom, open the app, start capture session). In that case by starting capture session my app gets the following runtime error

```<code>AVCaptureSessionRuntimeErrorNotification, object = Optional(<AVCaptureSession: 0x282c242b0 [AVCaptureSessionPreset1280x720]>
    <AVCaptureDeviceInput: 0x282e42c20 [Back Camera]>[vide] -> <AVCaptureVideoPreviewLayer: 0x2820af750>
    <AVCaptureDeviceInput: 0x282e42c20 [Back Camera]>[vide] -> <AVCapturePhotoOutput: 0x282e4c0c0>
    <AVCaptureDeviceInput: 0x282e43680 [iPhone Microphone]>[soun] -> <AVCapturePhotoOutput: 0x282e4c0c0>
    <AVCaptureDeviceInput: 0x282e42c20 [Back Camera]>[vide] -> <AVCaptureVideoDataOutput: 0x282e48ac0>
    <AVCaptureDeviceInput: 0x282e43680 [iPhone Microphone]>[soun] -> <AVCaptureAudioDataOutput: 0x282e480a0>), userInfo = Optional([AnyHashable("AVCaptureSessionErrorKey"):
        Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed"
        UserInfo={
            NSLocalizedFailureReason=An unknown error occurred (-12983),
            NSLocalizedDescription=The operation could not be completed,
            NSUnderlyingError=0x2820a2490 {Error Domain=NSOSStatusErrorDomain Code=-12983 "(null)"}
        }
])
</code>```

Re-starting capture session leads to the same error. I found that -12983 error code stands for Core Media Session error indicating "Insufficient Priority": https://developer.apple.com/forums/thread/10422

Is there any way to specify priority for AVCaptureSession or maybe there's some other way to make capture session works even if other app is also capturing the video? (I haven't found any way to specify priority for AVCaptureSession or any other AVFoundation object that's used for video capturing)

Body:
My app records a video by using AVCaptureSession. It works fine unless other app is using camera as well (e.g. start video call in Zoom, open the app, start capture session). In that case by starting capture session my app gets the following runtime error

AVCaptureSessionRuntimeErrorNotification, object = Optional(<AVCaptureSession: 0x282c242b0 [AVCaptureSessionPreset1280x720]>
    <AVCaptureDeviceInput: 0x282e42c20 [Back Camera]>[vide] -> <AVCaptureVideoPreviewLayer: 0x2820af750>
    <AVCaptureDeviceInput: 0x282e42c20 [Back Camera]>[vide] -> <AVCapturePhotoOutput: 0x282e4c0c0>
    <AVCaptureDeviceInput: 0x282e43680 [iPhone Microphone]>[soun] -> <AVCapturePhotoOutput: 0x282e4c0c0>
    <AVCaptureDeviceInput: 0x282e42c20 [Back Camera]>[vide] -> <AVCaptureVideoDataOutput: 0x282e48ac0>
    <AVCaptureDeviceInput: 0x282e43680 [iPhone Microphone]>[soun] -> <AVCaptureAudioDataOutput: 0x282e480a0>), userInfo = Optional([AnyHashable("AVCaptureSessionErrorKey"):
        Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed"
        UserInfo={
            NSLocalizedFailureReason=An unknown error occurred (-12983),
            NSLocalizedDescription=The operation could not be completed,
            NSUnderlyingError=0x2820a2490 {Error Domain=NSOSStatusErrorDomain Code=-12983 "(null)"}
        }
])

Re-starting capture session leads to the same error. I found that -12983 error code stands for Core Media Session error indicating "Insufficient Priority": https://developer.apple.com/forums/thread/10422

Is there any way to specify priority for AVCaptureSession or maybe there's some other way to make capture session works even if other app is also capturing the video? (I haven't found any way to specify priority for AVCaptureSession or any other AVFoundation object that's used for video capturing)


问:
Resend OTP in android from multi-factor authentication
How to resend the OTP in android from the firebase multi-factor authentication?

I was trying to implement firebase multifactor Authentication in my app, When I try to request for the resend OTP, The OTP is being received. But when the OTP is given it shows wrong OTP.


问:
Build a Corpus with tokens corpuses pfd texts as variable in a development Quanteda function
I am a beginner r user and I would need some help with my project.

I want to build a quanteda corpus for PDF text analysis. I have developed a function that gonna help me rebuild the corpus by putting the tokens back together in the same order after the cleaning process.

`

```<code>#Rebuild the corpus by putting the tokens back together in the same order
    corpus.tokens<- function(x, ...){
    quanteda:::build_corpus(
    unlist(lapply(x, paste, collapse = " ")),
    docvars = cbind(quanteda:::make_docvars(length(x), docnames(x), docvars(x)))
  )
}
</code>```

`

What I am trying to do is try to specify the each corpus toks and restoring them using the corpus quanteda function.

`

```<code>    class1_corp<- corpus(class1toks)
    class2_corp<- Corpus(class2toks)
    class3_corp<- corpus(class3toks)
    class4_corp<- corpus(class4toks)
    class5_corp<- corpus(class5toks)
</code>```

`

When I try to execute the last code I get the following error message:
Error in unique && any(duplicated(docname)) :
invalid 'x' type in 'x && y'

I am not sure what this message means (I tried to look it up on google and could not find anything) and I do not know what I am doing wrong.
Any help would be much appreciated!

Body:
I am a beginner r user and I would need some help with my project.

I want to build a quanteda corpus for PDF text analysis. I have developed a function that gonna help me rebuild the corpus by putting the tokens back together in the same order after the cleaning process.

`

#Rebuild the corpus by putting the tokens back together in the same order
    corpus.tokens<- function(x, ...){
    quanteda:::build_corpus(
    unlist(lapply(x, paste, collapse = " ")),
    docvars = cbind(quanteda:::make_docvars(length(x), docnames(x), docvars(x)))
  )
}

`

What I am trying to do is try to specify the each corpus toks and restoring them using the corpus quanteda function.

`

    class1_corp<- corpus(class1toks)
    class2_corp<- Corpus(class2toks)
    class3_corp<- corpus(class3toks)
    class4_corp<- corpus(class4toks)
    class5_corp<- corpus(class5toks)

`

When I try to execute the last code I get the following error message:
Error in unique && any(duplicated(docname)) :
invalid 'x' type in 'x && y'

I am not sure what this message means (I tried to look it up on google and could not find anything) and I do not know what I am doing wrong.
Any help would be much appreciated!


问:
How to add data in two tables and delete data at the same time using one button?
"i have problem in my Students Registration form, i want to insert my students information in my different database.

table for students information

and table for courses ICT, ABM & HE

I also want to insert, update, delete, both of the data inserted in this two different databases, with only one button in one Form in vb.net"

```<code>connect()

if txtStudID = "" and txtF.text = "" and txtM.text = "" and txtS.text = "" then

    messagebox.show("Please Complete the Data")

else

    comm.Connection =conn

    comm.Commandtext = "INSERT into MyDatabase values ('" & txtStudID.text & "', '" & txtF.text & "', '" & txtM.text & "', '" & txtS.text & "', '" & dtpDOB.text & "', '" & cboGender.text & "', '" & txtAge.text & "', '" & cboProg.text & "', '" & cboYr.text & "', '" & Source.text & "', '" & txtPhone.text & "', '" & txtEmail.text & "', '" & txtAddress.text & "', '" & RD.text & "')"

    comm.ExecuteNonQuery()

    populate()

    Myclear()

end if

'to the second table

if cboProg.Text = ICT then

    comm.Connection =conn

    comm.Commandtext = "INSERT into ICT values ('" & txtStudID.text & "', '" & txtF.text & "', '" & txtM.text & "', '" & txtS.text & "', '" & dtpDOB.text & "', '" & cboGender.text & "', '" & txtAge.text & "', '" & cboProg.text & "', '" & cboYr.text & "', '" & Source.text & "', '" & txtPhone.text & "', '" & txtEmail.text & "', '" & txtAddress.text & "', '" & RD.text & "')"

    comm.ExecuteNonQuery()

    messagebox.show("Successfully Registered as an ICT STUDENT!")

elseif cboProg.Text = ABM then

    comm.Connection =conn

    comm.Commandtext = "INSERT into ABM values ('" & txtStudID.text & "', '" & txtF.text & "', '" & txtM.text & "', '" & txtS.text & "', '" & dtpDOB.text & "', '" & cboGender.text & "', '" & txtAge.text & "', '" & cboProg.text & "', '" & cboYr.text & "', '" & Source.text & "', '" & txtPhone.text & "', '" & txtEmail.text & "', '" & txtAddress.text & "', '" & RD.text & "')"

    comm.ExecuteNonQuery()

    messagebox.show("Successfully Registered as an ABM STUDENT!")
elseif cboProg.Text = HE then
    comm.Connection =conn
    comm.Commandtext = "INSERT into HE values ('" & txtStudID.text & "', '" & txtF.text & "', '" & txtM.text & "', '" & txtS.text & "', '" & dtpDOB.text & "', '" & cboGender.text & "', '" & txtAge.text & "', '" & cboProg.text & "', '" & cboYr.text & "', '" & Source.text & "', '" & txtPhone.text & "', '" & txtEmail.text & "', '" & txtAddress.text & "', '" & RD.text & "')"

    comm.ExecuteNonQuery()

    messagebox.show("Successfully Registered as an HE STUDENT!")

    END IF
</code>```

Body:
"i have problem in my Students Registration form, i want to insert my students information in my different database.

table for students information

and table for courses ICT, ABM & HE

I also want to insert, update, delete, both of the data inserted in this two different databases, with only one button in one Form in vb.net"

connect()

if txtStudID = "" and txtF.text = "" and txtM.text = "" and txtS.text = "" then

    messagebox.show("Please Complete the Data")

else

    comm.Connection =conn

    comm.Commandtext = "INSERT into MyDatabase values ('" & txtStudID.text & "', '" & txtF.text & "', '" & txtM.text & "', '" & txtS.text & "', '" & dtpDOB.text & "', '" & cboGender.text & "', '" & txtAge.text & "', '" & cboProg.text & "', '" & cboYr.text & "', '" & Source.text & "', '" & txtPhone.text & "', '" & txtEmail.text & "', '" & txtAddress.text & "', '" & RD.text & "')"

    comm.ExecuteNonQuery()

    populate()

    Myclear()

end if

'to the second table

if cboProg.Text = ICT then

    comm.Connection =conn

    comm.Commandtext = "INSERT into ICT values ('" & txtStudID.text & "', '" & txtF.text & "', '" & txtM.text & "', '" & txtS.text & "', '" & dtpDOB.text & "', '" & cboGender.text & "', '" & txtAge.text & "', '" & cboProg.text & "', '" & cboYr.text & "', '" & Source.text & "', '" & txtPhone.text & "', '" & txtEmail.text & "', '" & txtAddress.text & "', '" & RD.text & "')"

    comm.ExecuteNonQuery()

    messagebox.show("Successfully Registered as an ICT STUDENT!")

elseif cboProg.Text = ABM then

    comm.Connection =conn

    comm.Commandtext = "INSERT into ABM values ('" & txtStudID.text & "', '" & txtF.text & "', '" & txtM.text & "', '" & txtS.text & "', '" & dtpDOB.text & "', '" & cboGender.text & "', '" & txtAge.text & "', '" & cboProg.text & "', '" & cboYr.text & "', '" & Source.text & "', '" & txtPhone.text & "', '" & txtEmail.text & "', '" & txtAddress.text & "', '" & RD.text & "')"

    comm.ExecuteNonQuery()

    messagebox.show("Successfully Registered as an ABM STUDENT!")
elseif cboProg.Text = HE then
    comm.Connection =conn
    comm.Commandtext = "INSERT into HE values ('" & txtStudID.text & "', '" & txtF.text & "', '" & txtM.text & "', '" & txtS.text & "', '" & dtpDOB.text & "', '" & cboGender.text & "', '" & txtAge.text & "', '" & cboProg.text & "', '" & cboYr.text & "', '" & Source.text & "', '" & txtPhone.text & "', '" & txtEmail.text & "', '" & txtAddress.text & "', '" & RD.text & "')"

    comm.ExecuteNonQuery()

    messagebox.show("Successfully Registered as an HE STUDENT!")

    END IF


问:
Upload flutter app to app store with one signal extension
We are trying to upload flutter app in which one signal is used but during the upload we are getting this error.

AppStore Connect Operation Error:-

Xcode One Signal Extension:-

One Signal Extension:-

Can someone please explain to me how to solve this?

Any help would be greatly appreciated.

Thanks in advance.


问:
Get Specflow Examples input from External JSON file
We use examples or datatables in specflow feature file to give different inputs to scenarios. Is it possible to receive the inputs from JSON file instead of mentioning it in the feature file. Meaning, is it possible to supply inputs to a scenario from external JSON file instead of supplying it from examples?

This is a sample feature file with inputs to scenario supplied from Examples:

```<code>Scenario Outline: Add two numbers
    Given the first number is <Value1>
    And the second number is <Value2>
    When the two numbers are added
    Then the result should be <Expected result>

Examples:
    | Value1 | Value2 | Expected result |
    | 2      | 3      | 5               |
    | 2      | 5      | 7               |
</code>```

Instead of giving the inputs in Examples, can we give it in an external JSON file like below? If yes, how? Kindly help.

```<code>[
  {
    "Value1": 2,
    "Value2": 3,
    "Expected result": 5
  },
  {
    "Value1": 2,
    "Value2": 5,
    "Expected result": 7
  }
]
</code>```

Body:
We use examples or datatables in specflow feature file to give different inputs to scenarios. Is it possible to receive the inputs from JSON file instead of mentioning it in the feature file. Meaning, is it possible to supply inputs to a scenario from external JSON file instead of supplying it from examples?

This is a sample feature file with inputs to scenario supplied from Examples:

Scenario Outline: Add two numbers
    Given the first number is <Value1>
    And the second number is <Value2>
    When the two numbers are added
    Then the result should be <Expected result>

Examples:
    | Value1 | Value2 | Expected result |
    | 2      | 3      | 5               |
    | 2      | 5      | 7               |

Instead of giving the inputs in Examples, can we give it in an external JSON file like below? If yes, how? Kindly help.

[
  {
    "Value1": 2,
    "Value2": 3,
    "Expected result": 5
  },
  {
    "Value1": 2,
    "Value2": 5,
    "Expected result": 7
  }
]


问:
Can a ros::Subscriber be initialized using std::function as callback object?
I am trying to pass the subscriber callback function from another class as std::function object.

```<code>const std::function<void(const geometry_msgs::Twist&)> cmd_vel_callback;

test_sub = cmd_vel_node_handle.subscribe<geometry_msgs::Twist&>("/"+subscription_topic,100, cmd_vel_callback);
</code>```

But I am getting this compilation error:

```<code>
error: no match for call to ‘(std::function<void(const geometry_msgs::Twist_<std::allocator<void> >&)>) (const boost::shared_ptr<const geometry_msgs::Twist_<std::allocator<void> > >&)’
</code>```

Is it because the callback object can only be of boost::function type and not std::function type?

Reference:
node_handle.subscribe

Body:
I am trying to pass the subscriber callback function from another class as std::function object.

const std::function<void(const geometry_msgs::Twist&)> cmd_vel_callback;

test_sub = cmd_vel_node_handle.subscribe<geometry_msgs::Twist&>("/"+subscription_topic,100, cmd_vel_callback);

But I am getting this compilation error:

error: no match for call to ‘(std::function<void(const geometry_msgs::Twist_<std::allocator<void> >&)>) (const boost::shared_ptr<const geometry_msgs::Twist_<std::allocator<void> > >&)’

Is it because the callback object can only be of boost::function type and not std::function type?

Reference:
node_handle.subscribe


问:
Query to highlight if a row is deleted from table
I need to create a report/alert that advises me if a row of data is removed. The data comes out of a case management system in a fixed format -

```<code>SELECT 70383 AS field_id
        , 'Demo_field' AS FieldName
        , '2022-12-05 11:41:49.753' AS AuditDateTime
        , 2 rnk
        UNION ALL
SELECT 70383 AS field_id
        , 'Demo_field' AS FieldName
        , '2022-12-04 11:41:49.753' AS AuditDateTime
        , 1 rnk
</code>```

This traces any changes in the field table which is a config table in the system - what happens is that a field (70383) is deleted from the system as it's obsolete, so I need to run a query that tells me this field existed yesterday but is no longer in the data today so i can update the ETL process. I cant do a row count as 1 field could be removed and 1 field added.

I've attempted a few variants using the rnk field and LAG and LEAD but can not seem to get the desired output (a field that advises the column has gone) . Please ask any questions if I haven't been clear

Body:
I need to create a report/alert that advises me if a row of data is removed. The data comes out of a case management system in a fixed format -

SELECT 70383 AS field_id
        , 'Demo_field' AS FieldName
        , '2022-12-05 11:41:49.753' AS AuditDateTime
        , 2 rnk
        UNION ALL
SELECT 70383 AS field_id
        , 'Demo_field' AS FieldName
        , '2022-12-04 11:41:49.753' AS AuditDateTime
        , 1 rnk

This traces any changes in the field table which is a config table in the system - what happens is that a field (70383) is deleted from the system as it's obsolete, so I need to run a query that tells me this field existed yesterday but is no longer in the data today so i can update the ETL process. I cant do a row count as 1 field could be removed and 1 field added.

I've attempted a few variants using the rnk field and LAG and LEAD but can not seem to get the desired output (a field that advises the column has gone) . Please ask any questions if I haven't been clear


问:
gitlab-runner kills the python script on ec2
I have setup a pipeline using gitlab-runner that executes on ec2, but while running the pipeline it kills the process and shows job failed. The function where my script gets killed is the section where I try to import 3 heavy csv files using the following code

```<code>self.input_data = pd.read_csv(self.input_file_name,
                                    encoding = 'ISO-8859-1',
                                    on_bad_lines='skip',
                                    low_memory=False,
                                    sep = '|')

</code>```

and then performing left join on the two csvs

following is the gitlab error I am getting.

```<code>bash: line 133:  1735 Killed                  python3 monitoring_framework.py
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit status 1
</code>```

How can I know what's causing the issue ?

Body:
I have setup a pipeline using gitlab-runner that executes on ec2, but while running the pipeline it kills the process and shows job failed. The function where my script gets killed is the section where I try to import 3 heavy csv files using the following code

self.input_data = pd.read_csv(self.input_file_name,
                                    encoding = 'ISO-8859-1',
                                    on_bad_lines='skip',
                                    low_memory=False,
                                    sep = '|')

and then performing left join on the two csvs

following is the gitlab error I am getting.

bash: line 133:  1735 Killed                  python3 monitoring_framework.py
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit status 1

How can I know what's causing the issue ?


问:
how to add dependency injection in webform
I try to use dependency injection for a base class from my webform, here is what I got that generates an error.

Baseclass

```<code>    public class BaseClass : System.Web.UI.Page
   {
    private readonly ILogService _logger;

    public BaseClass(ILogService logger)
    {
        _logger = logger;
    }
   }
</code>```

webform

```<code>    private readonly ILogService _logger;

    public Default(ILogService logger) : base(logger)
    {
        _logger = logger;
    }
</code>```

When running this I get "Default' does not contain a constructor that takes 0 arguments" If I add a new constructor in default.aspx page the error is gone, but then there is no dependency injection. How do I solve this?

Body:
I try to use dependency injection for a base class from my webform, here is what I got that generates an error.

Baseclass

    public class BaseClass : System.Web.UI.Page
   {
    private readonly ILogService _logger;

    public BaseClass(ILogService logger)
    {
        _logger = logger;
    }
   }

webform

    private readonly ILogService _logger;

    public Default(ILogService logger) : base(logger)
    {
        _logger = logger;
    }

When running this I get "Default' does not contain a constructor that takes 0 arguments" If I add a new constructor in default.aspx page the error is gone, but then there is no dependency injection. How do I solve this?


问:
How to understand the insights from number of jobs and DAG plotted for this DataFrame operations in spark
Below is the DataFrame operation I have written in pyspark interpreter

```<code>df = spark.createDataFrame([{"id":1,"name":"A"},{"id":2,"name":"B"}])
df.show()
</code>```

when I run the above operations it executes in below flow

```<code>[Stage 0:>                                                          (0 + 1) / 1]
[Stage 1:>                                                          (0 + 4) / 4]
[Stage 2:>                                                          (0 + 3) / 3]
</code>```

Below is the completed job list shown:

DAG shown for first job:

Please explain me how the number of jobs shown are 3 and how different operations like parallelize,mapPartitions,map gets added to DAG with just 2 operations done in dataframe

Body:
Below is the DataFrame operation I have written in pyspark interpreter

df = spark.createDataFrame([{"id":1,"name":"A"},{"id":2,"name":"B"}])
df.show()

when I run the above operations it executes in below flow

[Stage 0:>                                                          (0 + 1) / 1]
[Stage 1:>                                                          (0 + 4) / 4]
[Stage 2:>                                                          (0 + 3) / 3]

Below is the completed job list shown:

DAG shown for first job:

Please explain me how the number of jobs shown are 3 and how different operations like parallelize,mapPartitions,map gets added to DAG with just 2 operations done in dataframe


问:
How to format the cells in Excel using OpenXml
I am writing an excel using DocumentFormat.OpenXml.
I need the cell format as numeric with decimal places = 0, but the cell is still showing General even though I added the data type as Number.

```<code>foreach (String col in columns)
{
    DocumentFormat.OpenXml.Spreadsheet.Cell cell = new DocumentFormat.OpenXml.Spreadsheet.Cell();
    cell.DataType = DocumentFormat.OpenXml.Spreadsheet.CellValues.Number;
    cell.CellValue = new DocumentFormat.OpenXml.Spreadsheet.CellValue("1234");
    newRow.AppendChild(cell);
}
</code>```

Please let me know how to achieve the data type as number and decimal places is 0.

Body:
I am writing an excel using DocumentFormat.OpenXml.
I need the cell format as numeric with decimal places = 0, but the cell is still showing General even though I added the data type as Number.

foreach (String col in columns)
{
    DocumentFormat.OpenXml.Spreadsheet.Cell cell = new DocumentFormat.OpenXml.Spreadsheet.Cell();
    cell.DataType = DocumentFormat.OpenXml.Spreadsheet.CellValues.Number;
    cell.CellValue = new DocumentFormat.OpenXml.Spreadsheet.CellValue("1234");
    newRow.AppendChild(cell);
}

Please let me know how to achieve the data type as number and decimal places is 0.


问:
How to change a roblox gamepass's price programmatically?
I am trying to make a Discord bot that can change the price of a game pass to allow users to purchase perks on my server or specific services of their choosing by purchasing a game pass. But the problem is I don't know how. I have looked at the publishing docs but don't see anything related to game passes. I have also looked at the item config docs and again do not see anything documented on configuring a game passes price.</p>


问:
Could not resolve System.Data.SqlClient assembly in net6 application migrated from net fr 4.6
everybody.
I have next issue/problem. I have migrated my project (dll target, not exe) from netfr 4.6 to net6.
Everything looks fine, there are almost no code changes.
But when I try to use my built dll it could not resolve referenced assemblies: for now only System.Data.SqlClient, but further it may be more (I think).

Here is a message from the AssemblyResolve event handler:

And there is the exception:

Because my folder contains only third-party assemblies (DevExpress) and not SqlClient.dll.

I tried to put there assemblies from nuget packages folder, but there are many tens versions and result was always identical:

Other code (except SqlClient) works, net6 runtime is ok.

Net Framework 4.8 is installed too.

So maybe somebody faced with the same issue and knows how to handle this situation (references resolving).

Thanks in advice.


问:
Can not install web3 and web3 token
Can not install by poetry web3 and web3-token on python 3.10.5

```<code> • Installing parsimonious (0.8.1): Failed

  CalledProcessError

  Command '['/home/nurbek/work/poker/.venv/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--prefix', '/home/nurbek/work/poker/.venv', '--no-deps', '/home/nurbek/.cache/pypoetry/artifacts/26/43/fb/deea29c16409d307164e6cae9a1fea5a16ebeff4afeb66f9216671a05f/parsimonious-0.8.1.tar.gz']' returned non-zero exit status 1.

  at /usr/lib/python3.8/subprocess.py:516 in run
       512│             # We don't call process.wait() as .__exit__ does that for us.
       513│             raise
       514│         retcode = process.poll()
       515│         if check and retcode:
    →  516│             raise CalledProcessError(retcode, process.args,
       517│                                      output=stdout, stderr=stderr)
       518│     return CompletedProcess(process.args, retcode, stdout, stderr)
       519│
       520│

The following error occurred when trying to handle this error:

  EnvCommandError
</code>```

I have tried to use above version of python and lower version of python. Installing Cython and ctoolz, but it doesn't help.

Title: Can not install web3 and web3 token

Body:
Can not install by poetry web3 and web3-token on python 3.10.5

 • Installing parsimonious (0.8.1): Failed

  CalledProcessError

  Command '['/home/nurbek/work/poker/.venv/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--prefix', '/home/nurbek/work/poker/.venv', '--no-deps', '/home/nurbek/.cache/pypoetry/artifacts/26/43/fb/deea29c16409d307164e6cae9a1fea5a16ebeff4afeb66f9216671a05f/parsimonious-0.8.1.tar.gz']' returned non-zero exit status 1.

  at /usr/lib/python3.8/subprocess.py:516 in run
       512│             # We don't call process.wait() as .__exit__ does that for us.
       513│             raise
       514│         retcode = process.poll()
       515│         if check and retcode:
    →  516│             raise CalledProcessError(retcode, process.args,
       517│                                      output=stdout, stderr=stderr)
       518│     return CompletedProcess(process.args, retcode, stdout, stderr)
       519│
       520│

The following error occurred when trying to handle this error:

  EnvCommandError

I have tried to use above version of python and lower version of python. Installing Cython and ctoolz, but it doesn't help.


问:
Add EF Core 6 OPENJSON translation which passes the column name instead of string
I am working on a legacy project which uses SQL Server and stores JSON is some of the columns, which has been upgraded to EF Core 6.

My main issue is that I have an old query which probably ran client-side in previous versions, but now fails at runtime because EF Core 6 doesn't know how to translate it. It needs to use OPENJSON with JSON_VALUE to filter the items server side.

What I am querying is this Items table, which contains the Sections column, and this column contains a JSON array:

```<code>SELECT TOP 2 * FROM Items

Id    Value    Sections
1     100      '[{"SectionCode":"Code1","Info":"Something"}, {"SectionCode":"Code2","Info":"Something"}]'
2     100      '[{"SectionCode":"Code3","Info":"Something"}, {"SectionCode":"Code2","Info":"Something"}]'
</code>```

Item class is defined as follows:

```<code>public class Item
{
    public int Id { get; set; }
    public int Value { get; set; }
    public IEnumerable<Section> Sections { get; set; }
}

public class Section
{
    public string SectionCode { get; set; }
    public string Info { get; set; }
}
</code>```

To get all items with specific codes in SQL, we can use OPENJSON and JSON_VALUE:

```<code>SELECT * FROM Items
WHERE EXISTS
(
    SELECT 1
    FROM OPENJSON(Sections) AS [o]
    WHERE JSON_VALUE([o].[Value], '$.SectionCode') IN ('Code1', 'Code2')
)
</code>```

However I try the same in EF Core:

```<code>var items = Context.Items
    .Where(x => JsonExtensions
                    .OpenJson(nameof(x.Sections))
                    .Any(i => listOfCodes.Contains(JsonExtensions.JsonValue(i.Value, "$.SectionCode")))));
</code>```

and the OpenJson function is registered like this:

```<code>modelBuilder.HasDbFunction(() => JsonExtensions.OpenJson(default));

public class JsonExtensions
{
    [DbFunction("OPENJSON", Schema = "", IsBuiltIn = true)]
    public static IQueryable<JsonArrayItem> OpenJson(string source)
         => throw new NotSupportedException();
}

[Keyless]
public class JsonArrayItem
{
    public int Key { get; set; }
    public string Value { get; set; }
    public int Type { get; set; }
}
</code>```

then EF Core translates nameof(x.Sections) into a string literal and emits:

```<code>SELECT * FROM Items
WHERE EXISTS
(
    SELECT 1
    FROM OPENJSON('Sections') AS [o] -- this should be OPENJSON(Sections)
    WHERE JSON_VALUE([o].[Value], '$.SectionCode') IN ('Code1', 'Code2')
)
</code>```

I wanted to add a custom translation to JsonExtension.OpenJson so that it passes the value as a constant expression (I do the same thing for JsonValue), but if I try this:

```<code>modelBuilder
  .HasDbFunction(typeof(JsonExtensions).GetMethod(nameof(JsonExtensions.OpenJson)))
  .HasTranslation(args => new SqlFunctionExpression("OPENJSON", new[]
   {
     new SqlFragmentExpression((args[0] as SqlConstantExpression).Value as string)
   },
   true,
   new[] { true },
   typeof(string),
   null
  ))
  .HasParameter("column").Metadata.TypeMapping = stringTypeMapping;
</code>```

I get the following run-time exception while building the context:

System.InvalidOperationException: 'Cannot set custom translation on the DbFunction 'JsonExtensions.OpenJson' since it is not a scalar function.'

I believe if Sections was declared as a string in the Item class, it would work correctly, but the project is already at a pretty late stage at this point so I don't believe this can be changed.

Is there a way to get OPENJSON to translate the parameter as a column?

Body:
I am working on a legacy project which uses SQL Server and stores JSON is some of the columns, which has been upgraded to EF Core 6.

My main issue is that I have an old query which probably ran client-side in previous versions, but now fails at runtime because EF Core 6 doesn't know how to translate it. It needs to use OPENJSON with JSON_VALUE to filter the items server side.

What I am querying is this Items table, which contains the Sections column, and this column contains a JSON array:

SELECT TOP 2 * FROM Items

Id    Value    Sections
1     100      '[{"SectionCode":"Code1","Info":"Something"}, {"SectionCode":"Code2","Info":"Something"}]'
2     100      '[{"SectionCode":"Code3","Info":"Something"}, {"SectionCode":"Code2","Info":"Something"}]'

Item class is defined as follows:

public class Item
{
    public int Id { get; set; }
    public int Value { get; set; }
    public IEnumerable
 Sections { get; set; }
}

public class Section
{
    public string SectionCode { get; set; }
    public string Info { get; set; }
}

To get all items with specific codes in SQL, we can use OPENJSON and JSON_VALUE:

SELECT * FROM Items
WHERE EXISTS
(
    SELECT 1
    FROM OPENJSON(Sections) AS [o]
    WHERE JSON_VALUE([o].[Value], '$.SectionCode') IN ('Code1', 'Code2')
)

However I try the same in EF Core:

var items = Context.Items
    .Where(x => JsonExtensions
                    .OpenJson(nameof(x.Sections))
                    .Any(i => listOfCodes.Contains(JsonExtensions.JsonValue(i.Value, "$.SectionCode")))));

and the OpenJson function is registered like this:

modelBuilder.HasDbFunction(() => JsonExtensions.OpenJson(default));

public class JsonExtensions
{
    [DbFunction("OPENJSON", Schema = "", IsBuiltIn = true)]
    public static IQueryable<JsonArrayItem> OpenJson(string source)
         => throw new NotSupportedException();
}

[Keyless]
public class JsonArrayItem
{
    public int Key { get; set; }
    public string Value { get; set; }
    public int Type { get; set; }
}

then EF Core translates nameof(x.Sections) into a string literal and emits:

SELECT * FROM Items
WHERE EXISTS
(
    SELECT 1
    FROM OPENJSON('Sections') AS [o] -- this should be OPENJSON(Sections)
    WHERE JSON_VALUE([o].[Value], '$.SectionCode') IN ('Code1', 'Code2')
)

I wanted to add a custom translation to JsonExtension.OpenJson so that it passes the value as a constant expression (I do the same thing for JsonValue), but if I try this:

modelBuilder
  .HasDbFunction(typeof(JsonExtensions).GetMethod(nameof(JsonExtensions.OpenJson)))
  .HasTranslation(args => new SqlFunctionExpression("OPENJSON", new[]
   {
     new SqlFragmentExpression((args[0] as SqlConstantExpression).Value as string)
   },
   true,
   new[] { true },
   typeof(string),
   null
  ))
  .HasParameter("column").Metadata.TypeMapping = stringTypeMapping;

I get the following run-time exception while building the context:

System.InvalidOperationException: 'Cannot set custom translation on the DbFunction 'JsonExtensions.OpenJson' since it is not a scalar function.'

I believe if Sections was declared as a string in the Item class, it would work correctly, but the project is already at a pretty late stage at this point so I don't believe this can be changed.

Is there a way to get OPENJSON to translate the parameter as a column?


问:
Why is the Java version not updated in Android Studio still 1.8.0?
C:\development\flutter> java -version

java version "11.0.17" 2022-10-18 LTS

Java(TM) SE Runtime Environment 18.9 (build 11.0.17+10-LTS-269)

Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.17+10-LTS-269, mixed mode)

C:\development\flutter>javac -version

javac 11.0.17

C:\development\flutter>flutter doctor -v

[√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version
10.0.19043.2130], locale en-US)

• Flutter version 3.0.5 at C:\development\flutter

• Upstream repository https://github.com/flutter/flutter.git

• Framework revision f1875d570e (5 months ago), 2022-07-13 11:24:16 -0700

• Engine revision e85ea0e79c

• Dart version 2.17.6

• DevTools version 2.12.2

Checking Android licenses is taking an unexpectedly long time...
[√] Android toolchain - develop for Android devices (Android SDK version
33.0.0-rc1)

• Android SDK at C:\Users\USER\AppData\Local\Android\sdk

• Platform android-32, build-tools 33.0.0-rc1

• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java

• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

• All Android licenses accepted.

[√] Chrome - develop for the web

• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.

Download at https://visualstudio.microsoft.com/downloads/.

Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 4.0)

• Android Studio at C:\Program Files\Android\Android Studio

• Flutter plugin version 51.0.1

• Dart plugin version 193.7547

• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.73.1)

• VS Code at C:\Users\USER\AppData\Local\Programs\Microsoft VS Code

• Flutter extension version 3.54.0

[√] Connected device (3 available)

• Windows (desktop) • windows • windows-x64
  • Microsoft Windows [Version 10.0.19043.2130]

• Chrome (web)   • chrome  • web-javascript • Google Chrome 108.0.5359.73

• Edge (web)        • edge    • web-javascript • Microsoft Edge 107.0.1418.62

[√] HTTP Host Availability
• All required HTTP hosts are available

I changed JDK Location in android studio
JDK location: C:\Program Files\Java\jdk-11.0.17
but not updated


问:
Auth0-spa-js must run on a secure origin. How to work around for AWS initial deployment?
I have an angular app that I deployed to aws s3 with a Rest API gateway, all under the free tier. Now I'm seeing this error "auth0-spa-js must run on a secure origin See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information." when everything was working fine locally.

I know where this error is coming from. My site isn't secured and I'm accessing it in HTTP instead of HTTPS. I do plan on securing site. It's just that this is my initial deployment to validate everything was set up correctly. I don't have a domain setup yet.

All the guides and docs I'm reading are all either react.js based (they have the ability to do a HTTPS launch with a proxy or something), assume you are starting with a certificate already or assume you have a DNS setup so you can request a cert. But for my usecase I'm not certain. Is there a way for me to obtain a certificate for free while developing without a domain? What options do I have?

Thanks for the help?


问:
Cosmos DB SDK v3 Paginated entity querying crashes in app service with "PartitionKey has fewer components than defined the collection resource"
Ran into an issue while trying to retrieve entities from a cosmos db with the SDK v3. While running the code locally it works as expected; however it crashes in the app service. The database is not migrated so there is no PartitionKey installed.

Consider the following snippet:

```<code>var results = new List<AutomaticUpgradePlanificationDocument>();

var query = this.Container.GetItemLinqQueryable<AutomaticUpgradePlanificationDocument>(
       continuationToken: continuationToken,
       requestOptions: new QueryRequestOptions() { MaxItemCount = top.GetValueOrDefault(-1), PartitionKey = PartitionKey.None })
   .Where(predicate);

if (orderByExpression != null)
{
    if (isDescending.GetValueOrDefault())
    {
        query = query.OrderByDescending(orderByExpression);
    }
    else
    {
        query = query.OrderBy(orderByExpression);
    }
}

using (var iterator = query.ToFeedIterator())
{
    if (iterator.HasMoreResults)
    {
        var response = await iterator.ReadNextAsync(); //*** <- This line is the one that produces a fatal exception (when running from an app service, not locally)***
        results.AddRange(response.Resource);

        continuationToken = response.ContinuationToken;
    }
    else
    {
        continuationToken = null;
    }
}
</code>```

Note: the code is supposed to extract some entitites in a paginated format. Project running the snippet above is developed using the .Net Framework 4.7.2
Found a similar issue here: https://github.com/Azure/azure-cosmos-dotnet-v3/issues/2030 but the solutions proposed have no effect.

The exception is:
`

```<code>PartitionKey has fewer components than defined the collection resource.

   at Microsoft.Azure.Documents.Routing.PartitionKeyInternal.GetEffectivePartitionKeyString(PartitionKeyDefinition partitionKeyDefinition, Boolean strict)
   at Microsoft.Azure.Cosmos.Query.Core.ExecutionContext.CosmosQueryExecutionContextFactory.<TryCreateCoreContextAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Cosmos.Query.Core.AsyncLazy`1.<GetValueAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Cosmos.Query.Core.Pipeline.LazyQueryPipelineStage.<MoveNextAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Cosmos.Query.Core.Pipeline.NameCacheStaleRetryQueryPipelineStage.<MoveNextAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Cosmos.Query.Core.Pipeline.CatchAllQueryPipelineStage.<MoveNextAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception wa...
.....
...
..
</code>```

`

Body:
Ran into an issue while trying to retrieve entities from a cosmos db with the SDK v3. While running the code locally it works as expected; however it crashes in the app service. The database is not migrated so there is no PartitionKey installed.

Consider the following snippet:

var results = new List<AutomaticUpgradePlanificationDocument>();

var query = this.Container.GetItemLinqQueryable<AutomaticUpgradePlanificationDocument>(
       continuationToken: continuationToken,
       requestOptions: new QueryRequestOptions() { MaxItemCount = top.GetValueOrDefault(-1), PartitionKey = PartitionKey.None })
   .Where(predicate);

if (orderByExpression != null)
{
    if (isDescending.GetValueOrDefault())
    {
        query = query.OrderByDescending(orderByExpression);
    }
    else
    {
        query = query.OrderBy(orderByExpression);
    }
}

using (var iterator = query.ToFeedIterator())
{
    if (iterator.HasMoreResults)
    {
        var response = await iterator.ReadNextAsync(); //*** <- This line is the one that produces a fatal exception (when running from an app service, not locally)***
        results.AddRange(response.Resource);

        continuationToken = response.ContinuationToken;
    }
    else
    {
        continuationToken = null;
    }
}

Note: the code is supposed to extract some entitites in a paginated format. Project running the snippet above is developed using the .Net Framework 4.7.2
Found a similar issue here: https://github.com/Azure/azure-cosmos-dotnet-v3/issues/2030 but the solutions proposed have no effect.

The exception is:
`

PartitionKey has fewer components than defined the collection resource.

   at Microsoft.Azure.Documents.Routing.PartitionKeyInternal.GetEffectivePartitionKeyString(PartitionKeyDefinition partitionKeyDefinition, Boolean strict)
   at Microsoft.Azure.Cosmos.Query.Core.ExecutionContext.CosmosQueryExecutionContextFactory.<TryCreateCoreContextAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Cosmos.Query.Core.AsyncLazy`1.<GetValueAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Cosmos.Query.Core.Pipeline.LazyQueryPipelineStage.<MoveNextAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Cosmos.Query.Core.Pipeline.NameCacheStaleRetryQueryPipelineStage.<MoveNextAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Cosmos.Query.Core.Pipeline.CatchAllQueryPipelineStage.<MoveNextAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception wa...
.....
...
..

`