问:
bad operand type for unary -: 'WebElement'
I've got the following code that I'm running on spyder to extract comments by using chrome webdriver.
I am getting this error message:  bad operand type for unary -: 'WebElement'
Could you please help me to fix this problem?
Thanks in advance.

```<code>import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from sys import exit

def log(log_text):
    log_text = str(time.strftime("%Y.%m.%d %H:%M:%S")) + " ➾ " + log_text
    print(log_text)
    log_file = open("log.txt", "a", encoding='utf-8')
    log_file.write(log_text + "\n")
    log_file.close()

global_delay = 0.5
driver = webdriver.Chrome()
log('Bu program Can Tarafından Yapılmıştır.')
log('https://fastuptime.com ve https://speedsmm.com üzerinden bize ulaşabilirsiniz.')
log('Program başlatıldı')

urun_url =  input("Ürün Linki Sonuna / Koymayın: ") #'https://www.trendyol.com/trendypassion/sirt-pusula-baskili-tshirt-p-260271556'  Ürün URL NOT SONUNA / KOYMAYIN

try:
    driver.get(urun_url + "/yorumlar")
    time.sleep(5)
    kac_yorum_var = -driver.find_element(by=By.XPATH, value='/html/body/div[1]/div[3]/div/div/div[2]/div/div[2]/div[1]/div/div[2]/span[2]')
    kac_yorum_var = kac_yorum_var.replace(" Yorum", "")
    log('Toplam ' + kac_yorum_var + ' yorum var.')
    for i in range(int(kac_yorum_var)):
        try:
            yorum = driver.find_element_by_xpath('/html/body/div[1]/div[3]/div/div/div[2]/div/div[2]/div[3]/div[4]/div[' + str(i) + ']/div[1]/div/p').text
            log('Yorum: '+ yorum)
            yorum_file = open("yorumlar.txt", "a", encoding='utf-8')
            yorum_file.write(yorum + "\n")
            driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
            time.sleep(global_delay)
        except:
            continue
except Exception as e:
    log('Hata: ' + str(e))
    log('Program sonlandı')
    driver.quit()
    exit()
</code>```

I think I have to change something in the url link but I couldn't find an answer on here.

Body:
I've got the following code that I'm running on spyder to extract comments by using chrome webdriver.
I am getting this error message:  bad operand type for unary -: 'WebElement'
Could you please help me to fix this problem?
Thanks in advance.

import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from sys import exit

def log(log_text):
    log_text = str(time.strftime("%Y.%m.%d %H:%M:%S")) + " ➾ " + log_text
    print(log_text)
    log_file = open("log.txt", "a", encoding='utf-8')
    log_file.write(log_text + "\n")
    log_file.close()

global_delay = 0.5
driver = webdriver.Chrome()
log('Bu program Can Tarafından Yapılmıştır.')
log('https://fastuptime.com ve https://speedsmm.com üzerinden bize ulaşabilirsiniz.')
log('Program başlatıldı')

urun_url =  input("Ürün Linki Sonuna / Koymayın: ") #'https://www.trendyol.com/trendypassion/sirt-pusula-baskili-tshirt-p-260271556'  Ürün URL NOT SONUNA / KOYMAYIN

try:
    driver.get(urun_url + "/yorumlar")
    time.sleep(5)
    kac_yorum_var = -driver.find_element(by=By.XPATH, value='/html/body/div[1]/div[3]/div/div/div[2]/div/div[2]/div[1]/div/div[2]/span[2]')
    kac_yorum_var = kac_yorum_var.replace(" Yorum", "")
    log('Toplam ' + kac_yorum_var + ' yorum var.')
    for i in range(int(kac_yorum_var)):
        try:
            yorum = driver.find_element_by_xpath('/html/body/div[1]/div[3]/div/div/div[2]/div/div[2]/div[3]/div[4]/div[' + str(i) + ']/div[1]/div/p').text
            log('Yorum: '+ yorum)
            yorum_file = open("yorumlar.txt", "a", encoding='utf-8')
            yorum_file.write(yorum + "\n")
            driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
            time.sleep(global_delay)
        except:
            continue
except Exception as e:
    log('Hata: ' + str(e))
    log('Program sonlandı')
    driver.quit()
    exit()

I think I have to change something in the url link but I couldn't find an answer on here.


来源: stackexchange

问:
React Native Radio Button (radio-buttons-react-native)
I'm using react native radio-buttons-react-native package I need to reset the value of the radio button whenever my isFocused is false or when I navigate to any other page. I can't use any other package because it's restricted

How can I solve this issue??

`

```<code>            <RadioButtonRN
              data={[{ label: "Lead" }, { label: "Client" }]}
              selectedBtn={(e) => {
                setRadioValue(e.label);
                handleChange(e.label, "type", el.uniqueId, index);
              }}
              ref={radioBtnRef}
              style={{
                width: 70,
                height: 50,
                flexDirection: "row",
                justifyContent: "center",
                alignItems: "center",
                marginTop: -15,
              }}
              box={false}
              circleSize={10}
              activeColor={fontStyle.PRIMARY_COLOR}
              deactiveColor={"#000000"}
              textColor={"#000000"}
              textStyle={{
                fontSize: 11,
                textAlign: "center",
                fontFamily: fontStyle.FONT_FAMILY,
                color: fontStyle.COLOR_BLACK,
                fontWeight: "normal",
                marginLeft: 10,
              }}
              initial={1}
            />
</code>```

`

I'd use ref and try to recreate the obj whenever I navigate to other screen

```<code>  function clearData() {
    setRadioValue('');
   setTodayPlanData([
      {
        uniqueId: uuid.v4(),
        type: "",
        id: "",
        time: null,
        reason: "",
      },
    ]);
    clientRef.current[0].reset();
    reasonRef.current[0].reset();
  }
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I'm using react native radio-buttons-react-native package I need to reset the value of the radio button whenever my isFocused is false or when I navigate to any other page. I can't use any other package because it's restricted

How can I solve this issue??

`

            <RadioButtonRN
              data={[{ label: "Lead" }, { label: "Client" }]}
              selectedBtn={(e) => {
                setRadioValue(e.label);
                handleChange(e.label, "type", el.uniqueId, index);
              }}
              ref={radioBtnRef}
              style={{
                width: 70,
                height: 50,
                flexDirection: "row",
                justifyContent: "center",
                alignItems: "center",
                marginTop: -15,
              }}
              box={false}
              circleSize={10}
              activeColor={fontStyle.PRIMARY_COLOR}
              deactiveColor={"#000000"}
              textColor={"#000000"}
              textStyle={{
                fontSize: 11,
                textAlign: "center",
                fontFamily: fontStyle.FONT_FAMILY,
                color: fontStyle.COLOR_BLACK,
                fontWeight: "normal",
                marginLeft: 10,
              }}
              initial={1}
            />

`

I'd use ref and try to recreate the obj whenever I navigate to other screen

  function clearData() {
    setRadioValue('');
   setTodayPlanData([
      {
        uniqueId: uuid.v4(),
        type: "",
        id: "",
        time: null,
        reason: "",
      },
    ]);
    clientRef.current[0].reset();
    reasonRef.current[0].reset();
  }


问:
KeyError: 'scrollbar_color' when I tried to create a CTkScrollbar
When I create an instance of the CTkScrollbar class, from Custom Tkinter, it throw this error "KeyError: 'scrollbar_color'".

```<code> in __init__
    self._button_color = ThemeManager.theme["CTkScrollbar"]["scrollbar_color"] if button_color is None else self._check_color_type(button_color)
</code>```

My code :

```<code>listeSit = CTkFrame(self)
        self.list_element.append(listeSit)
        listeSit.place(relx = 0, rely = 0.60, anchor = W, relheight =0.79, relwidth = 0.79)
        canvas = Canvas(listeSit)
        self.list_element.append(canvas)
        canvas.pack(side=LEFT, fill=BOTH, expand=1)
        scroll = CTkScrollbar(listeSit, command=canvas.yview)
        self.list_element.append(scroll)
        scroll.pack(side=RIGHT, fill=Y)
        canvas.configure(yscrollcommand= scroll.set)
        canvas.bind('<Configure>', lambda e:canvas.configure(scrollregion= canvas.bbox("all")))

        real_frame = CTkFrame(canvas)

        canvas.create_window((0,0), window=real_frame, anchor= NW)
</code>```

I've tried to instancies my scrollbar linked to my canvas without parameters but when the function is launched, it throw an error.

Body:
When I create an instance of the CTkScrollbar class, from Custom Tkinter, it throw this error "KeyError: 'scrollbar_color'".

 in __init__
    self._button_color = ThemeManager.theme["CTkScrollbar"]["scrollbar_color"] if button_color is None else self._check_color_type(button_color)

My code :

listeSit = CTkFrame(self)
        self.list_element.append(listeSit)
        listeSit.place(relx = 0, rely = 0.60, anchor = W, relheight =0.79, relwidth = 0.79)
        canvas = Canvas(listeSit)
        self.list_element.append(canvas)
        canvas.pack(side=LEFT, fill=BOTH, expand=1)
        scroll = CTkScrollbar(listeSit, command=canvas.yview)
        self.list_element.append(scroll)
        scroll.pack(side=RIGHT, fill=Y)
        canvas.configure(yscrollcommand= scroll.set)
        canvas.bind('<Configure>', lambda e:canvas.configure(scrollregion= canvas.bbox("all")))

        real_frame = CTkFrame(canvas)

        canvas.create_window((0,0), window=real_frame, anchor= NW)

I've tried to instancies my scrollbar linked to my canvas without parameters but when the function is launched, it throw an error.


问:
stuck in "Error: number of cluster centres must lie between 1 and nrow(x)"

its a school assignment and I have no idea how to solve this, I've looked at tutorials and none of them seems to explain how to solve problems like these.

no_1.labels = no_1$Product
table(no_1.labels)
no_1.data <- no_1[2:3]

no_1.scale <- scale(no_1.data)
no_1.data <- dist(no_1.scale)

fviz_nbclust(no_1.scale, kmeans, method = "wss")`
```

I've only got this far before I got stuck, did I do something wrong somewhere?

Body:
its a school assignment and I have no idea how to solve this, I've looked at tutorials and none of them seems to explain how to solve problems like these.

no_1.labels = no_1$Product
table(no_1.labels)
no_1.data <- no_1[2:3]

no_1.scale <- scale(no_1.data)
no_1.data <- dist(no_1.scale)

fviz_nbclust(no_1.scale, kmeans, method = "wss")`

