三岁铭

文章 评论 浏览 32

三岁铭 2025-02-03 16:21:38

当我忘了在URL中提到密码以及密码错误时,我面临此错误。

private fun hikari(): HikariDataSource{
        val config = HikariConfig()
        config.driverClassName = "org.postgresql.Driver"
        config.jdbcUrl = "jdbc:postgresql:<database_name_in_lowercase>?user=<username>&password=<password>"
        config.maximumPoolSize = 3
        config.isAutoCommit = false
        config.transactionIsolation = "TRANSACTION_REPEATABLE_READ"
        config.validate()
        return HikariDataSource(config)
    }

I faced this error when I forgot to mention the password in the URL and also when the password was wrong.

private fun hikari(): HikariDataSource{
        val config = HikariConfig()
        config.driverClassName = "org.postgresql.Driver"
        config.jdbcUrl = "jdbc:postgresql:<database_name_in_lowercase>?user=<username>&password=<password>"
        config.maximumPoolSize = 3
        config.isAutoCommit = false
        config.transactionIsolation = "TRANSACTION_REPEATABLE_READ"
        config.validate()
        return HikariDataSource(config)
    }

无法部署KTOR服务器

三岁铭 2025-02-03 03:17:55

使用 object.keys(obj)您可以获取未知密钥的列表。使用这些密钥,您可以获取对象属性。

下图下方可能会对您有所帮助。

import React, { useState, useEffect } from 'react';
import axios from 'axios';

function App(props) {

    var baseUrl = `https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=IBM&apikey=https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=IBM&apikey=JX0BM5MCRRDMZBSE`;
    let chartXValues = []; // Date
    let chartYValues = []; //Stock Price

    const [chart, setChart] = useState();

    useEffect(() => {

        axios.get(baseUrl).then(res => {
            setChart(res.data);
            console.log(res.data);
        });

    }, [baseUrl]);

    useEffect(()=>{}, [chart]);

    return (
        <div>
            {   chart &&
                Object.keys(chart['Time Series (Daily)']).map((k, i1) => {
                    return (<div key={i1}>
                        <h3>{k}</h3>
                        {
                            Object.keys(chart['Time Series (Daily)'][k]).map((l, i2) => {
                                return (<div key={i2}>{chart['Time Series (Daily)'][k][l]}</div>)
                            })
                        }
                    </div>)
                })
            }
        </div>

    );
}

export default App;

With Object.keys(obj) you can get list of unknown key. With those key you can fetch object properties.

below snippet may help you.

import React, { useState, useEffect } from 'react';
import axios from 'axios';

function App(props) {

    var baseUrl = `https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=IBM&apikey=https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=IBM&apikey=JX0BM5MCRRDMZBSE`;
    let chartXValues = []; // Date
    let chartYValues = []; //Stock Price

    const [chart, setChart] = useState();

    useEffect(() => {

        axios.get(baseUrl).then(res => {
            setChart(res.data);
            console.log(res.data);
        });

    }, [baseUrl]);

    useEffect(()=>{}, [chart]);

    return (
        <div>
            {   chart &&
                Object.keys(chart['Time Series (Daily)']).map((k, i1) => {
                    return (<div key={i1}>
                        <h3>{k}</h3>
                        {
                            Object.keys(chart['Time Series (Daily)'][k]).map((l, i2) => {
                                return (<div key={i2}>{chart['Time Series (Daily)'][k][l]}</div>)
                            })
                        }
                    </div>)
                })
            }
        </div>

    );
}

export default App;

如何从API访问获取的数据

三岁铭 2025-02-03 02:07:16

嗨,我希望您现在已经找到答案了。以防万一您对其他人不如其他人,这是一个简单的公司地址实现,我希望您能够在您的情况下使用:

