波浪屿的海角声

文章 评论 浏览 29

波浪屿的海角声 2025-02-21 00:58:09
const data = ["earth (c-137)", "abadango", "citadel of ricks", "worldender's lair", "anatomy park", "interdimensional cable", "immortality field resort", "post-apocalyptic earth", "purge planet", "venzenulon 7", "bepis 9", "cronenberg earth", "nuptia 4", "giant's town", "bird world", "st. gloopy noops hospital", "earth (5-126)", "mr. goldenfold's dream", "gromflom prime", "earth (replacement dimension)", "testicle monster dimension", "signus 5 expanse", "earth (c-500a)", "rick's battery microverse", "the menagerie", "earth (k-83)", "hideout planet", "unity's planet", "dorian 5", "earth (unknown dimension)", "earth (j19ζ7)", "roy: a life well lived", "eric stoltz mask earth", "earth (evil rick's target dimension)", "planet squanch", "glaagablaaga", "resort planet", "interdimensional customs", "galactic federation prison", "gazorpazorp"]

const howMany = (data, char) => data.join('').match(new RegExp(char, 'g')).length

console.log(howMany(data, 'p'))

const data = ["earth (c-137)", "abadango", "citadel of ricks", "worldender's lair", "anatomy park", "interdimensional cable", "immortality field resort", "post-apocalyptic earth", "purge planet", "venzenulon 7", "bepis 9", "cronenberg earth", "nuptia 4", "giant's town", "bird world", "st. gloopy noops hospital", "earth (5-126)", "mr. goldenfold's dream", "gromflom prime", "earth (replacement dimension)", "testicle monster dimension", "signus 5 expanse", "earth (c-500a)", "rick's battery microverse", "the menagerie", "earth (k-83)", "hideout planet", "unity's planet", "dorian 5", "earth (unknown dimension)", "earth (j19ζ7)", "roy: a life well lived", "eric stoltz mask earth", "earth (evil rick's target dimension)", "planet squanch", "glaagablaaga", "resort planet", "interdimensional customs", "galactic federation prison", "gazorpazorp"]

const howMany = (data, char) => data.join('').match(new RegExp(char, 'g')).length

console.log(howMany(data, 'p'))

查找一个名称数组中包含了多少次字符

波浪屿的海角声 2025-02-20 21:12:18

@input()属性在这里允许您将一个值绑定到组件上的变量,如果您想让父母根据组件数据进行某些操作,则可能需要使用> @output()并发出自定义事件。如果要求只是收听单击事件,则添加(单击)= functionTobeCalled()应该在此处帮助您的原因。

您也可以参考官方文档:
https://angular.io/guide/guide/inputs-ustputs

the @Input() attribute here allows you to bind a value to a variable on your component, if you want to have the parent do something based on your components data, you might want to use @Output() and emit a custom event. If the requirement is just listen to a click event then adding a (click)=functionToBeCalled() should help your cause here.

You can refer to the official docs as well:
https://angular.io/guide/inputs-outputs

如何通过参考通过角指令?

波浪屿的海角声 2025-02-20 20:07:35

您可以使用两个服务或两个曝光端口的服务
您可以尝试2个服务:
与这样的部署:

spec:
      containers:
        - name: container1
          image:image1
          ports:
            - containerPort: 8080
        - name: container2
          image: image1 
          ports:
            - containerPort: 8081

和服务:

kind: Service
apiVersion: v1
metadata:
  name: container1
  annotations:
    version: v1.0
spec:
  selector:
    component: <deployment>
  ports:
     - name: container1
       port: 8080
       targetPort: 8080
  type: ClusterIP           
---
kind: Service
apiVersion: v1
metadata:
  name: container2
  annotations:
    version: v1.0
spec:
  selector:
    component: <deployment>
  ports:
     - name: container2
       port: 8080
       targetPort: 8081
  type: ClusterIP

You can use two services or one service with two exposed ports
you can try 2 services :
with the deployment like this :

spec:
      containers:
        - name: container1
          image:image1
          ports:
            - containerPort: 8080
        - name: container2
          image: image1 
          ports:
            - containerPort: 8081

and the services :