I've only got this far before I got stuck, did I do something wrong somewhere?


问:
Socket connection in Next.js and Flutter
I can't find a way to connect socket connection between next.js and Flutter.
Socket setup on next.js is alittle bit different to node.js/express. (socket server based on a route than port)(maybe I do not know how to build on port yet)

Tried: using muliple versions for server and clients( flutter x next.js).

Server itself is working, tested on next.js client to server.

So, how can we connect it? It'll be much appreciated if provides a link to research and learn. ( I already tried using different keywords and cant find one).


问:
In Edge Browser Session timeout or has not been Established
I am facing error

Edge Browser Session timeout or has not been Established

While other browser is working fine. How to resolve?

I have tried for Session management in servlet.

How to delete the cookies response while sending the Response.redirect("Test.jsp) from client side in jsp page?


问:
Multi-tenant users use STS to obtain credentials
SDK Version : AWS SDK in Go v2

I have 2 questions about SDK operation that was found a lot of documents but have no idea

1. Handle multiple credentials or clients cache in SDK

I know how to new a credential or client like this

```<code>ctx := context.TODO()
cfg, err := config.LoadDefaultConfig(ctx,
    config.WithRegion("us-east-1"),
)
if err != nil {
    log.Fatal(err)
}

roleARN , externalID := GetUserRoleFromDB(userID)

stsClient := sts.NewFromConfig(cfg)
provider := stscreds.NewAssumeRoleProvider(
    stsClient,
    roleARN,
    func(opts *stscreds.AssumeRoleOptions) {
        opts.ExternalID = aws.String(externalID)
        },
    )
cfg.Credentials = aws.NewCredentialsCache(provider)

creds, err := cfg.Credentials.Retrieve(context.Background())
if err != nil {
    log.Fatal(err)
}

s3Client := s3.NewFromConfig(cfg)
</code>```

But I need AssumeRole for every single user by STS so them can correct operate AWS service with credential and that will have many AWS service client with credential

I want to simplify the operation when initializing the credential or client to reduce the system and database load. Does the SDK support this operation?

If SDK does not support multiple credentials or client , I can do a memory cache for them

2. Simple check for credential expiration and assign new credential

I know how to retrieve credential like this

```<code>cred, err := cfg.Credentials.Retrieve(context.TODO())
if err != nil {
    log.Println(err)
}

if cred.Expired(){
    // That always return false
}
</code>```

But when calling credit.expired() that always return false because the API when credential expired then getting a new credential then check expiration

I need check the credential status and refresh for it , have any SDK operation could resolve them

I was found a lot of document but have no idea how to resolve problem

Body:
SDK Version : AWS SDK in Go v2

I have 2 questions about SDK operation that was found a lot of documents but have no idea

1. Handle multiple credentials or clients cache in SDK

I know how to new a credential or client like this

ctx := context.TODO()
cfg, err := config.LoadDefaultConfig(ctx,
    config.WithRegion("us-east-1"),
)
if err != nil {
    log.Fatal(err)
}

roleARN , externalID := GetUserRoleFromDB(userID)

stsClient := sts.NewFromConfig(cfg)
provider := stscreds.NewAssumeRoleProvider(
    stsClient,
    roleARN,
    func(opts *stscreds.AssumeRoleOptions) {
        opts.ExternalID = aws.String(externalID)
        },
    )
cfg.Credentials = aws.NewCredentialsCache(provider)

creds, err := cfg.Credentials.Retrieve(context.Background())
if err != nil {
    log.Fatal(err)
}

s3Client := s3.NewFromConfig(cfg)

But I need AssumeRole for every single user by STS so them can correct operate AWS service with credential and that will have many AWS service client with credential

I want to simplify the operation when initializing the credential or client to reduce the system and database load. Does the SDK support this operation?

If SDK does not support multiple credentials or client , I can do a memory cache for them

2. Simple check for credential expiration and assign new credential

I know how to retrieve credential like this

cred, err := cfg.Credentials.Retrieve(context.TODO())
if err != nil {
    log.Println(err)
}

if cred.Expired(){
    // That always return false
}

But when calling credit.expired() that always return false because the API when credential expired then getting a new credential then check expiration

I need check the credential status and refresh for it , have any SDK operation could resolve them

I was found a lot of document but have no idea how to resolve problem


问:
Taskflow API in google cloud composer
I am trying to upload a DAG defined with taskflow api on google cloud composer but no matter what I do, it doesn't show up in the DAGs list, neither in airflow UI or DAGs list provided by composer.

Another strange thing is that if I upload the file with errors, these show up in composer.

e.g. `

```<code>@dag(
    schedule=None,
    start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
    catchup=False,
    tags=["example"],
)
</code>```

`raises an error about 'schedule' not existing. After changing it to schedule_interval the error is not raised anymore.

I haven't found anything mentioning taskflow api wouldn't work on composer so far but this is my suspicion.

Also, running this on local docker compose setup works as expected.

So, could someone confirm if cloud composer doesn't work with taskflow api, or am I doing something wrong?

Title: Taskflow API in google cloud composer

Body:
I am trying to upload a DAG defined with taskflow api on google cloud composer but no matter what I do, it doesn't show up in the DAGs list, neither in airflow UI or DAGs list provided by composer.

Another strange thing is that if I upload the file with errors, these show up in composer.

e.g. `

@dag(
    schedule=None,
    start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
    catchup=False,
    tags=["example"],
)

`raises an error about 'schedule' not existing. After changing it to schedule_interval the error is not raised anymore.

I haven't found anything mentioning taskflow api wouldn't work on composer so far but this is my suspicion.

Also, running this on local docker compose setup works as expected.

So, could someone confirm if cloud composer doesn't work with taskflow api, or am I doing something wrong?


问:
How to query a related entity where the relationship is defined by a common set of secondary relations

Tables

```<code>KeyValue:
- id
- key
- value

TestEnvironment:
- id

TestEnvironmentProperties:
- test_env_id
- keyvalue_id

TestCommentary:
- id
- comment

TestCommentaryProperties:
- test_commentary_id
- keyvalue_id
</code>```

Example data

KeyValue

id
key
value

1
version
1.2.3

2
version
7.8.9

3
arch
x86

4
arch
amd64

TestEnvironment

id

1

2

3

TestEnvironmentProperties (association table)

test_env_id
keyvalue_id

1
1

1
3

2
1

2
4

3
2

3
4

TestCommentary

id
comment

1
"Known issue: We don't work on 64-bit"

2
"This version never worked, woops!"

TestCommentaryProperties (association table)

test_commentary_id
keyvalue_id

1
4

2
1

Explanation

TestEnvironment is many-to-many with KeyValue, and TestCommentary is also many-to-many with KeyValue.

A test environment is defined purely by the arbitrary key-values that are related to it. With the example data above, there are 3 test environments defined:

id
properties

1
version: 1.2.3; arch: x86

2
version: 1.2.3; arch: amd64

3
version: 7.8.9; arch: amd64

Test commentary is then defined in a similar manner, however the commentary about a test has its own set of key-values, as the commentary doesn't necessarily relate 1:1 with an exact test environment. Again with the example data above, the test commentary defined is:

id
commentary
properties

1
"Known issue: We don't work on 64-bit"
arch: amd64

2
"This version never worked, woops!"
version: 1.2.3

Conceptually, a TestCommentary is related to a TestEnvironment if the key-values attached to the TestCommentary is a sub-set of the key-values attached to the TestEnvironment.

For example if querying the comments related to each of the test environments, I'd get the following results:

TestEnvironment.id = 1

environment_id
commentary_id
comment

1
2
"This version never worked, woops!"

TestEnvironment.id = 2

environment_id
commentary_id
comment

2
1
"Known issue: We don't work on 64-bit"

2
2
"This version never worked, woops!"

TestEnvironment.id = 3

environment_id
commentary_id
comment

3
1
"Known issue: We don't work on 64-bit"

Question

How do I construct a single query to selects the TestCommentary relating to a TestEnvironment without needing to dynamically create a query? I would like to be able to select with knowing only the TestEnvironment id.

Body:
Tables

KeyValue:
- id
- key
- value

TestEnvironment:
- id

TestEnvironmentProperties:
- test_env_id
- keyvalue_id

TestCommentary:
- id
- comment

TestCommentaryProperties:
- test_commentary_id
- keyvalue_id

Example data

KeyValue

id
key
value

1
version
1.2.3

2
version
7.8.9

3
arch
x86

4
arch
amd64

TestEnvironment

id

1

2

3

TestEnvironmentProperties (association table)

test_env_id
keyvalue_id

1
1

1
3

2
1

2
4

3
2

3
4

TestCommentary

id
comment

1
"Known issue: We don't work on 64-bit"

2
"This version never worked, woops!"

TestCommentaryProperties (association table)

test_commentary_id
keyvalue_id

1
4

2
1

Explanation

TestEnvironment is many-to-many with KeyValue, and TestCommentary is also many-to-many with KeyValue.

A test environment is defined purely by the arbitrary key-values that are related to it. With the example data above, there are 3 test environments defined:

id
properties

1
version: 1.2.3; arch: x86

2
version: 1.2.3; arch: amd64

3
version: 7.8.9; arch: amd64

Test commentary is then defined in a similar manner, however the commentary about a test has its own set of key-values, as the commentary doesn't necessarily relate 1:1 with an exact test environment. Again with the example data above, the test commentary defined is:

id
commentary
properties

1
"Known issue: We don't work on 64-bit"
arch: amd64

2
"This version never worked, woops!"
version: 1.2.3

Conceptually, a TestCommentary is related to a TestEnvironment if the key-values attached to the TestCommentary is a sub-set of the key-values attached to the TestEnvironment.

For example if querying the comments related to each of the test environments, I'd get the following results:

TestEnvironment.id = 1

environment_id
commentary_id
comment

1
2
"This version never worked, woops!"

TestEnvironment.id = 2

environment_id
commentary_id
comment

2
1
"Known issue: We don't work on 64-bit"

2
2
"This version never worked, woops!"

TestEnvironment.id = 3

environment_id
commentary_id
comment

3
1
"Known issue: We don't work on 64-bit"

Question

How do I construct a single query to selects the TestCommentary relating to a TestEnvironment without needing to dynamically create a query? I would like to be able to select with knowing only the TestEnvironment id.


问:
Text to speech does'nt work with longer text in react
The text to speech was perfectly working on desktop but not on mobile. Later on i realised that when i am adding more content it doesn't read the content. In some phones it reads and stops after a while and in some phones it never reads the content but when i add small sentence then it will read on all supported devices.

I have tried many providers, react-speech-kit, speak-tts, talkify-tts and also the window api which has inbuilt support for voice synthesis but there is no issue with the packages. The issue is with the text to speech functionality which doesnt work properly with the devices as well as with the browsers.

Can someone help me with this issue? Need a text to speech reader which can read huge amount of string.


问:
Tomcat unable to run (.war) in Elasticsearch
I'm working on a legacy system using Tomcat 6.0 and Elasticsearch 1.3.2 , with Win Server 2019 OS

In CMD, with Tomcat services in a "Stopped" state, I have run the following batch file:

C:\Program Files\elasticsearch-1.3.2\bin>elasticsearch.bat

```<code>`[DATE][INFO ][node                     ] [AAA] version[1.3.2], pid[6692], build[dee175d/2014-08-13T14:29:30Z]
[DATE][INFO ][node                     ] [AAA] initializing ...
[DATE][INFO ][plugins                  ] [AAA] loaded [], sites [head]
[DATE][INFO ][node                     ] [AAA] initialized
[DATE][INFO ][node                     ] [AAA] starting ...
[DATE][INFO ][transport                ] [AAA] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/xx.xx.xx.xx:9300]}
[DATE][INFO ][discovery                ] [AAA] Cluster/qgLsBRQITv-Fi30GYcTcvg
[DATE][INFO ][cluster.service          ] [AAA] new_master [AAA][qgLsBRQITv-Fi30GYcTcvg][WINSERVER][inet[/xx.xx.xx.xx:9300]], reason: zen-disco-join (elected_as_master)
[DATE][INFO ][gateway                  ] [AAA] recovered [0] indices into cluster_state
[DATE][INFO ][http                     ] [AAA] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/xx.xx.xx.xx:9200]}
[DATE][INFO ][node                     ] [AAA] started`
</code>```