export function ReservationComponent() {

     const [formData, setFormData] = useState(
       {
           companyName: "",
           country: "",
           streetAddress: "",
           city: "",
           postalZipCode: ""
       }
     );

     const handleFormDataChange = (event: React.ChangeEvent<HTMLInputElement>) => {
         const { name, value } = event.target;
         setFormData((prevFormData) => ({ ...prevFormData, [name]: value }));
     };

    return (
        <form onSubmit={handleSubmit}>
            <label htmlFor="name">Company Name:</label>
            <input type="text" id="companyName" name="companyName" value={formData.companyName} onChange={handleFormDataChange} />

            <label>
                Country:
                <select value={formData.country} name="country" onChange={handleFormDataChange}>
                    <option disabled value="">Select...</option>
                    <option value="option1">Option 1</option>
                    <option value="option2">Option 2</option>
                    <option value="option3">Option 3</option>
                </select>
            </label>
            <p>Selected option: {formData.country}</p>

            <label htmlFor="street-address">Street Address:</label>
            <input type="text" id="street-address" name="streetAddress" value={formData.streetAddress} onChange={handleFormDataChange} />

            <label htmlFor="city">City:</label>
            <input type="text" id="city" name="city" value={formData.city} onChange={handleFormDataChange} />

            <label htmlFor="postal-zip-code">Postal Zip Code:</label>
            <input type="text" id="postal-zip-code" name="postalZipCode" value={formData.postalZipCode} onChange={handleFormDataChange} />

            <button type="submit">Submit</button>
        </form>
    );
}

我很乐意回答您对代码的任何问题,但我认为这是相当不言自明的,即使不是人为解释。愉快的编码。

Hi I'm hoping that you have found your answer by now. Just in case you haven't as well as for others, here is a simple company address implementation that I hope you'll be able to use for your situation:

export function ReservationComponent() {

     const [formData, setFormData] = useState(
       {
           companyName: "",
           country: "",
           streetAddress: "",
           city: "",
           postalZipCode: ""
       }
     );

     const handleFormDataChange = (event: React.ChangeEvent<HTMLInputElement>) => {
         const { name, value } = event.target;
         setFormData((prevFormData) => ({ ...prevFormData, [name]: value }));
     };

    return (
        <form onSubmit={handleSubmit}>
            <label htmlFor="name">Company Name:</label>
            <input type="text" id="companyName" name="companyName" value={formData.companyName} onChange={handleFormDataChange} />

            <label>
                Country:
                <select value={formData.country} name="country" onChange={handleFormDataChange}>
                    <option disabled value="">Select...</option>
                    <option value="option1">Option 1</option>
                    <option value="option2">Option 2</option>
                    <option value="option3">Option 3</option>
                </select>
            </label>
            <p>Selected option: {formData.country}</p>

            <label htmlFor="street-address">Street Address:</label>
            <input type="text" id="street-address" name="streetAddress" value={formData.streetAddress} onChange={handleFormDataChange} />

            <label htmlFor="city">City:</label>
            <input type="text" id="city" name="city" value={formData.city} onChange={handleFormDataChange} />

            <label htmlFor="postal-zip-code">Postal Zip Code:</label>
            <input type="text" id="postal-zip-code" name="postalZipCode" value={formData.postalZipCode} onChange={handleFormDataChange} />

            <button type="submit">Submit</button>
        </form>
    );
}

I'm happy to answer any more question you have about the code but I think it's fairly self-explanatory if not contrived. Happy coding.

在React表格中添加下拉菜单

三岁铭 2025-02-02 23:05:08

请记住,几乎每次您在Nginx-Ingress中获得502糟糕的网关时,它都会链接到后端端口绑定问题 /不良后端配置名称等。

在此处,您的Nginx Ingress都配置为从“ xyz.internals”中重定向。登台。

但是,8080是您服务的目标港。没有实际上是80的暴露端口。

因此,要解决此问题,只需更改后端服务的端口,例如:(

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: "internal"
    forecastle.stakater.com/expose: "true"
    forecastle.stakater.com/appName: "XYZ Microservice"
    cert-manager.io/cluster-issuer: "letsencrypt-aws"
  name: xyz-microservice
spec:
  rules:
    - host: xyz.internal.staging.k8s.redacted
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: xyz-microservice-service
                port:
                  number: 80
  tls:
    - hosts:
      - xyz.internal.staging.k8s.redacted
      secretName: xyz-microservice-tls

或重新配置服务端口以匹配入口配置的端口。)

Just keep in mind that almost every time you got a 502 bad gateway in nginx-ingress, it's linked to a backend port binding problem / bad backend configuration names etc.

Here your nginx ingress is configured to redirect the traffic from "xyz.internal.staging.k8s.redacted" host to the port 8080 of your "xyz-microservice-service" kubernetes service.

However 8080 is the targetPort of your service. No the exposed port that is in fact 80.

