青衫负雪

文章 评论 浏览 29

青衫负雪 2025-02-20 02:37:20

编辑(固定覆盖):

cat <(crontab -l) <(echo "1 2 3 4 5 scripty.sh") | crontab -

EDIT (fixed overwriting):

cat <(crontab -l) <(echo "1 2 3 4 5 scripty.sh") | crontab -

如何在没有交互式编辑器的情况下使用BASH创建CRON作业?

青衫负雪 2025-02-19 21:54:05

以下片段可以产生您想要的结果,尽管我不确定您想实现什么目标。

降低将在最后一个子阵列中添加数字,直到其中一个与其他结果除以两个相同的结果。

地图将子阵列的数组转换为可观察到的数组

from([1, 3, 5, 2, 4, 1, 3])
  .pipe(
    reduce((result, num) => {
      const lastArray = result[result.length - 1];
      if (lastArray.length > 0 && lastArray[0] % 2 == num % 2) {
        lastArray.push(num);
        result[result.length - 1] = lastArray;
      } else {
        result.push([num]);
      }
      return result;
    }, [[]]),
    map((array: any[]) => array.map((subarray) => from(subarray)))
  )
  .subscribe((res) => {
    res.forEach((obs, i) =>
      obs.subscribe((data) => console.log(data, 'observable ' + i))
    );
  });

The below snippet can produce the results you want, although I'm not sure what you are trying to achieve with this.

The reduce will add numbers to the last subarray, until one of them does not have the same result with the others when divided by two.

The map converts the array of subarrays to array of observables

from([1, 3, 5, 2, 4, 1, 3])
  .pipe(
    reduce((result, num) => {
      const lastArray = result[result.length - 1];
      if (lastArray.length > 0 && lastArray[0] % 2 == num % 2) {
        lastArray.push(num);
        result[result.length - 1] = lastArray;
      } else {
        result.push([num]);
      }
      return result;
    }, [[]]),
    map((array: any[]) => array.map((subarray) => from(subarray)))
  )
  .subscribe((res) => {
    res.forEach((obs, i) =>
      obs.subscribe((data) => console.log(data, 'observable ' + i))
    );
  });

working example

窗口状态

青衫负雪 2025-02-19 21:28:39

您可以分配存储库并更改此行以指向您的分叉存储库:

git clone https://github.com/schollz/find3 && \

You can fork the repository and change this line to point to your forked repository:

git clone https://github.com/schollz/find3 && \

如何在链接到存储库的Docker图像中进行更改?

青衫负雪 2025-02-19 14:07:09

Dotnet 7似乎改善了WASM支持。

It seems that dotnet 7 has improved WASM support. More information is provided in https://devblogs.microsoft.com/dotnet/dotnet-7-wasm/

C#WASM没有大火

青衫负雪 2025-02-19 13:32:49

我不知道这是否足以完成您想完成的工作,但是您可以通过这种样式解决这个问题。如果降低值“ -2”,则间距会增加。
obs:[cordits]:是否可以在文本和下划线线之间强调文本?

 Text(
      "Your Text here",
      style: TextStyle(
        shadows: [
         Shadow(color: Colors.black, 
                offset: Offset(0, -2))
                ],
        color: Colors.transparent,
        decoration: TextDecoration.underline,
        decorationColor: Colors.blue,
        decorationThickness: 4,
        decorationStyle: TextDecorationStyle.solid,
                ),
              ),

I don't know if it will be enough for what you want to accomplish, but you can get around this problem with this style. If you decrease the value "-2" the spacing will increase.
OBS: [credits]: Is it possible to underline text with some height between text and underline line?

 Text(
      "Your Text here",
      style: TextStyle(
        shadows: [
         Shadow(color: Colors.black, 
                offset: Offset(0, -2))
                ],
        color: Colors.transparent,
        decoration: TextDecoration.underline,
        decorationColor: Colors.blue,
        decorationThickness: 4,
        decorationStyle: TextDecorationStyle.solid,
                ),
              ),

Flutter-如何在日历中的日期进行自定义下划线?

青衫负雪 2025-02-19 04:17:33

您可以获取此api

