懷念過去

文章 评论 浏览 29

懷念過去 2025-01-31 06:31:58

Kurento没有GPU的支持。

There is no GPU support in Kurento.

Kurento是否通过使用GPU(RTSP流)来支持硬件解码?

懷念過去 2025-01-30 17:41:19

您必须在删除表之前使用$ table-> dropforeign(),请删除外部键以避免此错误。

You must use $table->dropForeign() before deleting the table, Remove the external key to avoid this error.

完整性约束违规:1451无法删除或更新父行:外键约束失败 - Laravel

懷念過去 2025-01-30 10:18:03

在JDK1.8中,您可以使用聚合操作和lambda表达式:

String[] strArray = new String[] {"John", "Mary", "Bob"};

// #1
Arrays.asList(strArray).stream().forEach(s -> System.out.println(s));

// #2
Stream.of(strArray).forEach(System.out::println);

// #3
Arrays.stream(strArray).forEach(System.out::println);

/* output:
John
Mary
Bob
*/

In JDK1.8 you can use aggregate operations and a lambda expression:

String[] strArray = new String[] {"John", "Mary", "Bob"};

// #1
Arrays.asList(strArray).stream().forEach(s -> System.out.println(s));

// #2
Stream.of(strArray).forEach(System.out::println);

// #3
Arrays.stream(strArray).forEach(System.out::println);

/* output:
John
Mary
Bob
*/

什么是打印Java数组的最简单方法?

懷念過去 2025-01-29 22:00:49