Supposingly, if I started the Tomcat service at this point, it will trigger the "webapps.war" file in the Tomcat > webapps folder, and mappings will be loaded in elasticsearch in the CMD windows.

However, it did not happen for my scenario. Nothing happened in the CMD windows. The last line remain as: [DATE][INFO ][node                     ] [AAA] started

Looking forward to some expert to shine me some light.

Much appreciated.

Body:
I'm working on a legacy system using Tomcat 6.0 and Elasticsearch 1.3.2 , with Win Server 2019 OS

In CMD, with Tomcat services in a "Stopped" state, I have run the following batch file:

C:\Program Files\elasticsearch-1.3.2\bin>elasticsearch.bat

`[DATE][INFO ][node                     ] [AAA] version[1.3.2], pid[6692], build[dee175d/2014-08-13T14:29:30Z]
[DATE][INFO ][node                     ] [AAA] initializing ...
[DATE][INFO ][plugins                  ] [AAA] loaded [], sites [head]
[DATE][INFO ][node                     ] [AAA] initialized
[DATE][INFO ][node                     ] [AAA] starting ...
[DATE][INFO ][transport                ] [AAA] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/xx.xx.xx.xx:9300]}
[DATE][INFO ][discovery                ] [AAA] Cluster/qgLsBRQITv-Fi30GYcTcvg
[DATE][INFO ][cluster.service          ] [AAA] new_master [AAA][qgLsBRQITv-Fi30GYcTcvg][WINSERVER][inet[/xx.xx.xx.xx:9300]], reason: zen-disco-join (elected_as_master)
[DATE][INFO ][gateway                  ] [AAA] recovered [0] indices into cluster_state
[DATE][INFO ][http                     ] [AAA] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/xx.xx.xx.xx:9200]}
[DATE][INFO ][node                     ] [AAA] started`

Supposingly, if I started the Tomcat service at this point, it will trigger the "webapps.war" file in the Tomcat > webapps folder, and mappings will be loaded in elasticsearch in the CMD windows.

However, it did not happen for my scenario. Nothing happened in the CMD windows. The last line remain as: [DATE][INFO ][node                     ] [AAA] started

Looking forward to some expert to shine me some light.

Much appreciated.


问:
How to achieve fork functionality using jgit library?
JGit provides many porcelain commands for create/delete repository, create/delete branch, create/delete tag, etc.

Is there a way to achieve fork functionality using these jgit commands ?

Please share sample code if there is a possibility.

@TonnyCheng has also created a similar issue in jgit cook-book.

Thanks.


问:
NULL coalescing operator when used with an array
After having searched a bit, and read up on PHP operator precedence, I am still stumped with the following bit of code. (Runnning on PHP 8.1)

```<code>$data = array('key' => 'value');

if ($data['key'] ?? '' === returnString()) {
  echo $data['key'].' === '.returnString().PHP_EOL;
}
else {
  echo $data['key'].' !== '.returnString().PHP_EOL;
}

function returnString() : string {
  return 'string';
}
</code>```

When you run this, you get the following output:

value === string

No matter the associativity of the left hand argument to the ===, neither 'value' nor '' equals 'string', and if the ?? should evaluate to a bool, the === check should fail as well, so I don't understand how it ends up evaluating to true.