kind: Service
apiVersion: v1
metadata:
  name: container1
  annotations:
    version: v1.0
spec:
  selector:
    component: <deployment>
  ports:
     - name: container1
       port: 8080
       targetPort: 8080
  type: ClusterIP           
---
kind: Service
apiVersion: v1
metadata:
  name: container2
  annotations:
    version: v1.0
spec:
  selector:
    component: <deployment>
  ports:
     - name: container2
       port: 8080
       targetPort: 8081
  type: ClusterIP

如何将具有多个容器的Kubernetes部署连接到单个服务的多个服务端口?

波浪屿的海角声 2025-02-20 16:16:08

使用此

reqBodyAddress.addressType = {
                home:'home'
            ...(current.u_domicilio && {mailing:'mailing'})

}

功能首先更可读,并正确工作。尝试使用const,并让我们避免使用var在JS代码中声明变量。

您的地址类型属性必须获得值的对象,对吗?那么,为什么要为其值使用函数呢?
另外,您不能将两个对象与 +运算符合并。
希望此代码能够解决您的问题。

use this

reqBodyAddress.addressType = {
                home:'home'
            ...(current.u_domicilio && {mailing:'mailing'})

}

it's more readable first, and work correct. try to use const and let and avoid to use var for declaring variable in your js code.

your addressType property must get an object for value, right? so why do you use function for its value?
also you can't merge two object with + operator.
i hope this code solve your problem.

创建两个具有不同值JavaScript的对象

波浪屿的海角声 2025-02-20 15:12:56

&lt; input type =“ password”&gt;

这将在输入时在密码字段中显示星号或弹头点(取决于浏览器),并阻止屏幕阅读器宣布您的字母打字。但这也意味着用户必须是触摸式的人,因为他们不会听到他们在打字的声音。屏幕读取器在输入时只会说“ Star Star”。

<input type="password">

This will displays asterisks or bullet points (depending on the browser) in the password field as you type and will prevent the screen reader from announcing the letter you're typing. But it also means the user must be a touch-typist because they won't hear what they're typing. The screen reader will just say "star star star" as you type.

在键盘上键入任何键时,如何防止下巴读取密码?

波浪屿的海角声 2025-02-20 14:42:51

看起来它已被弃用并从最新的Lombok版本中删除。除 Javadoc

Looks like it is deprecated and removed from the latest Lombok version. No helpful documentation apart from this javadoc

未知的属性generateLombokConfig。在将Gradle从6.9到7.3效

波浪屿的海角声 2025-02-20 13:44:30

尝试此代码:

total = 0
for number in range(1, 101):
    total += number
    print(total)

Try this code:

total = 0
for number in range(1, 101):
    total += number
    print(total)

高斯添加-Python挑战

波浪屿的海角声 2025-02-20 07:38:19

我要发布此答案,因为我的VirtualMin/Webmin Admin界面认为禁用我的PHP引擎是一个好主意。

另外,请务必检查您的网站配置文件是否与此特定主机或VirtualHost相关的任何网站配置文件中都有任何PHP_ADMIN_VALUE在其中关闭php,诸如此类:

php_admin_value engine Off

如有疑问,请发表评论...

# php_admin_value engine Off

并重新启动您的Web服务器。

I'm posting this answer because my Virtualmin/Webmin admin interface decided it was a good idea to disable my PHP engine.. took me a while to find the solution, so I thought I'd share it with you guys:

Also, be sure to check that none of your website config files related to this specific host or virtualhost have any php_admin_value's in them that turn off PHP, like this:

php_admin_value engine Off

When in doubt, comment it...

# php_admin_value engine Off

And restart your webserver.

PHP代码尚未执行,但代码在浏览器源代码中显示

波浪屿的海角声 2025-02-20 07:36:09

在重新恢复耗尽之前,容器对例外情况一无所知。

您需要自定义重试策略,以免为该例外重试。

目前使用应用程序属性是不可能的。您需要将重试拦截器配置为bean并将其注入容器工厂。

如果您需要帮助,我可以添加一个示例。

The container knows nothing about the exception until retries are exhausted.

You would need to customize the retry policy to not retry for that exception.

This is currently not possible using application properties; you would need to configure the retry interceptor as a bean and inject it into the container factory.

