吝吻

文章 评论 浏览 30

吝吻 2025-02-14 08:44:18

to_number()支持转换错误处理。

select   *
from     t
order by TO_NUMBER(col1 DEFAULT null ON CONVERSION ERROR) nulls last
        ,col1
  
col1
1
2
11
55
60
72
75
77
82
85
90
118
3B1
3B2
端口/0/635
U1

小提琴

to_number() supports conversion error handling.

select   *
from     t
order by TO_NUMBER(col1 DEFAULT null ON CONVERSION ERROR) nulls last
        ,col1
  
COL1
1
2
11
55
60
72
75
77
82
85
90
118
3B1
3B2
PORT/0/635
u1

Fiddle

排序Oracle中的字母数字列值

吝吻 2025-02-14 07:09:55

正如BoxDog提出的那样,这适用于我的情况:

(cat a.txt) -replace '\s+', ' ' | echo

代码

As boxdog proposed, this works for my case:

(cat a.txt) -replace '\s+', ' ' | echo

code

如何使用管道操作员使用方法

吝吻 2025-02-14 01:47:22

您可以将几行空的排为空,然后在下面的文本下方,当您的搜索需要完成时,删除空行,为什么要浪费更多的扩展空间或类似的东西。

You can just left few line empty and then text come below, when your search need complete, remove empty line, why wasting more space in extension or something like that.

如何在VS代码中停止在文件顶部浮在文件顶部的编辑窗口框?

吝吻 2025-02-13 20:17:13

考虑emptyview与接口固执一样(要在需要视图的地方放置一些东西,但在某个时候没有任何可提供的)。实际上,它没有插入视图层次结构,因此.onappear未调用,因为什么都没有出现。

Consider EmptyView is just as interface stub (to put something where view is required but at some moment there is nothing to provide). It is in a fact not inserted into view hierarchy, so .onAppear is not called, because nothing appears.

swiftui:emptyview()。onappear {}正式存在,但在显示视图时未调用?

吝吻 2025-02-13 17:53:06

您可以在另一个线程中等待,以免阻止主线程,
尝试此代码应正确工作,将命令内的代码移动到另一个线程,以免阻止UI:

private const val TAG = "MainActivity"
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
    division()
}

private fun division() {
    val numerator = 60
    var denominator = 4
    lifecycleScope.launch {
        repeat(4) {
            delay(1000)
            Log.v(TAG, "${numerator / denominator}")
            val view: TextView = findViewById(R.id.division_textview)
            view.setText("${numerator / denominator}")
            denominator--
        }
    }
}

注意:您需要确保在应用程序gradle中添加生命周期依赖性依赖关系

dependencies {
    ...
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
    ...
}

You can wait in another thread so you don't block the main thread,
try this code it should work correctly, the code inside the lifecycleScope.launch will be moved to another thread so it will not block the UI:

private const val TAG = "MainActivity"
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
    division()
}

private fun division() {
    val numerator = 60
    var denominator = 4
    lifecycleScope.launch {
        repeat(4) {
            delay(1000)
            Log.v(TAG, "${numerator / denominator}")
            val view: TextView = findViewById(R.id.division_textview)
            view.setText("${numerator / denominator}")
            denominator--
        }
    }
}

Note: You need to be sure that you add the lifecycle dependency in you app gradle

dependencies {
    ...
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
    ...
}

仅在计算后才会出现主动脉视图

吝吻 2025-02-13 15:20:44

在这种情况下,您可以将文件转换为JSON ,然后使用:

resource "random_string" "any_string" {
    for_each = toset(jsondecode(format("[%s]",file("string_number_file.txt"))))
    length = each.key
}

In that case you can convert your file to json, and then use that:

resource "random_string" "any_string" {
    for_each = toset(jsondecode(format("[%s]",file("string_number_file.txt"))))
    length = each.key
}

我可以使用文件函数使用for_each meta-argument吗?

吝吻 2025-02-13 13:08:02

axios.put返回承诺,您不在等待响应。调用getData函数。然后在函数中使用异步等待:

 axios.put(`https://blah.mockapi.io/fakeData/${id}`, {
            ...
        }).then(() => **getData()**)
        

Axios.put returns a promise and you are not waiting for the response. Invoke the getData function inside the .then function or use async await:

 axios.put(`https://blah.mockapi.io/fakeData/${id}`, {
            ...
        }).then(() => **getData()**)
        