“获取客户端的用户会话返回与此客户端关联的用户会话列表”

get/{realm}/clients/{sessionId}/user-sessions?first = {startIndex}&amp; max = {numberuser}

它位于 https://www.keycloak.org/ docs-api/15.0/rest-api/index.html

这是demo

  1. 获取主管令牌

  2. 获取“帐户 - 康索”客户端ID的列表

  3. 获取IT的用户会话

应该与KeyCloak UI的客户端会话信息匹配

  1. 如果要防止用户的删除会话,请删除分配的领域管理角色

然后他/她无法调用删除用户会话API
“删除特定的用户会话”
delete/{realm}/sessions/{sessionid}

You can get this API

"Get user sessions for client Returns a list of user sessions associated with this client"

GET /{realm}/clients/{sessionId}/user-sessions?first={startIndex}&max={numberUser}

It is located in https://www.keycloak.org/docs-api/15.0/rest-api/index.html

This is demo

  1. Get master admin token
    enter image description here

  2. Get the list of "Account-console" client ID
    enter image description here

  3. Get the it's users session
    enter image description here

It should be match with Keycloak UI's client session information
enter image description here

  1. if you want to prevent a deletion session of user, remove assigned realm management role
    enter image description here

Then he/she can't call remove a user session API
"Remove a specific user session"
DELETE /{realm}/sessions/{sessionId}

KeyCloak用户的活动会话信息

青衫负雪 2025-02-18 09:14:12

类型定义类型InventoryItem 与您在函数定义中使用的通用类型&lt; invoctoryItem&gt; 相撞。在这种情况下,通用类型正在覆盖此功能范围的定义类型。

由于您没有限制通用类型 intectoryItem 是任何特定形状,因此Typescript无法读取属性 upc ,因为没有迹象表明通用类型的变量库存ITEM 应具有此类属性。

看起来您真的不需要这种通用类型。只需将其删除即可解决问题。

async getInventoryItem(upc) : InventoryItem | Error {}

如果您需要通用类型,我建议将其重命名并限制它。

async function getInventoryItem<I extends InventoryItem>(upc) : InventoryItem | Error {
    let response = await fetch(url, options);
    let firstItem : I;
    let secondItem : I;

    /* ... */
}

The type definition type InventoryItem is colliding with the generic type <InventoryItem> that you used in the function defintion. In this case the generic type is overriding the defined type for the scope of this function.

Since you did not constrain the generic type InventoryItem to be of any particular shape, TypeScript can not read property upc since there is no indication that a variable of the generic type InventoryItem should have such property.

It does not look like you really need this generic type. Just removing it should fix the problem.

async getInventoryItem(upc) : InventoryItem | Error {}

If you need the generic type, I would suggest renaming it and constraining it.

async function getInventoryItem<I extends InventoryItem>(upc) : InventoryItem | Error {
    let response = await fetch(url, options);
    let firstItem : I;
    let secondItem : I;

    /* ... */
}

当它确实存在时,属性在类型上不存在

青衫负雪 2025-02-18 08:21:52

您可以尝试使用linkText。