If you need help with that, I can add an example.

扔AmqprejectanddontrequeueException后,RabbitMQ消息仍会重试

波浪屿的海角声 2025-02-20 02:59:54

只需在任务中添加ansible_python_interpreter变量,然后将其指向您的python安装:

$ cat elastic.yml 
- name: community.docker.docker_compose
  hosts: localhost
  gather_facts: no
  tasks:
    - name: state:present
      community.docker.docker_compose:
        project_src: "/opt/X/{{item}}"
        files: [ "docker-compose.yml" , "docker-compose.override.yml" ]
        state: present
      vars:
        ansible_python_interpreter: /usr/bin/python3
      with_items:
        - kubefwd
        #- auditbeat
        - filebeat
        - kibana
        - logstash
        - metricbeat
        #- packetbeat

Simply add a ansible_python_interpreter variable to your task and point it to your python installation like this:

$ cat elastic.yml 
- name: community.docker.docker_compose
  hosts: localhost
  gather_facts: no
  tasks:
    - name: state:present
      community.docker.docker_compose:
        project_src: "/opt/X/{{item}}"
        files: [ "docker-compose.yml" , "docker-compose.override.yml" ]
        state: present
      vars:
        ansible_python_interpreter: /usr/bin/python3
      with_items:
        - kubefwd
        #- auditbeat
        - filebeat
        - kibana
        - logstash
        - metricbeat
        #- packetbeat

ModulenotFoundError:No模块名为&#x27; Compose&#x27;

波浪屿的海角声 2025-02-19 18:45:22

productn可能是 text ,因此请尝试插入丢失的报价:

=DLookUp("ProductName","List","ProductN = '" & [Textbox#1] & "'")

ProductN is probably text, so try inserting the missing quote:

=DLookUp("ProductName","List","ProductN = '" & [Textbox#1] & "'")

使用文本框更新MS访问中的另一个文本框

波浪屿的海角声 2025-02-19 17:19:02

提取日期并秘密到工作日

我将使用gnu awk按下此任务,让file.txt上下文

Date
2022-06-09 22:30:20
2022-06-10 15:55:21
2022-06-11 00:34:05
2022-06-11 19:51:52
2022-06-13 11:34:10
2022-06-15 03:59:54
2022-06-18 16:13:20
2022-06-19 00:24:21
2022-06-19 00:25:36
2022-06-19 00:25:36
2022-06-19 00:25:49

进行

awk 'BEGIN{FS="-| |:"}NR==1{print "Date","Weekday"}NR>1{t=mktime($1 " " $2 " " $3 " " $4 " " $5 " " $6);print $0,strftime("%A",t)}' file.txt

输出

Date Weekday
2022-06-09 22:30:20 Thursday
2022-06-10 15:55:21 Friday
2022-06-11 00:34:05 Saturday
2022-06-11 19:51:52 Saturday
2022-06-13 11:34:10 Monday
2022-06-15 03:59:54 Wednesday
2022-06-18 16:13:20 Saturday
2022-06-19 00:24:21 Sunday
2022-06-19 00:25:36 Sunday
2022-06-19 00:25:36 Sunday
2022-06-19 00:25:49 Sunday

说明:首先,我告知gnu awk awk该字段分隔符为-或 (space)或,然后对于第一行i打印标头,对于第一行之后的所有行我使用时间函数代码>将字符串如yyyy MM DD HH MM SS转换为时间戳(数量自开始开始以来,我使用strftime将所述变量转换为字符串,%a表示全日日名称。

(在GAWK 4.2.1中测试)

fetch date and covert into weekday

I would use GNU AWK for this task following way, let file.txt context be

Date
2022-06-09 22:30:20
2022-06-10 15:55:21
2022-06-11 00:34:05
2022-06-11 19:51:52
2022-06-13 11:34:10
2022-06-15 03:59:54
2022-06-18 16:13:20
2022-06-19 00:24:21
2022-06-19 00:25:36
2022-06-19 00:25:36
2022-06-19 00:25:49

then

awk 'BEGIN{FS="-| |:"}NR==1{print "Date","Weekday"}NR>1{t=mktime($1 " " $2 " " $3 " " $4 " " $5 " " $6);print $0,strftime("%A",t)}' file.txt

gives output

Date Weekday
2022-06-09 22:30:20 Thursday
2022-06-10 15:55:21 Friday
2022-06-11 00:34:05 Saturday
2022-06-11 19:51:52 Saturday
2022-06-13 11:34:10 Monday
2022-06-15 03:59:54 Wednesday
2022-06-18 16:13:20 Saturday
2022-06-19 00:24:21 Sunday
2022-06-19 00:25:36 Sunday
2022-06-19 00:25:36 Sunday
2022-06-19 00:25:49 Sunday

Explanation: firstly I inform GNU AWK that field separator is - or (space) or :, then for 1st line I print header, for all lines after 1st I use Time Functions, mktime converts string like YYYY MM DD HH MM SS into timestamp (number of seconds since start of epoch), then I use strftime to convert said variable into string, %A denotes full weekday name.

(tested in gawk 4.2.1)

提取日期并秘密到工作日

波浪屿的海角声 2025-02-19 14:24:15

2种方法:

第一方式:

制作一个名为app.scss内部的文件@import“ file.scss”包括所有文件。

然后.sass('Resource/Sass/App.scss','public/css')
但是,这将使所有文件成为一个文件。这可能不是您所追求的。

第二种方式:

const fs = require("fs");

fs.readdirSync("resources/scss/").forEach(fileName => 
    mix.scss(`resources/scss/${fileName}`, "public/css"));

这将使它们全部放在单个文件中。

2 ways:

1st way:

Make a file called app.scss and inside of this @import "file.scss" include all files.

then .sass('resources/sass/app.scss', 'public/css')
This will however make all files a single file. This may not be what you are after.

2nd way:

const fs = require("fs");

fs.readdirSync("resources/scss/").forEach(fileName => 
    mix.scss(`resources/scss/${fileName}`, "public/css"));

This will keep them all in single files.

Laravel Mix:一行编译所有SCSS文件

波浪屿的海角声 2025-02-19 09:23:28

您只需要将time.sleep(executionTime) 选择 select ,而 loop无需。我认为这是您想要的,但要注意这不是一个好练习。因此,请查看下面的警告

func doSomething(ctx context.Context) {
    executionTime := time.Duration(rand.Intn(5)+1) * time.Second
    processed := make(chan int)

    go func() {
        time.Sleep(executionTime)
        processed <- 1
    }()

    select {
    case <-ctx.Done():
        fmt.Printf("timed out after %s\n", executionTime)
    case <-processed:
        fmt.Printf("did something in %s\n", executionTime)
    }
}

obs :我更改了原始答案。我们无法在执行中中断goroutine。我们可以将长期运行的任务委托给另一个goroutine,并通过专用渠道接收结果。

警告:我不建议您期望处理时间超过截止日期,因为现在您将有一个泄漏的Goroutine。

You just need to put the time.Sleep(executionTime) outside the select and there is no need for the for loop. I think this is somehow what you want but beware that it's not good practice. So take a look at the warning below.

func doSomething(ctx context.Context) {
    executionTime := time.Duration(rand.Intn(5)+1) * time.Second
    processed := make(chan int)

    go func() {
        time.Sleep(executionTime)
        processed <- 1
    }()

    select {
    case <-ctx.Done():
        fmt.Printf("timed out after %s\n", executionTime)
    case <-processed:
        fmt.Printf("did something in %s\n", executionTime)
    }
}

Obs: I changed the original answer a bit. We can not interrupt a goroutine in the middle of its execution. We could delegate the long-running task to another goroutine and receive the result through a dedicated channel.

Warning: I wouldn't recommend that if you expect the processing time to exceed the deadline because now you will have a leaking goroutine.

每秒钟以上下文超时运行功能

波浪屿的海角声 2025-02-19 04:36:00

game_summary_df [1,1]%&gt;%str_extract((?&lt; = white)。*(?= \\]))>

game_summary_df[1,1] %>% str_extract((?<=White ).*(?=\\]))

(R编程)在保留中间的同时,如何在R中的数据框中缩小字符串的启动和结尾?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

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