从子组件调用的React父函数不会更新状态?

吝吻 2025-02-13 02:49:48
import dateutil.parser


dt_strs = [
'2022-06-03T17:00:00.000000000',
'2022-06-04T09:40:00.000000000',
'2022-06-05T02:20:00.000000000',
'2022-06-05T19:00:00.000000000',
'2022-06-06T11:40:00.000000000',
'2022-06-07T04:20:00.000000000',
'2022-06-07T21:00:00.000000000',
'2022-06-08T13:40:00.000000000',
'2022-06-09T06:20:00.000000000',
]

for dt_str in dt_strs:
    print(dateutil.parser.isoparse(dt_str).strftime("%Y-%M-%d %H:%M"))

输出:

2022-00-03 17:00
2022-40-04 09:40
2022-20-05 02:20
2022-00-05 19:00
2022-40-06 11:40
2022-20-07 04:20
2022-00-07 21:00
2022-40-08 13:40
2022-20-09 06:20
import dateutil.parser


dt_strs = [
'2022-06-03T17:00:00.000000000',
'2022-06-04T09:40:00.000000000',
'2022-06-05T02:20:00.000000000',
'2022-06-05T19:00:00.000000000',
'2022-06-06T11:40:00.000000000',
'2022-06-07T04:20:00.000000000',
'2022-06-07T21:00:00.000000000',
'2022-06-08T13:40:00.000000000',
'2022-06-09T06:20:00.000000000',
]

for dt_str in dt_strs:
    print(dateutil.parser.isoparse(dt_str).strftime("%Y-%M-%d %H:%M"))

Output:

2022-00-03 17:00
2022-40-04 09:40
2022-20-05 02:20
2022-00-05 19:00
2022-40-06 11:40
2022-20-07 04:20
2022-00-07 21:00
2022-40-08 13:40
2022-20-09 06:20

如何在海洋热图中指定tick标签的日期时间格式

吝吻 2025-02-13 00:41:05

有时,Gorm在进行复杂的查询或其他方面尚不支持时会产生不必要的SQL。要确保GORM为您生成正确的SQL,可以使用.tosql函数检查它做GORS尚未支持的事情。

db.Raw("SELECT * FROM products WHERE info -> 'buyers' @> '[{\"name\": \"Jane Doe\"}]'").Scan(&result)

https://gorm.io/docs/sql_builder..html

Sometimes GORM generate unwanted SQL when doing complex query or something has not supported yet. To make sure GORM generate the right SQL for you, you can check it by using .ToSQL function or you can create raw query by using .Raw with .Scan to do something that GORM has not supported yet.

db.Raw("SELECT * FROM products WHERE info -> 'buyers' @> '[{\"name\": \"Jane Doe\"}]'").Scan(&result)

https://gorm.io/docs/sql_builder.html

搜索JSONB DATA GORM& Postgresql

吝吻 2025-02-12 10:54:26

您可以在集群中的每个主机上删除最新的(现已损坏的)/var/mmarklogic/databases.xml。 MarkLogic现在将从上一个配置文件开始。

You could delete the most recent (now corrupted) /var/opt/MarkLogic/databases.xml on each of the hosts in the cluster. MarkLogic will now start with the previous configuration file instead.

在删除字段范围索引上已删除的标记数据库

吝吻 2025-02-12 03:27:16

为我删除应用程序/清除缓存问题。

Removing app/clearing cache fixed issue for me.

Google Maps在包含映射的每个屏幕中崩溃(' int android.graphics.bitmap.getwidth()'在null对象参考上)

吝吻 2025-02-12 03:26:42

iiuc您需要选择df的行,直至calvo_massflow,calvo_massflow组的长度,然后转换为dict。看起来可能是这样的:

calvo_massflow = [1, 2, 1, 2, 2, 1, 1]

df = pd.DataFrame({"a":[1, 2, 3, 4, 11, 2, 4, 6, 7, 3],
                   "b":[5, 6, 7, 8, 10, 44, 23, 267, 4, 66]})

dic = dict(iter(df.iloc[:len(calvo_massflow)]
            .groupby(calvo_massflow)))
print(dic)

由键1和2的字典产生包含两个过滤数据框的键:

{1:    a   b
 0  1   5
 2  3   7
 5  2  44
 6  4  23,
 2:     a   b
 1   2   6
 3   4   8
 4  11  10}

IIUC you want to select the rows of df up to the length of calvo_massflow, group by calvo_massflow and convert to dict. This might look like this:

calvo_massflow = [1, 2, 1, 2, 2, 1, 1]

df = pd.DataFrame({"a":[1, 2, 3, 4, 11, 2, 4, 6, 7, 3],
                   "b":[5, 6, 7, 8, 10, 44, 23, 267, 4, 66]})

dic = dict(iter(df.iloc[:len(calvo_massflow)]
            .groupby(calvo_massflow)))
print(dic)

resulting in a dictionary with keys 1 and 2 containing two filtered DataFrames:

{1:    a   b
 0  1   5
 2  3   7
 5  2  44
 6  4  23,
 2:     a   b
 1   2   6
 3   4   8
 4  11  10}

将列表更改为词典中的dataframe

吝吻 2025-02-11 17:54:22

我已经与Microsoft谈过了这一点。

我的构建管道中有一个不完整的相关工作项目列表,因为与管道执行相关的更改数量限制为250:

假设我们已经实现了非常重要的“功能”。现在,我们继续工作,并进行250个更改,而无需再次提及“功能A”。在这种情况下,当我们运行构建管道时,“功能a”将永远不会成为相关工作项目的一部分。如果以后使用相关工作项的列表来创建发行说明,这尤其糟糕。

我认为,存在这样的限制是非常危险和误导的。

产品组定义了250个更改的限制,基本上是防止性能降解的阈值。

我衷心希望Microsoft能够消除此限制。

I have spoken with Microsoft about this.

I have an incomplete list of related work items in my build pipeline because the number of changes linked with a pipeline execution is limited to 250:
enter image description here

Let's say we have implemented a very important "Feature A". Now we continue working and make 250 more changes without ever mentioning "Feature A" again. In this case, when we run a build pipeline, "Feature A" will never be part of the related work items. This is especially bad if the list of related work items is later used, for example, to create release notes.

In my opinion, it is very dangerous and misleading that there is such a limit.

The limit for 250 changes was defined by the product group and is basically a threshold to prevent performance degradation.

I sincerely hope that Microsoft will remove this limit.

Azure DevOps:构建管道中相关工作网络的不完整列表

吝吻 2025-02-11 15:39:42

不要做出像输入间隔的方式这样的假设。使用split()而不是split(“”)

Don't make assumptions like how the input is spaced. Use split() instead of split(" ").

runtimeerror在kattis问题上,“工作费用”但是我的本地测试还可以

吝吻 2025-02-11 05:08:52

您可能应该使用样式

import { alpha, styled } from '@mui/material/styles';

const SuccessSlider = styled(Slider)<SliderProps>(({ theme }) => ({
  width: 300,
  color: theme.palette.success.main,
  '& .MuiSlider-thumb': {
    '&:hover, &.Mui-focusVisible': {
      boxShadow: `0px 0px 0px 8px ${alpha(theme.palette.success.main, 0.16)}`,
    },
    '&.Mui-active': {
      boxShadow: `0px 0px 0px 14px ${alpha(theme.palette.success.main, 0.16)}`,
    },
  },
}));

export default function StyledCustomization() {
  return <SuccessSlider defaultValue={30} />;
}

您可以看到同一示例此处。 (尽管上面的示例未显示该选项,但也可以使用道具)。

您可以检查更多在这里

You should probably go with styled:

import { alpha, styled } from '@mui/material/styles';

const SuccessSlider = styled(Slider)<SliderProps>(({ theme }) => ({
  width: 300,
  color: theme.palette.success.main,
  '& .MuiSlider-thumb': {
    '&:hover, &.Mui-focusVisible': {
      boxShadow: `0px 0px 0px 8px ${alpha(theme.palette.success.main, 0.16)}`,
    },
    '&.Mui-active': {
      boxShadow: `0px 0px 0px 14px ${alpha(theme.palette.success.main, 0.16)}`,
    },
  },
}));

export default function StyledCustomization() {
  return <SuccessSlider defaultValue={30} />;
}

You can see this same example here. (Although the above example does not show the option, it is also possible to use props).

You can check more here.

替代业务(makestyles)-MUI V5

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

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