您需要使用collection._id而不是收集:{$ elemmatch:{_ id ,因为$ elemmatch用于在数组中找到对象。

因此,您的查询应该看起来像:

db.comic.find({
    characters: {
        $elemMatch:{
            _id: {
                $in: [
                    ObjectId("6244074ab9ebc40007ac2ce5")
                ]
            }
        }
    },
    "collection._id": {
                $in: [ObjectId("6244099cb9ebc40007ac2cfb")]
    }
}).pretty()

You need to use collection._id instead of collection:{$elemMatch:{_id since $elemMatch is for finding an object inside an array.

So your query should look like:

db.comic.find({
    characters: {
        $elemMatch:{
            _id: {
                $in: [
                    ObjectId("6244074ab9ebc40007ac2ce5")
                ]
            }
        }
    },
    "collection._id": {
                $in: [ObjectId("6244099cb9ebc40007ac2cfb")]
    }
}).pretty()

mongodb-找到一个特定的结果,并以不同方式嵌套的文档

懷念過去 2025-01-29 18:02:05

这是一个 iso 8610持续时间根据文档,特定价值是

brokered消息的默认时间到寿命值是最大的
如果未另行指定,则可能的64位整数的可能值。

IE, it's the biggetst .NET TimeSpan, which you get from this code:

   TimeSpan.FromTicks(Int64.MaxValue);

or

   TimeSpan.MaxValue;

10,675,199 days
2 hours 
48 minutes 
5.4775807 seconds

It's an ISO 8610 Duration, exposed in the .NET library as a TimeSpan, and that particular value is, per the docs

The default time-to-live value for a brokered message is the largest
possible value for a signed 64-bit integer if not otherwise specified.

IE, it's the biggetst .NET TimeSpan, which you get from this code:

   TimeSpan.FromTicks(Int64.MaxValue);

or

   TimeSpan.MaxValue;

https://learn.microsoft.com/en-us/azure/service-bus-messaging/message-expiration#entity-level-expiration

or

10,675,199 days
2 hours 
48 minutes 
5.4775807 seconds

“默认消息时间”的价值是什么。对于Azure Service Bus队列?

懷念過去 2025-01-29 13:15:30

我只是遇到了完全相同的问题。我想出的唯一方法是设置MarkeredGecolor =“ none”,它摆脱了圆点周围的圆圈。
可能不是最有效的解决方案,但至少我可以生产所需的地块。

I just had the exact same problem. The only way I figured out was to set markeredgecolor="none", that got rid of the circles around the dots.
Might not be the most efficient solution, but at least I could produce the plots I needed.

Julia savefig()保存错误的标记形状

懷念過去 2025-01-29 08:30:19

我不想处理烧瓶和异步编程

您的代码与任何一个无关。您不需要网络服务器/框架,只有HTTP客户端。您也不需要异步方法,尽管它们可能会帮助HTTP请求。

javaScript中的导入请求和httpbasicauth

您不会。 JavaScript使用 fetch api 它自己的 httpagent。注意:fetch() is 异步编程

但是,您也可以只安装 spotify.js (另外,async,基于Promise,Promise基于Promise)

,JSON不是HTML,而JSON对象是第一类对象在JavaScript中,实际上分析任何搜索结果将大多相同。

I do not wish to have to deal with Flask and asynchronous programming

Your code has nothing to do with either. You dont need a web-server/framework, only an HTTP client. You also don't need async methods, although they might help with the HTTP requests.

import requests and httpBasicAuth in Javascript

You wouldn't. Javascript uses Fetch API for making web requests, and Node has its own HttpAgent. Note: fetch() is asynchronous programming

However, you could also just install spotify.js (also, async, Promise-based)

Regarding your variable names, JSON is not html, and JSON objects are first-class objects in Javascript, so actually parsing any search results would be mostly the same.

如何在Node.js中使用Python的请求,HTTPBASICAUTH和JSON?

懷念過去 2025-01-29 07:10:28

请勿将按钮直接添加到主帧。相反,创建另一个面板并将按钮添加到它:

    Panel newPanel = new Panel(new GridBagLayout());

    Button button0 = new Button("BUTTON_0");
    button0.setBounds(10, 265, 30, 30);
    button0.setFont(new Font("TimesRoman", Font.PLAIN, 14));
    button0.setForeground(Color.blue);
    button0.setFocusable(false);

    Button button1 = new Button("BUTTON_1");
    button1.setBounds(10, 265, 30, 30);
    button1.setFont(new Font("TimesRoman", Font.PLAIN, 14));
    button1.setForeground(Color.blue);
    button1.setFocusable(false);

    newPanel.add(button0);
    newPanel.add(button1);

    this.add(newPanel);

Do not add buttons directly to the main frame. Instead, create another panel and add the buttons to it:

    Panel newPanel = new Panel(new GridBagLayout());

    Button button0 = new Button("BUTTON_0");
    button0.setBounds(10, 265, 30, 30);
    button0.setFont(new Font("TimesRoman", Font.PLAIN, 14));
    button0.setForeground(Color.blue);
    button0.setFocusable(false);

    Button button1 = new Button("BUTTON_1");
    button1.setBounds(10, 265, 30, 30);
    button1.setFont(new Font("TimesRoman", Font.PLAIN, 14));
    button1.setForeground(Color.blue);
    button1.setFocusable(false);

    newPanel.add(button0);
    newPanel.add(button1);

    this.add(newPanel);

我做错了什么,第二个按钮起作用很奇怪?

懷念過去 2025-01-28 19:16:18

在此行上:

color2d.setColorMap(color2d.colormaps.bremmmm,()=> colorpoints());

您使用的是一个变量/类实例首先定义它。 ESLINT告诉您:

src \ colormap.js中的错误

是错误 文件。

'color2d'未定义

错误消息。

no-undef

在ESLINT中(可能在.eslintrc文件或软件包中定义),这导致这是一个错误。

另一方面,Color2D并不是通过其当前状态导入的真正可用,因此您需要将其构建到自己的文件中,并将其从那里导出或将其包含在内。

edit

这是未经测试的,但是,我想,如果您将eark默认color2d添加到color2d.js的底部,然后,您应该能够在文件顶部从'./color2d'导入color2d。

On this line:

Color2D.setColormap(Color2D.colormaps.BREMM, () => colorPoints());

You're using a variable/class instance named Color2D without defining it first. ESLint is telling you:

ERROR in src\ColorMap.js

This is the file the error is in.

Line 48:29:

Line:column where the error is found in that file.

'Color2D' is not defined

Error Message.

no-undef

Rule in eslint (probably defined inside a .eslintrc file or in your package.json) that is causing this to be an error.

On another note, Color2D isn't really usable via import in its current state, so you would need to build it into its own file and export it from there or include it inline.

EDIT

This is untested but, I think if you add export default Color2D to the bottom of color2D.js, you should then be able to import Color2D from './color2d' at the top of your file.

在React中使用2D COLORMAPS JAVASCRIPT插件

懷念過去 2025-01-28 14:00:52

仅关注核心逻辑,请尝试以下操作:

$Entered_Password_01_text = 'foooooo1!' # Experiment with different values here.

$numCriteriaMet = (
  (
    ($Entered_Password_01_text -cmatch '[A-Z]'),     # at least 1 uppercase letter
    ($Entered_Password_01_text -match '[!@#%^&$]'),  # at least 1 special char.
    ($Entered_Password_01_text -match '[0-9]')       # at least 1 digit
  ) -eq $true
).Count

# A password is valid if it is at least 8 chars. long
# and meets at least 2 of the 3 criteria above.
$validOverall = $Entered_Password_01_text.Length -ge 8 -and $numCriteriaMet -ge 2

if (-not $validOverall) { throw 'Invalid password.' }

Write-Verbose -Verbose 'Password is valid.'

Focusing just on the core logic, try the following:

$Entered_Password_01_text = 'foooooo1!' # Experiment with different values here.

$numCriteriaMet = (
  (
    ($Entered_Password_01_text -cmatch '[A-Z]'),     # at least 1 uppercase letter
    ($Entered_Password_01_text -match '[!@#%^&$]'),  # at least 1 special char.
    ($Entered_Password_01_text -match '[0-9]')       # at least 1 digit
  ) -eq $true
).Count

# A password is valid if it is at least 8 chars. long
# and meets at least 2 of the 3 criteria above.
$validOverall = $Entered_Password_01_text.Length -ge 8 -and $numCriteriaMet -ge 2

if (-not $validOverall) { throw 'Invalid password.' }

Write-Verbose -Verbose 'Password is valid.'

用于检查密码标准的PowerShell脚本

懷念過去 2025-01-28 04:27:15

将面板添加到网格器中后,您需要在框架上调用Layout(),以在其适当的位置查看刚添加的窗户。

self.Layout()

如果在任何情况下都有太多的布局()调用,您可以看到一个一个一个一个一个一个添加的子窗,您可以对其进行以下操作:冻结框架,然后将其融化。

self.Freeze()

#self.Layout() calls

self.Thaw()

After you added the panels to your gridsizer, you need to call Layout() on your frame to see your freshly added windows in their proper place.

self.Layout()

If there are too many Layout() calls in any case, you could see the child windows added one by one, you can do the following against it: Freeze your frame, and thaw it after.

self.Freeze()

#self.Layout() calls

self.Thaw()

如何在wx.python的sizer中添加元素,而不必调整帧大小?

懷念過去 2025-01-27 20:46:52

这应该快得多 - 从单元格读取/写入阵列而不更改基本逻辑。

Sub ForLoop()

    Dim i As Long, j As Long, homenum As Long 'prefer Long over Integer
    Dim dif As Long, clockin As Long, clockout As Long
    Dim ws As Worksheet, data, lr As Long, ub As Long, arrDiffs, d
    
    Set ws = ActiveSheet 'always specify a worksheet, even if Activesheet...

    lr = ws.Cells(ws.Rows.Count, "E").End(xlUp).Row 'last-occupied row in E
    
    data = ws.Range("D2:F" & lr).Value 'read all data as array
    ub = UBound(data, 1)               'get "rows" upper bound
    
    arrDiffs = ws.Range("I2:I" & lr).Value 'read dif column to array
    
    For i = 1 To ub

        clockin = data(i, 1) '1 = D
        homenum = data(i, 2) '2 = E
        dif = 100

        For j = 1 To ub
            If data(j, 2) = homenum Then
                clockout = data(j, 3)  '3 = F 
                d = Abs((clockin - clockout) * 24 * 60)
                If d < dif Then dif = d
            End If
        Next j
        arrDiffs(i, 1) = dif 'update diff array
    Next i
    ws.Range("I2:I" & lr).Value = arrDiffs 'write all diffs back to sheet
End Sub

This should be a lot faster - switched from cell-by-cell reads/writes to using arrays without changing your basic logic.

Sub ForLoop()

    Dim i As Long, j As Long, homenum As Long 'prefer Long over Integer
    Dim dif As Long, clockin As Long, clockout As Long
    Dim ws As Worksheet, data, lr As Long, ub As Long, arrDiffs, d
    
    Set ws = ActiveSheet 'always specify a worksheet, even if Activesheet...

    lr = ws.Cells(ws.Rows.Count, "E").End(xlUp).Row 'last-occupied row in E
    
    data = ws.Range("D2:F" & lr).Value 'read all data as array
    ub = UBound(data, 1)               'get "rows" upper bound
    
    arrDiffs = ws.Range("I2:I" & lr).Value 'read dif column to array
    
    For i = 1 To ub

        clockin = data(i, 1) '1 = D
        homenum = data(i, 2) '2 = E
        dif = 100

        For j = 1 To ub
            If data(j, 2) = homenum Then
                clockout = data(j, 3)  '3 = F 
                d = Abs((clockin - clockout) * 24 * 60)
                If d < dif Then dif = d
            End If
        Next j
        arrDiffs(i, 1) = dif 'update diff array
    Next i
    ws.Range("I2:I" & lr).Value = arrDiffs 'write all diffs back to sheet
End Sub

Excel 2010使用VBA时崩溃

懷念過去 2025-01-27 17:41:37

最后一个打印循环应该更像是:

for (int i = 0; i < names.length; i++) {
    System.out.println(names.get(i) + " is " + ages.get(i) + " years old");
}

为对象的每个属性使用单独的数据结构(在本例中为列表)从来都不是一个好主意。相反,为对象创建一个类,并为您的对象创建一个使用输入创建的数据结构(即列表)。

例如:

public record Person (String name, int age) {}

then 在方法顶部:

List<Person> people = new ArrayList<>();

在输入循环中:

people.add(new Person(name, Integer.parseInt(age));

then 打印:

people.forEach(System.out::println);

打印使用默认的 toString() 实现,但您可以根据需要重写它。

You last loop for printing should be more like:

for (int i = 0; i < names.length; i++) {
    System.out.println(names.get(i) + " is " + ages.get(i) + " years old");
}

It's never a good idea to have a separate data structure (in this case a List) for each attribute of your objects. Rather, create a class for the object and have a single data structure (ie List) for your objects, which you create using the input.

For example:

public record Person (String name, int age) {}

Then at the top of your method:

List<Person> people = new ArrayList<>();

and in your input loop:

people.add(new Person(name, Integer.parseInt(age));

then to print:

people.forEach(System.out::println);

The print uses the default toString() implementation, but you can override it as you like.

尝试填充用户输入的名称和年龄的两个列表,然后将其打印到控制台中

懷念過去 2025-01-27 15:57:38

正如亲自讨论的,这只是因为 Read-SqlTableData 尚未更新以支持 -AccessToken 参数。

我已经收到了一些对其他 cmdlet 的请求...所以我会尽力尽快获取它。

As discussed in person, this is just because the Read-SqlTableData has not been updated (yet) to support an -AccessToken parameter.

I've already had a few requests for other cmdlets as well... so I'll try to get it as soon as I can.

使用read-sqltabledata读取azsql表的同时,使用Azure AD帐户进行身份验证

懷念過去 2025-01-27 14:15:08

您希望外键属性引用父项,而不是子项,例如

 public class Foo
 {
    
    public int ID { get; set; }

    public int ParentFooId{ get; set; }

    public Foo Parent {get;set;}

    public string Name{ get; set; }
}

You want the Foreign Key property to refer to the parent, not the child, eg

 public class Foo
 {
    
    public int ID { get; set; }

    public int ParentFooId{ get; set; }

    public Foo Parent {get;set;}

    public string Name{ get; set; }
}

控制实体框架中的参考?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

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