If I wrap the ?? expression in parentheses, like if (($data['key'] ?? '') === returnString()) { the expression evaluates as expected.

Is this an error in PHP, or is there some explanation I have just missed?

I expected the code to output value !== string

Body:
After having searched a bit, and read up on PHP operator precedence, I am still stumped with the following bit of code. (Runnning on PHP 8.1)

$data = array('key' => 'value');

if ($data['key'] ?? '' === returnString()) {
  echo $data['key'].' === '.returnString().PHP_EOL;
}
else {
  echo $data['key'].' !== '.returnString().PHP_EOL;
}

function returnString() : string {
  return 'string';
}

When you run this, you get the following output:

value === string

No matter the associativity of the left hand argument to the ===, neither 'value' nor '' equals 'string', and if the ?? should evaluate to a bool, the === check should fail as well, so I don't understand how it ends up evaluating to true.

If I wrap the ?? expression in parentheses, like if (($data['key'] ?? '') === returnString()) { the expression evaluates as expected.

Is this an error in PHP, or is there some explanation I have just missed?

I expected the code to output value !== string


问:
KonvaJS: Move offset without moving existing shape?
I would like to be able to change the offset position while keeping the object otherwise in the same spot visually.

What is the best way to do this?

Illustration:

An example from an image editing program, where the offset position is movable without moving the shape's position.

Failed Attempt:

I have noticed that a simple strategy of modifying the offsetX/offsetY at the same time as x/y does not work in the case of there being a rotation involved.  ex:

// (This is on a custom class that extends Konva.Group)
public MoveOffset(x: number, y: number)
{
    this.offsetX(this.offsetX() - x);
    this.offsetY(this.offsetY() - y);

    this.x(this.x() + x);
    this.y(this.y() + y);
    this.UpdateOriginArrow();
}
```

I believe this is because Konva applies translation(x, y), then rotation, then skew, then scale, then translation (offsetX, offsetY).  So I need some way of figuring out the offset translation when rotation is involved.

Body:
I would like to be able to change the offset position while keeping the object otherwise in the same spot visually.

What is the best way to do this?

Illustration:

An example from an image editing program, where the offset position is movable without moving the shape's position.

Failed Attempt:

I have noticed that a simple strategy of modifying the offsetX/offsetY at the same time as x/y does not work in the case of there being a rotation involved.  ex:

// (This is on a custom class that extends Konva.Group)
public MoveOffset(x: number, y: number)
{
    this.offsetX(this.offsetX() - x);
    this.offsetY(this.offsetY() - y);

    this.x(this.x() + x);
    this.y(this.y() + y);
    this.UpdateOriginArrow();
}

I believe this is because Konva applies translation(x, y), then rotation, then skew, then scale, then translation (offsetX, offsetY).  So I need some way of figuring out the offset translation when rotation is involved.


问:
Create a Gesture Detector that redirect to a certain widget Flutter
I wanted to create a specific section for my mobile app (Called POW section), and I want to also create a floatingButton that will redirect user to POW section when tapped.

The section is still in the same page as the floating button. So if user scroll too much and cover the pow section this button will appear and when it tapped the screen will be scrolled until the pow Section is shown again.

How to achieve this ? Thanks before.


问:
Tomcat does not load changed frontend resources (angular)
I am working on a web application with a Java-Backend and an Angular 14-Frontend. Each part is a macven project, the angular frontend is being build with the maven-frontend-plugin and then copied into the webapps-folder via maven-copy-resources.

For frontend-development purposes I created a node-copy-script which first builds the angular project and then copies the content of the angular projects' dist-folder into the target/webapps folder. For some reason the tomcat does not see the changes and still loads the old frontend resources. I added antiResourceLocking="false" to the context.xml to try to disable resource-caching, but it did not help. Any ideas?


问:
Refreshing PivotTable with Power Query source by Excel COM model in windows service
we have application using Excel COM to refresh pivot tables and we have problem with Power Query source and running this app from windows service.

PQ using windows auth refresh ends with permission error (user is not permitted to access olap db) and PQ using sql and user/password simply refreshes nothing, no error, no refresh.
When this app is running out of service from CMD, all  works fine. Windows Service uses my AD account
so I cannot find any difference (except its from service )

I tried use different PT refresh methods, dcom settings (that's interesting, when I set my account as run indentity, PT refresh starts working from service but excel running from desktop dies on OLE not available)

Any help ? Thanks very much

PS: probably doublehop issue


问:
Minimum edit distance of two documents
I know how to get the minimum edit distance of two short strings like 'abcde' and 'abfde',but how to do the MED of two documents or essays with spaces , tabs , enters or even two codes?

For example:

text1:
The computer learns from a huge database of four million videos from volunteers and paid-for market
researchers in various emotional states and the algorithms are constantly updated and tested against real-world
scenarios.
The next stage is to integrate voice analysis and other measures of physical wellbeing such as heart rate and
hand gestures.

and

text2:A computer model has been developed that can predict what word you are thinking of. The model may help to
resolve questions about how the brain processes words and language, and might even lead to techniques for
decoding people’s thoughts.

Researchers led by Tom Mitchell of Carnegie Mellon University in Pittsburgh, Pennsylvania, 'trained' a computer
model to recognize the patterns of brain activity associated with 60 images, each of which represented a
different noun, such as 'celery' or 'aeroplane'.

This is the code I wrote of finding the MED of two strings within 20 characters.

`

```<code>int med_lev(char S[], char T[]) {
    int dis_lev[20][20];
    int n = strlen(S);
    int m = strlen(T);

    for (int i = 0; i <= n; i++) {
        dis_lev[i][0] = i;
    }
    for (int j = 0; j <= m; j++) {
        dis_lev[0][j] = j;
    }
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            if (S[i - 1] == T[j - 1]) {
                dis_lev[i][j] = dis_lev[i - 1][j - 1];
            }
            else {
                dis_lev[i][j] = min(dis_lev[i - 1][j - 1] + 2, min(dis_lev[i - 1][j] + 1, dis_lev[i][j - 1] + 1));
            }
        }
    }
    return dis_lev[n][m];
}
</code>```

`

I've thought out a method that is delete all spaces , tabs , enters and put every word in a single string but the problem is the string might be too long. Is there a better way?

Title: Minimum edit distance of two documents

Body:
I know how to get the minimum edit distance of two short strings like 'abcde' and 'abfde',but how to do the MED of two documents or essays with spaces , tabs , enters or even two codes?

For example:

text1:
The computer learns from a huge database of four million videos from volunteers and paid-for market
researchers in various emotional states and the algorithms are constantly updated and tested against real-world
scenarios.
The next stage is to integrate voice analysis and other measures of physical wellbeing such as heart rate and
hand gestures.

and

text2:A computer model has been developed that can predict what word you are thinking of. The model may help to
resolve questions about how the brain processes words and language, and might even lead to techniques for
decoding people’s thoughts.

Researchers led by Tom Mitchell of Carnegie Mellon University in Pittsburgh, Pennsylvania, 'trained' a computer
model to recognize the patterns of brain activity associated with 60 images, each of which represented a
different noun, such as 'celery' or 'aeroplane'.

This is the code I wrote of finding the MED of two strings within 20 characters.

`

int med_lev(char S[], char T[]) {
    int dis_lev[20][20];
    int n = strlen(S);
    int m = strlen(T);

    for (int i = 0; i <= n; i++) {
        dis_lev[i][0] = i;
    }
    for (int j = 0; j <= m; j++) {
        dis_lev[0][j] = j;
    }
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            if (S[i - 1] == T[j - 1]) {
                dis_lev[i][j] = dis_lev[i - 1][j - 1];
            }
            else {
                dis_lev[i][j] = min(dis_lev[i - 1][j - 1] + 2, min(dis_lev[i - 1][j] + 1, dis_lev[i][j - 1] + 1));
            }
        }
    }
    return dis_lev[n][m];
}

`

I've thought out a method that is delete all spaces , tabs , enters and put every word in a single string but the problem is the string might be too long. Is there a better way?


问:
Create metric grouping by path parameter in datadog
Is it possible to create a metric from an endpoint in datadog and group by a path variable? For example, given /animals/_animalName, I'd like to sum by _animalName and have a graph with as many lines or stacked bars as values in that variable. The idea is to be able to automatically extract values from the usage of that endpoint, instead of having to explicitly create metrics from code with tags and add the values to them. Something like this below (the graph type is irrelevant, but I'd like to be able to extract those values).

I read this where the original poster mentions that there is a way but I’m not able to do it myself. Thanks!


问:
How to handle key pressed with TinyMCE or CKEditor using React
I need to use one of the editors TinyMCE or CKEditor in my Typescript application.
But I need to be able to tarp keys like enter and F10.

Any one knows how to find the key pressed without onBlur or onChange?

Any other rich text editor?

Thanks


问:
Setting PyTorch to `train` or `eval` modes globally instead of at nn.Module level
At PyTorch model that inherit from torch.nn.Module can be set to train or eval modes using model.train() or model.eval().
Is there a way to do this globally for the present PyTorch session, so that it applies to any op that is invoked, without having to update different models?

This could be useful in running PyTorch scripts in training or inference context as desired.


问:
How to resolve an IP on a VM that is running on google cloud and Domain is on AWS
I have a VM hosted on google running a wordpress website and the domain I own is on AWS. I purchased this domain on AWS a while back so it is under AWS ownership. I was wondering if there is a way to have the DNS resolve to my website that is on Google cloud.

I have tried using each cloud providers name servers on each cloud but that hasn't worked. Is there anything i can do with SOA.


问:
im trying to make a chat where it shows the username who send the message so people can see who send it
im trying to make a chat where people can see the username of the people who send the message but im trying to make a join between my auth_db and my chat_db but i keep getting the error

Fatal error: Uncaught mysqli_sql_exception: Table 'chat_db.chat_db'
doesn't exist in C:\xampp\htdocs\SpookyCatChat\chat\page1.php:46 Stack
trace: #0 C:\xampp\htdocs\SpookyCatChat\chat\page1.php(46):
mysqli->query('SELECT Message,...') #1 {main} thrown in
C:\xampp\htdocs\SpookyCatChat\chat\page1.php on line 46

Chat DB

Auth DB

and this is the code im trying to do the join on

```<code><?php
session_start();

if (isset($_SESSION['id']) && isset($_SESSION['fname'])) {
    include "../pages/db_conn.php";
    include '../php/User.php';
    $user = getUserById($_SESSION['id'], $conn);
}
?>
<?php

$sName = "localhost";
$uName = "root";
$pass = "";
$db_name = "chat_db";

$conn = new mysqli($sName, $uName, $pass, $db_name);

if ($conn->connect_error) {
    die("connection failed: " . $conn->connect_error);
}

$sql = "SELECT Message, auth_db.username
        FROM chat_db
        LEFT JOIN auth_db ON auth_db.username = chat_db.id
        ORDER BY chat_db.id DESC LIMIT 5";

var_dump($sql);

$result = $conn->query($sql);
if ($result && $result->num_rows > 0) {
    while($row = $result->fetch_assoc()){
        echo $users['fname'] . ": " . $row['Message'] . "<br><br>";
    }
} else {
    echo "no messages have been exchanged yet";
}

$conn->close();
?>
</code>```

Body:
im trying to make a chat where people can see the username of the people who send the message but im trying to make a join between my auth_db and my chat_db but i keep getting the error

Fatal error: Uncaught mysqli_sql_exception: Table 'chat_db.chat_db'
doesn't exist in C:\xampp\htdocs\SpookyCatChat\chat\page1.php:46 Stack
trace: #0 C:\xampp\htdocs\SpookyCatChat\chat\page1.php(46):
mysqli->query('SELECT Message,...') #1 {main} thrown in
C:\xampp\htdocs\SpookyCatChat\chat\page1.php on line 46

Chat DB

Auth DB

and this is the code im trying to do the join on

<?php
session_start();

if (isset($_SESSION['id']) && isset($_SESSION['fname'])) {
    include "../pages/db_conn.php";
    include '../php/User.php';
    $user = getUserById($_SESSION['id'], $conn);
}
?>
<?php

$sName = "localhost";
$uName = "root";
$pass = "";
$db_name = "chat_db";

$conn = new mysqli($sName, $uName, $pass, $db_name);

if ($conn->connect_error) {
    die("connection failed: " . $conn->connect_error);
}

$sql = "SELECT Message, auth_db.username
        FROM chat_db
        LEFT JOIN auth_db ON auth_db.username = chat_db.id
        ORDER BY chat_db.id DESC LIMIT 5";

var_dump($sql);

$result = $conn->query($sql);
if ($result && $result->num_rows > 0) {
    while($row = $result->fetch_assoc()){
        echo $users['fname'] . ": " . $row['Message'] . "

";
    }
} else {
    echo "no messages have been exchanged yet";
}

$conn->close();
?>


问:
When using dynamic cast to do upcast, it is a kind of run-time or compile-time process?
I'm currently trying to figure out the performance of dynamic cast.

I know dynamic cast need inheritance relationship between two classes and need virtual function(need RTTI).

So it means I know use dynamic cast to do downcast is a run-time process because need to check RTTI info.

So what about upcast? It has same function with static cast. But I want to know if use dynamic cast to do some upcast, it will be a run-time process or compile-time process?


问:
what happens when you do not clear interval in the setInterval method of javascript
I am trying to add a click on a button through the console i am using setInterval here if I clear the interval button it working first time only so I tried not clearing the interval it's working but will it affect the page.

```<code>var chatInterval=setInterval(()=>{
    if( document.getElementById('chat-widget-minimized')){

         clearInterval(chatInterval);

        var frame = document.getElementById('chat-widget-minimized');
        var c = frame.contentDocument || frame.contentWindow.document;

        c.querySelectorAll('button[aria-label="Open LiveChat chat widget"]')[0].onclick=function(){
           _satellite.track('Chat_Click');
        }

    }
},200)
</code>```

actually, the button is removing and appending again  its not stable that's why set interval is used

var chatInterval=setInterval(()=>{
    if( document.getElementById('chat-widget-minimized')){

         //clearInterval(chatInterval); with out clear interval

        var frame = document.getElementById('chat-widget-minimized');
        var c = frame.contentDocument || frame.contentWindow.document;

        c.querySelectorAll('button[aria-label="Open LiveChat chat widget"]')[0].onclick=function(){
           _satellite.track('Chat_Click');
        }

    }
},200)```