So, to fix this issue just change the port of the backend service, like this:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: "internal"
    forecastle.stakater.com/expose: "true"
    forecastle.stakater.com/appName: "XYZ Microservice"
    cert-manager.io/cluster-issuer: "letsencrypt-aws"
  name: xyz-microservice
spec:
  rules:
    - host: xyz.internal.staging.k8s.redacted
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: xyz-microservice-service
                port:
                  number: 80
  tls:
    - hosts:
      - xyz.internal.staging.k8s.redacted
      secretName: xyz-microservice-tls

(Or reconfigure the port of your service to match the port of the ingress configuration.)

nginx kubernetes入口返回502

三岁铭 2025-02-02 20:31:12

宽恕,如果不清楚,我们应该谈谈。请查看我的个人资料以获取联系信息。

观察1,

RU_sg1lib_classifybyoclc.ID appears to be INT(15) unsigned 
SELECTED for push into a_sg11lib table as book_id

a_sg1lib.book_id appears to be simple INT(13)  (NOT unsigned and diff lengths)

常见的是,我们在移动数据时会看到相同的列属性。

观察2,
calln_lcc = callCore的右JOIN和CALLCORE的右JOIN

RU_sg1lib_classifbyoclc.classifybyoclc_calln_lcc is simple varchar(256)

LOC_Classification_Text_zFULL_YYY.callcore is varchar(256) COLLATE utf8mb4_unicode_ci 

我们通常会看到= =的左侧和右侧匹配的列定义。

forgodsakehold, We should talk if this is not clear. View my profile for contact info, please.

Observation 1,

RU_sg1lib_classifybyoclc.ID appears to be INT(15) unsigned 
SELECTED for push into a_sg11lib table as book_id

and

a_sg1lib.book_id appears to be simple INT(13)  (NOT unsigned and diff lengths)

most often we see same column attributes when moving data.

Observation 2,
RIGHT JOIN of calln_lcc = to callCore

RU_sg1lib_classifbyoclc.classifybyoclc_calln_lcc is simple varchar(256)

and

LOC_Classification_Text_zFULL_YYY.callcore is varchar(256) COLLATE utf8mb4_unicode_ci 

most often we see matched column definitions for left and right side of =.

mysql加入查询时间太长了

三岁铭 2025-02-02 18:53:20

谢谢@bergi,现在很清楚。使用授予数据库上的所有特权以下工作:

postgres=# CREATE USER user1 WITH PASSWORD 'password';
CREATE ROLE
postgres=# CREATE DATABASE db1;
CREATE DATABASE
postgres=# GRANT ALL PRIVILEGES ON DATABASE db1 TO user1;
GRANT
postgres=# \c db1 user1
You are now connected to database "db1" as user "user1".
db1=> CREATE SCHEMA user1;
CREATE SCHEMA
db1=> DROP SCHEMA public;
ERROR:  must be owner of schema public
db1=> CREATE TABLE t1(a int);
CREATE TABLE
db1-> \dt
       List of relations
 Schema | Name | Type  | Owner 
--------+------+-------+-------
 user1  | t1   | table | user1
(1 row)

db1-> \dn
  List of schemas
  Name  |  Owner   
--------+----------
 public | postgres
 user1  | user1
(2 rows)

观察用户( user1 )无法删除架构 public ,因为所有者是所有者是 Postgres ,即使用户在数据库上也具有所有特权( db1 )。

Thanks @Bergi it is clear now. Using the GRANT ALL PRIVILEGES ON DATABASE the following works:

postgres=# CREATE USER user1 WITH PASSWORD 'password';
CREATE ROLE
postgres=# CREATE DATABASE db1;
CREATE DATABASE
postgres=# GRANT ALL PRIVILEGES ON DATABASE db1 TO user1;
GRANT
postgres=# \c db1 user1
You are now connected to database "db1" as user "user1".
db1=> CREATE SCHEMA user1;
CREATE SCHEMA
db1=> DROP SCHEMA public;
ERROR:  must be owner of schema public
db1=> CREATE TABLE t1(a int);
CREATE TABLE
db1-> \dt
       List of relations
 Schema | Name | Type  | Owner 
--------+------+-------+-------
 user1  | t1   | table | user1
(1 row)

db1-> \dn
  List of schemas
  Name  |  Owner   