driver.findelement(By.xpath("//span[text()='Recepción de Documentos']/../a).Click();

You can try using linktext.

driver.findelement(By.xpath("//span[text()='Recepción de Documentos']/../a).Click();

如何单击&lt; a&gt;锚标签链接仅知道其硒C#的跨度

青衫负雪 2025-02-18 08:09:06

使用PostgreSQL 9.6(或更高)尝试使用 REGEXP_SPLIT_TO_ARRAY(),因为支持了积极的lookBehind:

WITH S AS (SELECT REGEXP_SPLIT_TO_ARRAY('[email protected]', '(?<=^.|@)') AS ARR) SELECT CONCAT(UPPER(ARR[1]),LOWER(ARR[2]),ARR[3]) FROM S

请参阅在线 demo


这将是:

  • 大写第一个角色;
  • 在“@'之前,其他任何内容;
  • 在“@”之后保持所有内容。

模式(?字面的“@”。


注意:,如果您不希望从'@' - 开始的子字符串,请尝试:

WITH S AS (SELECT REGEXP_SPLIT_TO_ARRAY('[email protected]', '(?<=^.)|@.*') AS ARR) SELECT CONCAT(UPPER(ARR[1]),LOWER(ARR[2])) FROM S

或,不 REGEX()

WITH S AS (SELECT LOWER(SPLIT_PART('[email protected]', '@', 1)) AS X) SELECT UPPER(LEFT(X,1))||SUBSTRING(X,2) FROM S

请参阅在线 demo

With PostgreSQL 9.6 (or above) try to utilize REGEXP_SPLIT_TO_ARRAY() since a positive lookbehind is supported:

WITH S AS (SELECT REGEXP_SPLIT_TO_ARRAY('[email protected]', '(?<=^.|@)') AS ARR) SELECT CONCAT(UPPER(ARR[1]),LOWER(ARR[2]),ARR[3]) FROM S

See an online demo.


This would:

  • Uppercase the first character;
  • Lowercase anything else before '@';
  • Keep everything intact after '@'.

The pattern (?<=^.|@) means to match any position preceded by the start of the string and any character or by an literal '@'.


Note: In case you don't want the substring from '@'-onwards, try:

WITH S AS (SELECT REGEXP_SPLIT_TO_ARRAY('[email protected]', '(?<=^.)|@.*') AS ARR) SELECT CONCAT(UPPER(ARR[1]),LOWER(ARR[2])) FROM S

Or, without REGEX():

WITH S AS (SELECT LOWER(SPLIT_PART('[email protected]', '@', 1)) AS X) SELECT UPPER(LEFT(X,1))||SUBSTRING(X,2) FROM S

See an online demo

postgresql中的initcap

青衫负雪 2025-02-18 06:18:30

您还可以向我们展示 navbar 代码吗?不能真正说出不看代码的情况下出了什么问题。

编辑:
问题是,当您导入使用命名导入的Navbar组件(带有卷曲括号的导入)和Navbar组件时
是默认导出,因此您应该使用类似默认的导入:

import Navbar from "../components/schema/Navbar"

注意没有卷发括号。

查看此博客文章-https://vhudyma-blog.eu/2020-09-27-default-vs-vs-named-export-what-is-the-difference/

Could you show us the Navbar code as well? can't really say what's going wrong without taking a look at the code.

Edit:
The problem is, when you import the Navbar component you are using a named import (an import with curly braces), and your Navbar component
is a default export, so you should use a default import like so:

import Navbar from "../components/schema/Navbar"

notice there are no curly braces.

check out this blog post -https://vhudyma-blog.eu/2020-09-27-default-vs-named-export-what-is-the-difference/

NAVBAR组件在正常情况下工作,但破坏了Getstatic Props

青衫负雪 2025-02-18 00:42:36

检查弹簧安全文档 - https://docs.spring.io/spring-security/referenty/5.6.5/servlet/test/method.html#test-method-method-withmockuser

您可以使用 @withmockuser 注释,它提供用户名 - 用户和密码 - 密码以及角色-COARE_USER的默认凭据

Check the Spring Security Documentation - https://docs.spring.io/spring-security/reference/5.6.5/servlet/test/method.html#test-method-withmockuser

You can use the @WithMockUser annotation, which provides default credentials with username - user and password - password, and with the role - ROLE_USER

如何将身份验证添加到控制器测试弹簧中?

青衫负雪 2025-02-17 15:53:09

保罗·莱恩(Paul Lehn :

iOS 14+

import UniformTypeIdentifiers

// url to the file in the file system
func mimeTypeForURL(_ url: URL) -> String? {
    let pathExtension = url.pathExtension
    
    guard let uti = UTType(filenameExtension: pathExtension),
       let mimeType = uti.preferredMIMEType else {
        return nil
    }
    
    return mimeType
}

Answer that provided by Paul Lehn(most liked answer) didn't work for me, because I'm developing for iOS 16 at this moment, due to deprecation of methods that was used in his solution, I decided to refactor the code a bit:

iOS 14+

import UniformTypeIdentifiers

// url to the file in the file system
func mimeTypeForURL(_ url: URL) -> String? {
    let pathExtension = url.pathExtension
    
    guard let uti = UTType(filenameExtension: pathExtension),
       let mimeType = uti.preferredMIMEType else {
        return nil
    }
    
    return mimeType
}

Swift中的路径扩展和MIME类型的文件类型

青衫负雪 2025-02-17 11:14:40

有趣的是,基本r 汇总's data.frame 方法在这里未显示,上面使用公式接口,因此要完整:

aggregate(
  x = df1[c("x1", "x2")],
  by = df1[c("year", "month")],
  FUN = sum, na.rm = TRUE
)

更多地使用centregate的数据。FRAME方法:

因为我们提供了

  • data.frame 作为 x
  • list data.frame 也是 list )as by ,此如果我们需要以动态方式使用它,则非常有用,例如,使用其他列进行汇总和汇总的列,也很简单,
  • 也很简单,例如自定义的聚合函数

,例如这样:

colsToAggregate <- c("x1")
aggregateBy <- c("year", "month")
dummyaggfun <- function(v, na.rm = TRUE) {
  c(sum = sum(v, na.rm = na.rm), mean = mean(v, na.rm = na.rm))
}

aggregate(df1[colsToAggregate], by = df1[aggregateBy], FUN = dummyaggfun)

Interestingly, base R aggregate's data.frame method is not showcased here, above the formula interface is used, so for completeness:

aggregate(
  x = df1[c("x1", "x2")],
  by = df1[c("year", "month")],
  FUN = sum, na.rm = TRUE
)

More generic use of aggregate's data.frame method:

Since we are providing a

  • data.frame as x and
  • a list (data.frame is also a list) as by, this is very useful if we need to use it in a dynamic manner, e.g. using other columns to be aggregated and to aggregate by is very simple
  • also with custom-made aggregation functions

For example like so:

colsToAggregate <- c("x1")
aggregateBy <- c("year", "month")
dummyaggfun <- function(v, na.rm = TRUE) {
  c(sum = sum(v, na.rm = na.rm), mean = mean(v, na.rm = na.rm))
}

aggregate(df1[colsToAggregate], by = df1[aggregateBy], FUN = dummyaggfun)

汇总 /总结每个组的多个变量(例如总和,平均值)

青衫负雪 2025-02-17 09:19:27

您可以使用本机PHP函数 json_decode 并像下面的那样访问它:

$data = '{"result":[{"telemetry":{"actual.remaining.mileage":26.81,"position":{"altitude":0,"direction":0,"latitude":34.799687,"longitude":7.478863,"satellites":0,"speed":0},"position.altitude":0,"vehicle.mileage":624.071},"connected":true}]}';
$data = json_decode($data, true);

return $data['result'][0]['telemetry']['actual.remaining.mileage']; //returns 26.81

You can convert the JSON to a PHP array using the native PHP function json_decode and access it like below:

$data = '{"result":[{"telemetry":{"actual.remaining.mileage":26.81,"position":{"altitude":0,"direction":0,"latitude":34.799687,"longitude":7.478863,"satellites":0,"speed":0},"position.altitude":0,"vehicle.mileage":624.071},"connected":true}]}';
$data = json_decode($data, true);

return $data['result'][0]['telemetry']['actual.remaining.mileage']; //returns 26.81

当键包含PHP期间时,如何选择JSON值

青衫负雪 2025-02-17 06:23:06

添加 display:'inline-block'到您的 box ,然后更改 span to p 在您的价格中

<Box
  component="span"
  sx={{
    p: 2,
    border: 3,
    borderColor: "error.main",
    display: "inline-block",
    textAlign: "center"
  }}
>
  Sensex
  <Grid component="p" sx={{ p: 0 }}>
    {row.data.price}
  </Grid>
</Box>

Add display: 'inline-block' to your Box and change span to p in your price

<Box
  component="span"
  sx={{
    p: 2,
    border: 3,
    borderColor: "error.main",
    display: "inline-block",
    textAlign: "center"
  }}
>
  Sensex
  <Grid component="p" sx={{ p: 0 }}>
    {row.data.price}
  </Grid>
</Box>

如何在材料UI中的盒子组件中添加标题?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

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