Body:
I am trying to add a click on a button through the console i am using setInterval here if I clear the interval button it working first time only so I tried not clearing the interval it's working but will it affect the page.

var chatInterval=setInterval(()=>{
    if( document.getElementById('chat-widget-minimized')){

         clearInterval(chatInterval);

        var frame = document.getElementById('chat-widget-minimized');
        var c = frame.contentDocument || frame.contentWindow.document;

        c.querySelectorAll('button[aria-label="Open LiveChat chat widget"]')[0].onclick=function(){
           _satellite.track('Chat_Click');
        }

    }
},200)

actually, the button is removing and appending again  its not stable that's why set interval is used

var chatInterval=setInterval(()=>{
    if( document.getElementById('chat-widget-minimized')){

         //clearInterval(chatInterval); with out clear interval

        var frame = document.getElementById('chat-widget-minimized');
        var c = frame.contentDocument || frame.contentWindow.document;

        c.querySelectorAll('button[aria-label="Open LiveChat chat widget"]')[0].onclick=function(){
           _satellite.track('Chat_Click');
        }

    }
},200)


问:
Get total pages and current page of epub on Android - using Readium
I use readium to stream Epubs and show in my Android application. It streams one chapter at a time so you can't access the whole book at a particular time. I wonder if Readium api or any other solution for showing epubs on Android provide ways to get total page count and current page no?</p>


问:
Compiled with problems:X ERROR in ./node_modules/react-fishbone-chart/build/index.js Module not found: Error: Cannot find file: 'FishboneChart.js'
Compiled with problems:

```<code>X  ERROR in ./node_modules/react-fishbone-chart/build/index.js 3:21-71  Module not found: Error: Cannot find file: 'FishboneChart.js' does not match the corresponding name on disk: '.\node_modules\react-fishbone-chart\build\component\FishboneChart\FishBoneChart.js'
</code>```

I already installed react-fishbone-chart package kindly guide.

```<code>import React from 'react';
import {FishboneChart} from 'react-fishbone-chart'

const initData = {
  data: ['a','b','c','d','e','f','g','h','k'],
  speed: 28,
}

const App = () => {
  return (
    <div style={{width:"600px", height:"600px"}}>
      <FishboneChart option={initData}/>
    </div>
  );
};

export default App;
</code>```

Kindly help me out for resolving this error

Body:
Compiled with problems:

X  ERROR in ./node_modules/react-fishbone-chart/build/index.js 3:21-71  Module not found: Error: Cannot find file: 'FishboneChart.js' does not match the corresponding name on disk: '.\node_modules\react-fishbone-chart\build\component\FishboneChart\FishBoneChart.js'

I already installed react-fishbone-chart package kindly guide.

import React from 'react';
import {FishboneChart} from 'react-fishbone-chart'

const initData = {
  data: ['a','b','c','d','e','f','g','h','k'],
  speed: 28,
}

const App = () => {
  return (

      <FishboneChart option={initData}/>

  );
};

export default App;

Kindly help me out for resolving this error


问:
How to create a CSS grid with 3 columns having column flow?
I want a grid layout with unlimited number of elements in 3 columns, and as many rows are needed, like so:

```<code>[1] [5] [9]
[2] [6] [10]
[3] [7] [11]
[4] [8]
</code>```

I can accomplish it using JavaScript, but I would like to know the way to do it only with CSS.

My CSS is:

```<code>.parent-div {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-flow: column;
}
</code>```

However with above CSS, I get:

```<code>[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]
</code>```

I would appreciate any help

Body:
I want a grid layout with unlimited number of elements in 3 columns, and as many rows are needed, like so:

[1] [5] [9]
[2] [6] [10]
[3] [7] [11]
[4] [8]

I can accomplish it using JavaScript, but I would like to know the way to do it only with CSS.

My CSS is:

.parent-div {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-flow: column;
}

However with above CSS, I get:

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

I would appreciate any help


问:
How do I correctly define rewrite rule?
I have a docker with a lizmap that respond in local to the address http://192.168.1.85:8090
I have a nginx that proxy https://geoservizi.pippoepluto.net/ to previous internal url.

I would like to modify https://geoservizi.pippoepluto.net/ -> https://geoservizi.pippoepluto.net/webgis and proxy always to http://192.168.1.85:8090

The problem is that I have to add /webgis/ to all urls to local machine and I do not find the way...

Thanks in advance..

My vhost block:

```<code>location / {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_pass http://192.168.1.85:8090;
}
</code>```

Title: How do I correctly define rewrite rule?

Body:
I have a docker with a lizmap that respond in local to the address http://192.168.1.85:8090
I have a nginx that proxy https://geoservizi.pippoepluto.net/ to previous internal url.

I would like to modify https://geoservizi.pippoepluto.net/ -> https://geoservizi.pippoepluto.net/webgis and proxy always to http://192.168.1.85:8090

The problem is that I have to add /webgis/ to all urls to local machine and I do not find the way...

Thanks in advance..

My vhost block:

location / {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_pass http://192.168.1.85:8090;
}


问:
Next js ignore api related files while build
When I am building a project in next js with next build command. I want to exclude the files for the apis in pages/api folder when building. How can I achieve that?


问:
Wpf multiple windows
Good morning,
I am working on a messaging application that when a message is received by the client will show the said message on the user's desktop (TCPIP Client / Server). When a message is sent the width and height of the message can be changed as such you could end up with 1 or more messages on your desktop with varying heights and widths.

The solution I currently have for the client is using an itemscontrol and datatemplate via MVVM and a collection of said messages however I have run into an issue with backgrounds and transparency.

The customer wants the messages to not display during teams calls and this has been achieved using SetWindowDisplayAffinity without issues however for that to work you have to turn off transparency on the windows which has led to the issue I have with the current solution.

As you can see in this you end up with a white box on the first message sent as the underlying control has resized to accommodate the larger message which followed.

Does anyone know of a way around this or know of another method which could perform the same function? Currently, I am testing a method of opening a new window with each message which works fine however I then run into the huge piece of work around window positioning on the screen!

Title: Wpf multiple windows


问:
Avoid future any on Typescript
We have a project with a lot of any type and we decide to clean them all, but for this we need to avoid the use of it by other devs...

Is there any way to block the compilation of Typescript if it found a "recent" any but not a "past" any?

Thank you!

I tried noImplicitAny option, but it blocks all any future and past...

Title: Avoid future any on Typescript


问:
Unable to bind the value in child component
I'm having this array in Parent component

```<code>serverElements = [{ type: 'server', name: 'sid', content: 'sid 1' }];
</code>```

Which I'm passing to child component

```<code><div class="row">
  <app-server-element *ngFor="let element of serverElements" [element]="serverElements">
    </app-server-element>
</div>
</code>```

And this is my child component HTML

```<code><div class="col-xs-12">
    <div class="panel panel-default">
        <div class="panel-heading">{{ element.name }}</div>
        <div class="panel-body">
            <p>
                <strong *ngIf="element.type === 'server'" style="color: red">{{ element.content }}</strong>
                <em *ngIf="element.type === 'blueprint'">{{ element.content }}</em>
            </p>
        </div>
    </div>
</div>
</code>```

And my child component TS

```<code>@Input() element: { type: string; name: string; content: string };
</code>```

But I can't able to see any values in the page

Body:
I'm having this array in Parent component

serverElements = [{ type: 'server', name: 'sid', content: 'sid 1' }];

Which I'm passing to child component

  <app-server-element *ngFor="let element of serverElements" [element]="serverElements">
    </app-server-element>

And this is my child component HTML

{{ element.name }}

                {{ element.content }}
                {{ element.content }}

And my child component TS

@Input() element: { type: string; name: string; content: string };

But I can't able to see any values in the page


问:
Changing coefficients in logistic regression
I will try to explain my problem as best as i can. I am trying to externally validate a prediction model, made by one of my colleagues. For the external validation, I have collected data from a set of new patients.

I want to test the accuracy of the prediction model on this new dataset. Online i have found a way to do so, using the coef.orig function to extract de coefficients of the original prediction model (see the picture i added). Here comes the problem, it is impossible for me to repeat the steps my colleague did to obtain the original prediction model. He used multiple imputation and bootstrapping for the development and internal validation, making it very complex to repeat his steps. What I do have, is the computed intercept and coefficients from the original model. Step 1 from the picture i added, could therefor be skipped.

My question is, how can I add these coefficients into the regression model, without the use of the 'coef()' function?

Steps to externally validate the prediction model:

The coefficients I need to use:

I thought that the offset function would possibly be of use, however this does not allow me to set the intercept and all the coefficients for the variables at the same time


问:
How to scrape Onion websites (Dark Web) data using Selenium Python on Windows 10?
I am unable to scrape data from onion websites from Dark Web using Selenium on windows 10 through TOR browser.

My code:

```<code>from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
import pandas as pd
from selenium.webdriver.firefox.service import Service
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.proxy import Proxy, ProxyType
import time

serv="C:\\Users\\DELL\\Desktop\\Tor_Browser\\Browser\\TorBrowser\\Tor\\tor.exe"

proxy = Proxy({
'proxyType': ProxyType.MANUAL,
'socksProxy': '127.0.0.1:9150',
'socksVersion': 5, })

options=Options()
options.profile=FirefoxProfile("C:\\Users\\DELL\\Desktop\\Tor_Browser\\Browser\\TorBrowser\\Data\\Browser\\profile.default")
options.binary_location=FirefoxBinary("C:\\Users\\DELL\\Desktop\\Tor_Browser\\Browser\\firefox.exe")

binary=FirefoxBinary("C:\\Users\\DELL\\Desktop\\Tor_Browser\\Browser\\firefx.exe")

binary.profile=FirefoxProfile("C:\\Users\\DELL\\Desktop\\Tor_Browser\\Browser\\TorBrowser\\Data\\Browser\\profile.default")

serv=Service("C:\\Program Files\\Gecko_Driver\\geckodriver.exe")
driver = webdriver.Firefox(options=options,service=serv)
url="http://archiveiya74codqgiixo33q62qlrqtkgmcitqx5u2oeqnmn5bpcbiyd.onion/"

driver.implicitly_wait(30)
driver.get(url)
print("program ran")
time.sleep(10)

driver.find_element("/html/body/center/div/div[1]/div[1]/a/div[1]")
</code>```

When I try connecting through Geckodriver's binary path, it throws this error:

tent/marionette/cert.js :: allowAllCerts.enable :: line 46"  data: no]
Stacktrace:
allowAllCerts.enable@chrome://remote/content/marionette/cert.js:46:23
WebDriverSession@chrome://remote/content/shared/webdriver/Session.jsm:179:21
createSession@chrome://remote/content/webdriver-bidi/WebDriverBiDi.jsm:88:21
GeckoDriver.prototype.newSession@chrome://remote/content/marionette/driver.js:421:39
despatch@chrome://remote/content/marionette/server.js:306:40
execute@chrome://remote/content/marionette/server.js:279:16
onPacket/<@chrome://remote/content/marionette/server.js:252:20
onPacket@chrome://remote/content/marionette/server.js:253:9
_onJSONObjectReady/<@chrome://remote/content/marionette/transport.js:500:20

Please suggest me a solution for scraping .onion websites using Python Selenium on Windows 10.

Body:
I am unable to scrape data from onion websites from Dark Web using Selenium on windows 10 through TOR browser.

My code:

from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
import pandas as pd
from selenium.webdriver.firefox.service import Service
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.proxy import Proxy, ProxyType
import time

serv="C:\\Users\\DELL\\Desktop\\Tor_Browser\\Browser\\TorBrowser\\Tor\\tor.exe"

proxy = Proxy({
'proxyType': ProxyType.MANUAL,
'socksProxy': '127.0.0.1:9150',
'socksVersion': 5, })

options=Options()
options.profile=FirefoxProfile("C:\\Users\\DELL\\Desktop\\Tor_Browser\\Browser\\TorBrowser\\Data\\Browser\\profile.default")
options.binary_location=FirefoxBinary("C:\\Users\\DELL\\Desktop\\Tor_Browser\\Browser\\firefox.exe")

binary=FirefoxBinary("C:\\Users\\DELL\\Desktop\\Tor_Browser\\Browser\\firefx.exe")

binary.profile=FirefoxProfile("C:\\Users\\DELL\\Desktop\\Tor_Browser\\Browser\\TorBrowser\\Data\\Browser\\profile.default")

serv=Service("C:\\Program Files\\Gecko_Driver\\geckodriver.exe")
driver = webdriver.Firefox(options=options,service=serv)
url="http://archiveiya74codqgiixo33q62qlrqtkgmcitqx5u2oeqnmn5bpcbiyd.onion/"

driver.implicitly_wait(30)
driver.get(url)
print("program ran")
time.sleep(10)

driver.find_element("/html/body/center/div/div[1]/div[1]/a/div[1]")

When I try connecting through Geckodriver's binary path, it throws this error:

tent/marionette/cert.js :: allowAllCerts.enable :: line 46"  data: no]
Stacktrace:
allowAllCerts.enable@chrome://remote/content/marionette/cert.js:46:23
WebDriverSession@chrome://remote/content/shared/webdriver/Session.jsm:179:21
createSession@chrome://remote/content/webdriver-bidi/WebDriverBiDi.jsm:88:21
GeckoDriver.prototype.newSession@chrome://remote/content/marionette/driver.js:421:39
despatch@chrome://remote/content/marionette/server.js:306:40
execute@chrome://remote/content/marionette/server.js:279:16
onPacket/<@chrome://remote/content/marionette/server.js:252:20
onPacket@chrome://remote/content/marionette/server.js:253:9
_onJSONObjectReady/<@chrome://remote/content/marionette/transport.js:500:20

Please suggest me a solution for scraping .onion websites using Python Selenium on Windows 10.


问:
ClassNotFoundException with Tomcat 9
The application is a spring based web application. Getting classNotFound Exceptions for the following 3 classes while starting the server from eclipse:

org.springframework.web.context.ContextLoaderListener

org.springframework.web.context.request.RequestContextListener

org.springframework.security.web.session.HttpSessionEventPublisher

Server: Tomcat 9

Tried clean tomcat build directory and clean option.

Tried "Add and Remove" server option.

Title: ClassNotFoundException with Tomcat 9


问:
Unity Build on Android - Why use 32-bit?
I have a Google Pixel Pro 7 and just found out without rooting the device, it won't support 32-bit apps and games. So I wasn't able to install the apk of a project I'm working on.
Google states they wanted to give developers more opportunities by doing so.

Now I'm wondering, why should you build 32-bit besides supporting older devices?

Is it true, that most modern devices support 32-bit AND 64-bit?

So what are arguments against building in 64-bit if you just want to build games for modern devices? Will 32-bit still be relevant in the future?


问:
Microsoft.Data.SqlClient.SqlException : Incorrect syntax near 'CHARACTER'. 'utf8mb4' is not a recognized SET option
I am working on an ASP.Net Core 3.1 MVC project with EF Core and MySQL 8.0.31
I tried adding a new scaffolding item (Identity) to add custom personal data to a user. Then I created a new migration and after running dotnet ef database update, the error message in the title appears.

I've checked all files that include 'utf8mb4' and replaced them with 'utf8', but it gives me the same error, but 'utf8' instead. 'utf8mb4' is supported on my MySQL version last time I checked (today). I've also checked previous versions of the project and 'utf8mb4' was there in the migration files and I never encountered this error. I have searched extensively online for this problem in particular but I don't see many people having this same issue.

Help would be appreciated. Thanks.

Detailed error message:

```<code>$ dotnet ef database update
Build started...
Build succeeded.
fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
      Failed executing DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      CREATE TABLE [AspNetRoles] (
          [Id] varchar(255) NOT NULL,
          [Name] varchar(256) NULL,
          [NormalizedName] varchar(256) NULL,
          [ConcurrencyStamp] longtext CHARACTER SET utf8mb4 NULL,
          CONSTRAINT [PK_AspNetRoles] PRIMARY KEY ([Id])
      );
Failed executing DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
CREATE TABLE [AspNetRoles] (
    [Id] varchar(255) NOT NULL,
    [Name] varchar(256) NULL,
    [NormalizedName] varchar(256) NULL,
    [ConcurrencyStamp] longtext CHARACTER SET utf8mb4 NULL,
    CONSTRAINT [PK_AspNetRoles] PRIMARY KEY ([Id])
);
Microsoft.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near 'CHARACTER'.
'utf8mb4' is not a recognized SET option.
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
   at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable`1 migrationCommands, IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String contextType)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
ClientConnectionId:77d6b5ae-a86e-4883-bb36-214f6719f2f0
Error Number:102,State:1,Class:15
Incorrect syntax near 'CHARACTER'.
'utf8mb4' is not a recognized SET option.
</code>```

Body:
I am working on an ASP.Net Core 3.1 MVC project with EF Core and MySQL 8.0.31
I tried adding a new scaffolding item (Identity) to add custom personal data to a user. Then I created a new migration and after running dotnet ef database update, the error message in the title appears.

I've checked all files that include 'utf8mb4' and replaced them with 'utf8', but it gives me the same error, but 'utf8' instead. 'utf8mb4' is supported on my MySQL version last time I checked (today). I've also checked previous versions of the project and 'utf8mb4' was there in the migration files and I never encountered this error. I have searched extensively online for this problem in particular but I don't see many people having this same issue.

Help would be appreciated. Thanks.

Detailed error message:

$ dotnet ef database update
Build started...
Build succeeded.
fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
      Failed executing DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      CREATE TABLE [AspNetRoles] (
          [Id] varchar(255) NOT NULL,
          [Name] varchar(256) NULL,
          [NormalizedName] varchar(256) NULL,
          [ConcurrencyStamp] longtext CHARACTER SET utf8mb4 NULL,
          CONSTRAINT [PK_AspNetRoles] PRIMARY KEY ([Id])
      );
Failed executing DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
CREATE TABLE [AspNetRoles] (
    [Id] varchar(255) NOT NULL,
    [Name] varchar(256) NULL,
    [NormalizedName] varchar(256) NULL,
    [ConcurrencyStamp] longtext CHARACTER SET utf8mb4 NULL,
    CONSTRAINT [PK_AspNetRoles] PRIMARY KEY ([Id])
);
Microsoft.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near 'CHARACTER'.
'utf8mb4' is not a recognized SET option.
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
   at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable`1 migrationCommands, IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String contextType)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