--------+----------
 public | postgres
 user1  | user1
(2 rows)

Observe that the user (user1) cannot delete the schema public because the owner is postgres, even the user has all privileges on the database (db1).

PostgreSQL中的模式特权与数据库特权

三岁铭 2025-02-02 15:07:14

目前,在Android,iOS,MacOS和Web上支持Firebase_core 软件包。 linux 均不支持它。根据主机平台,根据该软件包有条件地执行代码的一部分。

For present time firebase_core package is supported on Android, IOS, MacOS, and Web. It's not supported yet for Linux. Execute your portion of code where you have operations based on that package conditionally according to the host platform.

Linux桌面应用程序缺少Pluginexception

三岁铭 2025-02-01 23:47:23

只是只能使用图像摘要,例如&lt; image-name&gt;@@&lt; imp;

  db:
    image: mysql@sha256:358b0482ced8103a8691c781e1cb6cd6b5a0b463a6dc0924a7ef357513ecc7a3
    container_name: mysql

要确保POD始终使用相同版本的容器图像,您可以指定图像的摘要;替换:与 @(例如,图像 @ sha256:45b23dee08af5e43a7fea6c4cf9c25cc25ccf269ee113168c1972222f878766677c5c5cb2)。

just can only use image digest, like <image-name>@<digest>

  db:
    image: mysql@sha256:358b0482ced8103a8691c781e1cb6cd6b5a0b463a6dc0924a7ef357513ecc7a3
    container_name: mysql

https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy

To make sure the Pod always uses the same version of a container image, you can specify the image's digest; replace : with @ (for example, image@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2).

拉动图像时更改Kubernetes的平台

三岁铭 2025-02-01 18:34:10

完全忘记了这一点。但是我修复了它。这是一个错字错误。请记住,传递自定义插件时,插件支柱接受数组。

<BarChart :chartData="chartData" :plugins="[plugin]"/>

Completely forgot about this. But I fixed it. It was a typo error. Remember when passing your custom plugins, the plugins prop accepts an array.

<BarChart :chartData="chartData" :plugins="[plugin]"/>

在Vue-chartjs上设置Chartjs插件无法正常工作

三岁铭 2025-02-01 11:57:04

您没有在文件中的值之间编写任何分界符。而且,在循环的内部,您正在尝试为本身的 ofstream 本身分配一个值,而不是将值写入由 ofStream

另外,您说数据在数组中,但是您没有显示该数组的实际外观。您的 循环不会通过任何数组循环。 循环的正在写出与您所描述的所需文件格式不一致的俱乐部信息。

您可能需要更多类似的东西:

class Club
{
    string name;
    int gamesPlayed, goalsFor, goalsAgainst, points;
};

Club* list;
int numofclubs;

...

ofstream outfile("output.dat");

for (int i = 0; i < numofclubs; ++i)
{ 
    outfile << list[i].name << ' '
            << list[i].gamesPlayed << ' '
            << list[i].goalsFor << ' '
            << list[i].goalsAgainst << ' '
            << list[i].points << '\n';
}

outfile.close();

You are not writing any delimiters between your values in the file. And, inside your for loop, you are trying to assign a value to the ofstream itself, rather than write the value to the file managed by the ofstream.

Also, you say the data is in an array, but you didn't show what that array actually looks like. Your while loop is not looping through any array. And your for loop is writing out club information that is not consistent with the desired file format you have described.

You probably need something more like this instead:

class Club
{
    string name;
    int gamesPlayed, goalsFor, goalsAgainst, points;
};

Club* list;
int numofclubs;

...

ofstream outfile("output.dat");

for (int i = 0; i < numofclubs; ++i)
{ 
    outfile << list[i].name << ' '
            << list[i].gamesPlayed << ' '
            << list[i].goalsFor << ' '
            << list[i].goalsAgainst << ' '
            << list[i].points << '\n';
}

outfile.close();

是否可以将不同值的不同值从类数组输出到文件中

三岁铭 2025-01-31 19:48:45

您需要按力安装依赖性。

npm install --legacy-peer-deps --force

转到终端尝试此命令。

You need to install the dependence by force.

npm install --legacy-peer-deps --force

Go to the terminal and try this command.

运行命令NPM安装时出错

三岁铭 2025-01-31 17:58:31

确保您的Okta发行人看起来像这样:

https:// {your_okta_domain} .okta.com/oauth2/default

如果您在localhost中使用它,则在.env文件中使用它,请确保您在不包含它的情况下存储此变量“”。因此,将值存储为:

okta_issuer =“ my_okta_issuer”

而不是:

okta_issuer = my_okta_issuer,

而是我花了一天的时间来弄清楚这一点,但现在可以使用。

Make sure that your okta issuer looks like this:

https://{your_okta_domain}.okta.com/oauth2/default

Also if you are using it in localhost, in your .env file make sure that you store this variable without enclosing it in "". So instead of storing the value as:

OKTA_ISSUER = "my_okta_issuer"

use instead:

OKTA_ISSUER = my_okta_issuer

It took me a day to figure that out, but now it works.

下一个实体只能请求有效的绝对URL

三岁铭 2025-01-31 16:28:37

您将需要Java JDK(如果愿意的话,或JVM),版本11或更高版本。您可以从此处下载并安装11.0.11 11.0.11 www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html 。

You will need the Java JDK (or the JVM if you prefer), version 11 or higher. You can download and install 11.0.11 from here: https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html.

Sonarqube无法创建Java虚拟机无法识别的选项:-add-exports = java.base/jdk.internal.ref = all-Unnumed

三岁铭 2025-01-31 15:31:52

const recordCollection={2548:{albumTitle:"Slippery When Wet",artist:"Bon Jovi",tracks:["Let It Rock","You Give Love a Bad Name"]},2468:{albumTitle:"1999",artist:"Prince",tracks:["1999","Little Red Corvette"]},1245:{artist:"Robert Palmer",tracks:[]},5439:{albumTitle:"ABBA Gold"}};

function updateRecords(records, id, prop, value) {
  const record = records[id];

  if (!value) {
    delete record[prop];
    return records;
  }

  if (prop === 'tracks') {    
    record[prop] ??= [];
    record[prop].push(value);
    return records;
  } 

  record[prop] = value;
  return records;
};

console.log(updateRecords(recordCollection, 5439, 'artist', 'ABBA')[5439]);
console.log(updateRecords(recordCollection, 5439, "tracks", "Take a Chance on Me")[5439]);
console.log(updateRecords(recordCollection, 2548, "artist", "")[2548])
console.log(updateRecords(recordCollection, 1245, "tracks", "Addicted to Love")[1245])
console.log(updateRecords(recordCollection, 2548, "tracks", "")[2548])
console.log(updateRecords(recordCollection, 1245, "albumTitle", "Riptide")[1245])
.as-console-wrapper {max-height: 100% !important; top: 0}

One possible solution to this task

const recordCollection={2548:{albumTitle:"Slippery When Wet",artist:"Bon Jovi",tracks:["Let It Rock","You Give Love a Bad Name"]},2468:{albumTitle:"1999",artist:"Prince",tracks:["1999","Little Red Corvette"]},1245:{artist:"Robert Palmer",tracks:[]},5439:{albumTitle:"ABBA Gold"}};

function updateRecords(records, id, prop, value) {
  const record = records[id];

  if (!value) {
    delete record[prop];
    return records;
  }

  if (prop === 'tracks') {    
    record[prop] ??= [];
    record[prop].push(value);
    return records;
  } 

  record[prop] = value;
  return records;
};

console.log(updateRecords(recordCollection, 5439, 'artist', 'ABBA')[5439]);
console.log(updateRecords(recordCollection, 5439, "tracks", "Take a Chance on Me")[5439]);
console.log(updateRecords(recordCollection, 2548, "artist", "")[2548])
console.log(updateRecords(recordCollection, 1245, "tracks", "Addicted to Love")[1245])
console.log(updateRecords(recordCollection, 2548, "tracks", "")[2548])
console.log(updateRecords(recordCollection, 1245, "albumTitle", "Riptide")[1245])
.as-console-wrapper {max-height: 100% !important; top: 0}

有人可以在FreecodeCamp上检查我的解决方案是否进行记录收集练习?

三岁铭 2025-01-31 11:31:56

尝试以下操作:

const obj = document.getElementById("mwfps");
obj.style.width = `${Number(obj.style.width)+30}%`

Try this:

const obj = document.getElementById("mwfps");
obj.style.width = `${Number(obj.style.width)+30}%`

如何添加宽度值以增加x量?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文