ClientConnectionId:77d6b5ae-a86e-4883-bb36-214f6719f2f0
Error Number:102,State:1,Class:15
Incorrect syntax near 'CHARACTER'.
'utf8mb4' is not a recognized SET option.


问:
Why is the child View's touch area still touchable even if it extends beyond the parent View's?
The official documentation says:

The touch area never extends past the parent view bounds and the Z-index of sibling views always takes precedence if a touch hits two overlapping views.

I interpreted the meaning of this sentence as follows.

"The touch area of the lower view cannot be larger than the size of the upper view."

However, when I ran the following code, I got different results than expected.

The yellow view's touch area is set to be larger than the green view's size, but touching beyond the green view's bounds still works.

```<code>...
export default function App() {
  const [txt, setTxt] = useState(false);
  const PR = PanResponder.create({
    onStartShouldSetPanResponder: () => true,
    onPanResponderStart: () => {
      // ... start
      setTxt((prev) => (prev ? false : true));
    },
  });

  return (
    <View style={styles.container1}>
      <View style={styles.container2}>
        <View
          style={styles.container3}
          {...PR.panHandlers}
          hitSlop={{ top: 80, bottom: 80 }}
        >
          <Text style={styles.Text}>{txt ? "true" : "false"}</Text>
        </View>
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  container1: {
    flex: 1,
    backgroundColor: "red",
    alignItems: "center",
    justifyContent: "center",
  },
  container2: {
    // flex: 1,
    backgroundColor: "green",
    height: 140,
    width: 240,
    alignItems: "center",
    justifyContent: "center",
  },
  container3: {
    backgroundColor: "yellow",
    height: 60,
    width: 160,
  },
  Text: {
    fontSize: 36,
  },
});

</code>```

Did I misunderstand the sentence in the official documentation?
please answer me.

Thanks in advance.

Body:
The official documentation says:

The touch area never extends past the parent view bounds and the Z-index of sibling views always takes precedence if a touch hits two overlapping views.

I interpreted the meaning of this sentence as follows.

"The touch area of the lower view cannot be larger than the size of the upper view."

However, when I ran the following code, I got different results than expected.

The yellow view's touch area is set to be larger than the green view's size, but touching beyond the green view's bounds still works.

...
export default function App() {
  const [txt, setTxt] = useState(false);
  const PR = PanResponder.create({
    onStartShouldSetPanResponder: () => true,
    onPanResponderStart: () => {
      // ... start
      setTxt((prev) => (prev ? false : true));
    },
  });

  return (
    <View style={styles.container1}>
      <View style={styles.container2}>
        <View
          style={styles.container3}
          {...PR.panHandlers}
          hitSlop={{ top: 80, bottom: 80 }}
        >
          <Text style={styles.Text}>{txt ? "true" : "false"}</Text>
        </View>
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  container1: {
    flex: 1,
    backgroundColor: "red",
    alignItems: "center",
    justifyContent: "center",
  },
  container2: {
    // flex: 1,
    backgroundColor: "green",
    height: 140,
    width: 240,
    alignItems: "center",
    justifyContent: "center",
  },
  container3: {
    backgroundColor: "yellow",
    height: 60,
    width: 160,
  },
  Text: {
    fontSize: 36,
  },
});

Did I misunderstand the sentence in the official documentation?
please answer me.

Thanks in advance.


问:
sdb path - Storage Inspector Android Studio
I`m using Android Studio to develop a Flutter App with a drift database.
For inspection i like to use the local storage inspection tool.
What is the sdb path and the idevice path, when use emulator.

I've tried to search after something like the sdb.exe but didnt found something


问:
How much time does it take to move resources to a new Resource Group in Azure?
I am concerned about the downtime that might be needed as both source and target resource groups are actively used.

Azure Portal Screenshot
Both resource groups are associated with same subscription. Any other pointers one should keep in mind related to this warning?

Updated: I am targeting compute resources - VM and images are to be moved. I ran a quick scan to see what all could be moved, got a green for my compute resources.


问:
Firebase hosting custom domain shows "Site Not Found
I was having a static file hosting in a firebase project. I deleted the project by mistake and lost my domain A record and TXT records.

I recreated a new firebase hosting project and deployed my static website again. It works fine for default firebase hosting https://jawsandteeth-website.firebaseapp.com/

HOwever, when I connect my custom domain again with A record and TXT record, the project hosting dashboard is showing custom domain is in connected state. however the URL www.jawsandteeth.com shows "Site Not Found" error. It has been 2 days and not sure if waiting more time is going to help.

Could someone help on this regards? Any leads is much appreciated.

Expecting custom domain to show same content as default firebase hosting


问:
Read client application properties from B2C custom policy running in the same tenant
I'd like to read client application properties (for example, directory extensions on application objects) from B2C custom policy running in the same tenant.

On the screenshot you can find an example of a client application manifest with extension properties which are desired to be obtained in B2C custom policy.

Application properties

According to the documentation Azure Active Directory B2C (Azure AD B2C) provides support for the Azure Active Directory user management in custom policy (https://learn.microsoft.com/en-us/azure/active-directory-b2c/active-directory-technical-profile).
There are some predefined technical profiles only related to users (not for applications):

ADD User Technical Profiles

Unfortunately, I did not find a way in official documentations to support application management. It'd be nice to hear any feedback whether it's possible or not. Thanks in advance


问:
TigerGraph memory usage by query?
When any query is run, the value of "QueryMem" memory usage is zero [BeforeRun:0 and AfterRun:0], as shown below, and for more illustrations, see the attached file execution:

I1008 13:18:33.196965 52263 master.cpp:112] Engine_MemoryStats||musae_facebook_edges_UnDirected::default,16777247.RESTPP_1_1.1665219560009.N,NNN,86400,0,0,S|MONITORING Step(15) BeforeRun[Reduce][QueryMem]: 0

I1008 13:18:33.198311 52263 master.cpp:119] Engine_MemoryStats||musae_facebook_edges_UnDirected::default,16777247.RESTPP_1_1.1665219560009.N,NNN,86400,0,0,S|MONITORING Step(15) AfterRun[Reduce][QueryMem]: 0

Execution File(INFO)

Title: TigerGraph memory usage by query?


问:
Nginx cannot reach to backend
nginx cannot reach to backend , follow photo is nginx logs

nginx logs

here is the docker-compose

docker-compose

I am trying to setup laravel project using docker . Docker containers are running , such as database,web service,backend service.

Title: Nginx cannot reach to backend


问:
ASP.NET Core MVC application : hosted application used on several devices at once acting like one
So i've hosted my site on Smarter ASP . The application is made in ASP.NET Core MVC with MSSQL database . The problem is that when a user logs into the account from a PC for example and then a user from a mobile phone opens the site he get logged directly into the other persons account and both devices act like one .

Ive tried to add session but it doesnt work.

This is my Authentication class :

```<code>/// <summary>
///         This static class is the web applications authentication that is going
///         to be used all across the application
/// </summary>
/// <param name="LoggedUser">Container holding the data for the logged user</param>
/// <param name="Authenticate">Checks for existing user with that parameters and fills the LoggedUser container</param>
/// <param name="getFullName">returns the full name of the logged user</param>
public class Authentication
{
    public static User LoggedUser { get; set; }

    public static void Authenticate(string email , string password)
    {
        UserRepository userRepository = new UserRepository();
        var user = userRepository.FindByEmailAndPassword(email, password);
        LoggedUser = user;
    }

    public static string getFullName()
    {
        if (LoggedUser == null)
        {
            return "";
        }
        else
        {
            return LoggedUser.firstName + " " + LoggedUser.lastName;
        }
    }

    public static void UpdateUser()
    {
        if (LoggedUser != null)
        {
            UserRepository userRepository =new UserRepository();
            LoggedUser = userRepository.FindById(LoggedUser.ID);
        }
    }
}
</code>```

This is the login where after i check whether the user wants to stay loged
i am trying to create a session but im not sure if thats the correct way :

```<code>[HttpPost]
    public IActionResult Login(LoginVM model)
    {
        if (!ModelState.IsValid)
            return View(model);

        Authentication.Authenticate(model.email, model.password);

        if (Authentication.LoggedUser == null)
            return View(model);

        if (model.keepMeLoged == 1)
        {
            CookieOptions cookieOptions = new CookieOptions();
            cookieOptions.Expires = DateTimeOffset.Now.AddDays(30);

            Response.Cookies.Append("userID" , Authentication.LoggedUser.ID.ToString(),cookieOptions);
        }

        if (Authentication.LoggedUser != null)
        {
            HttpContext.Session.SetInt32("UserID" , Authentication.LoggedUser.ID);
            HttpContext.Session.SetString("Email", Authentication.LoggedUser.email);
        }

        return RedirectToAction("Index", "Home");
    }
</code>```

And here i delete the session :

```<code>public IActionResult Logout()
    {
        Authentication.LoggedUser = null;

        Response.Cookies.Delete("userID");
        HttpContext.Session.Clear();

        return RedirectToAction("Index","Home");
    }
</code>```

Body:
So i've hosted my site on Smarter ASP . The application is made in ASP.NET Core MVC with MSSQL database . The problem is that when a user logs into the account from a PC for example and then a user from a mobile phone opens the site he get logged directly into the other persons account and both devices act like one .

Ive tried to add session but it doesnt work.

This is my Authentication class :

///
///         This static class is the web applications authentication that is going
///         to be used all across the application
///
/// <param name="LoggedUser">Container holding the data for the logged user</param>
/// <param name="Authenticate">Checks for existing user with that parameters and fills the LoggedUser container</param>
/// <param name="getFullName">returns the full name of the logged user</param>
public class Authentication
{
    public static User LoggedUser { get; set; }

    public static void Authenticate(string email , string password)
    {
        UserRepository userRepository = new UserRepository();
        var user = userRepository.FindByEmailAndPassword(email, password);
        LoggedUser = user;
    }

    public static string getFullName()
    {
        if (LoggedUser == null)
        {
            return "";
        }
        else
        {
            return LoggedUser.firstName + " " + LoggedUser.lastName;
        }
    }

    public static void UpdateUser()
    {
        if (LoggedUser != null)
        {
            UserRepository userRepository =new UserRepository();
            LoggedUser = userRepository.FindById(LoggedUser.ID);
        }
    }
}

This is the login where after i check whether the user wants to stay loged
i am trying to create a session but im not sure if thats the correct way :

[HttpPost]
    public IActionResult Login(LoginVM model)
    {
        if (!ModelState.IsValid)
            return View(model);

        Authentication.Authenticate(model.email, model.password);

        if (Authentication.LoggedUser == null)
            return View(model);

        if (model.keepMeLoged == 1)
        {
            CookieOptions cookieOptions = new CookieOptions();
            cookieOptions.Expires = DateTimeOffset.Now.AddDays(30);

            Response.Cookies.Append("userID" , Authentication.LoggedUser.ID.ToString(),cookieOptions);
        }

        if (Authentication.LoggedUser != null)
        {
            HttpContext.Session.SetInt32("UserID" , Authentication.LoggedUser.ID);
            HttpContext.Session.SetString("Email", Authentication.LoggedUser.email);
        }

        return RedirectToAction("Index", "Home");
    }

And here i delete the session :

public IActionResult Logout()
    {
        Authentication.LoggedUser = null;

        Response.Cookies.Delete("userID");
        HttpContext.Session.Clear();

        return RedirectToAction("Index","Home");
    }


问:
2K Full HD Web Camera Flickering Like Earthquake including black and green lines
I have bought new 2K Full HD webcam. Whenever I connect it to my windows laptop, it gives me  green and black lines and it flickers  badly.

I switched it to 50Hz and 60Hz in camera APP in windows but nothing worked.  Here's the video of the flicker on windows 10: Google Drive Link

But this camera is 100% working fine with skype APP and I have tested it with my friend's MacBook Pro. The camera gives the crispy HD results. But whenever I connect it with windows. It gives me  flickering and glitching. Here's the video recorded on skype video setting: Google Drive Link

Both of these videos are recorded in a room and the light in the room is not a bulb light. Its the natural light from the opened window. I have also tested it with bulb light and energy saver bulb, but still the camera is not fixed.

I have updated all of the system drivers, graphics card drivers, change camera app settings and followed every single tutorial to make it work. I cannot buy new one because it's the expensive camera and I can't afford to get a new one. It is working on Mac, Skype but not working on Zoom, Camera APP.

Please do reply to this thread if you know the solution. Thank you in Advance!

I bought this new camera for recording. It is flickering alot. I wanted it to work on windows as it is working on MAC. Thank you!


问:
Set the right Eun Rotation with Geospatial Anchor
I want Instatiate an object anchored with the Geospatial Anchor with Ar Core on Unity.

I have an issue with the Quaternion when I use the function ResolveAnchorOnTerrain, I can't set the right rotation.

I use the Geospatial Pose of my Camera to know which is the rotation that I want and the result is a Quaternion like this (-0.03922. -0.85355, -0.06612, 0.51530);

In this image there is my anchored obj with the Quaternion.identity for rotation
My example

I would like the vertices to coincide and be turned to the same side, I tried to use this Quaternion (-0.03922. -0.85355, -0.06612, 0.51530) but it don't work well.

This is the code that I use for the image linked before.

```<code>private IEnumerator PlaceAnchorOnTerrain()
    {
        if (TerrainAnchor != null)
            yield return null;

        TerrainAnchor = arAnchorManager.ResolveAnchorOnTerrain(
            latitude,
            longitude,
            0.1,
            Quaternion.identity
        );
        while (TerrainAnchor.terrainAnchorState == TerrainAnchorState.TaskInProgress)
        {
            yield return null;
        }
        if (TerrainAnchor.terrainAnchorState == TerrainAnchorState.Success)
        {
            InitializeAnchor();
        }
    }

    public void InitializeAnchor()
    {
        UIDebugManager.Instance.CreateDebugMessage("INITIALIZE ANCHOR");
        spawnedPrefab = Instantiate(prefabMarker, TerrainAnchor.transform);
        startButton.SetActive(false);
    }

</code>```

I have to know how can I set the rotation of my anchor and knowing this EunRotation: (-0.03922. -0.85355, -0.06612, 0.51530) it's the EunRotation of my camera facing the right spot.
Orientation that my object must have

Body:
I want Instatiate an object anchored with the Geospatial Anchor with Ar Core on Unity.

I have an issue with the Quaternion when I use the function ResolveAnchorOnTerrain, I can't set the right rotation.

I use the Geospatial Pose of my Camera to know which is the rotation that I want and the result is a Quaternion like this (-0.03922. -0.85355, -0.06612, 0.51530);

In this image there is my anchored obj with the Quaternion.identity for rotation
My example

I would like the vertices to coincide and be turned to the same side, I tried to use this Quaternion (-0.03922. -0.85355, -0.06612, 0.51530) but it don't work well.

This is the code that I use for the image linked before.

private IEnumerator PlaceAnchorOnTerrain()
    {
        if (TerrainAnchor != null)
            yield return null;

        TerrainAnchor = arAnchorManager.ResolveAnchorOnTerrain(
            latitude,
            longitude,
            0.1,
            Quaternion.identity
        );
        while (TerrainAnchor.terrainAnchorState == TerrainAnchorState.TaskInProgress)
        {
            yield return null;
        }
        if (TerrainAnchor.terrainAnchorState == TerrainAnchorState.Success)
        {
            InitializeAnchor();
        }
    }

    public void InitializeAnchor()
    {
        UIDebugManager.Instance.CreateDebugMessage("INITIALIZE ANCHOR");
        spawnedPrefab = Instantiate(prefabMarker, TerrainAnchor.transform);
        startButton.SetActive(false);
    }

I have to know how can I set the rotation of my anchor and knowing this EunRotation: (-0.03922. -0.85355, -0.06612, 0.51530) it's the EunRotation of my camera facing the right spot.
Orientation that my object must have


问:
Python: finding .ttf files cross-platform
This is related to

Python - finding TTF files

My question simply is if there is a standalone version of the matplotlib font manager or a package that does the same thing? All I need is to get a ttf file from a font name so I don't really want to make matplotlib a dependency.


问:
Can I hide the badges on the tabs of editor?
enter image description here
Can this badge of file type be hiden?

I've looked up all the "tab" in the "workbench.editor.*" setting.


问:
Vue 3 get child from slot and set his props with re-render
I need to get my child components from a parent component. To solve that problem I do this:

I created an interface:

```<code>export interface IInputs {
    inputName: "InputText" | "InputDate",
    required: boolean,
    validate: (value?: IInputs) => boolean,
    error?: string,
    value: string | undefined
}
</code>```

In my child component I do this:

```<code><script setup lang="ts">
    export interface InputTextProps extends IInputs {
        label?: string,
        placeholder?: string,
        icon?: string,
        iconEvent?: Function,
        password: boolean
    }

    const props = withDefaults(defineProps<InputTextProps>(), {
        inputName: "InputText",
        password: false,
        required: false,
        validate: (prop?: IInputs) => {
            let isValid = prop?.value != null && prop?.value.trim().length > 0;

            if (!isValid) {
                prop!.error = "This field is mandatory";
            }

            return isValid;
        }
    });

    watch(props, (newValue: InputTextProps) => {
       console.debug("Here");
    }, { deep: true });

    const emit = defineEmits<{
        (event: "update:value", newValue: string | undefined): void;
    }>();
</script>
</code>```

From my parent component I get correctly child component using slot.default():

```<code><script setup lang="ts">
    import { IInputs } from './input/text.vue';

    const slot = useSlots();

    const validation = async (payload: Event) => {
        try {
            payload.preventDefault();

            if (slot.default != null) {
                let inputs = slot.default().filter(x => (<any>x.type)?.props?.inputName?.default == "InputText");

                 inputs.forEach(input => {
                     let type = (<any>input).type.props;
                     let prop = <IInputs>input.props;

                     if (prop.required) {
                         let isValid = (prop.validate || type.validate.default)(prop);

                         if (!isValid) {
                             // some code
                         }
                     }
                 });
             }
         } catch (e: any) { }
     };
 </script>
</code>```

In this way I can set a validation error to show. The problem is that child component doesn't re-render. I tried with watch on props but when I set error property it doesn't trigger my function.

How can I solve this problem? My implementation is the correct way to handle this case?

Body:
I need to get my child components from a parent component. To solve that problem I do this:

I created an interface:

export interface IInputs {
    inputName: "InputText" | "InputDate",
    required: boolean,
    validate: (value?: IInputs) => boolean,
    error?: string,
    value: string | undefined
}

In my child component I do this:

From my parent component I get correctly child component using slot.default():

In this way I can set a validation error to show. The problem is that child component doesn't re-render. I tried with watch on props but when I set error property it doesn't trigger my function.

How can I solve this problem? My implementation is the correct way to handle this case?


问:
Blazor Server-Side: Show file in razor page that is outside wwwroot folder
I have a PDF file in a folder called "UploadedFiles". This folder is not inside the wwwroot folder.

On the "showFile.razor" page I want to show this PDF.

How can I return the PDF file from UploadedFiles to showFile.razor

I used  element on the showFile.razor page with the file in wwwroot and it worked, but the file is accessible for everyone when it is in wwwroot. This is not what I desire.