所有问题

0 投票
1 回答
2003 浏览

android - 如何在画布上用线条绘制文本?

**如何在画布上用文字画线。显示的文本是在画布上绘制时以线条显示的线条长度。请帮助我解决这种情况。

这是我尝试过的输出图像。电流输出:** 在此处输入图像描述

这是我需要的输出。所需输出: 在此处输入图像描述

这是我尝试过的绘图视图代码。

0 投票
1 回答
2923 浏览

docker - Mysql docker container is not mounted

I've created mysql docker container using docker-compose. I built the container and created some tables in mysql. But, when i restarted my computer, i lost my data (tables and data) in mysql. I'am using a local folder in container as a volume. But i see that it's not mounted in virtual container.

My OS is Windows 10 Pro. I've tried to restart the Docker desktop and the containers, but it did not help. Here is the .yml that i'm running:

0 投票
0 回答
272 浏览

java - 编译器在解析的 XML 文件中省略了 DOCTYPE,如何将其包含在最终文件中?

我正在根据一些任意数据解析 XML 文件。最终的 XML 文件表示为另一个应用程序的保存文件,我无法控制它。但是,为了将其正确加载到程序中,

必须包含在文件的顶部。Processing/Java XML 解析器(并且就我能够计算出所有其他 XML 解析器而言)总是忽略这一行。

我到处搜索,但找不到任何解决方法。我不熟悉 DTD,据我所知我也不需要,因为 Doctype 定义超出了我的控制范围。

实际结果是一个文件,其中的每一段 XML 都被正确解析,除了

宣言。

有什么解决方法吗?

编辑: 根据要求,我正在生成的 XML 文件中的示例:

以及生成它的代码:

我知道工作区是在第 3 行定义的,但是,我仍然需要在生成的文件中包含 DOCTYPE 声明。

0 投票
1 回答
946 浏览

angular - 使用 Karma / Jasmine 进行 Angular 8 测试 -> 角度路径中 loadChildren 未涵盖 100% 代码覆盖率

从 angular 7 升级到 8 后,您的应用程序路由的 loadChildren 发生了重大变化。当这些都得到修复并且所有测试都在运行时,我不再获得 100% 的代码覆盖率,因为 loadChildren 不再是“字符串”,而是 LoadChildrenCallBack。

我如何测试代码的这个特殊部分

设置:

0 投票
1 回答
2596 浏览

javascript - Gauge charts with custom ranges

I need to have a sub-value indicator and text in my d3 gauge chart.Screenshot

Also if I specify the number of sections the color palettes are assigned equally. For example, if I specify the number of sections as 3 the colors are equally divided into 3 equal percents(33.333% each). I need to have my custom ranges as 20% red,50% yellow and 30% green. How can I achieve this?

I'm building on this code: Codepen link

Javascript

CSS:

HTML:

Thanks

0 投票
3 回答
856 浏览

c# - EFCore save entity with relation ids

I'm trying to save an entity, but this entity is related to another one and of this one I only have the id. For example, giving this structure:

I receive from the client a new book to save to the db. This book only contains the Title, the LibraryId and the BookshelfId (it's a DTO). Now I want to save this book, creating the relationship with Library and Bookshelf, without retrieving the full object Library and Bookshelf, how can I do it easily?

What if, for example, I want to create a new library, and relate it to some already existing books? What I should do to achieve it?

0 投票
1 回答
21 浏览

python-3.x - 为什么在字典中当我们有相同的值和不同的键名时为什么它选择一个与另一个相比

我知道我们首先使用最大值插入的任何项目都将被视为最大票数,如下所示,但是如果我需要将最大值作为 katty 键,值为 6,插入到具有相同值 6 的 maddy 键之后怎么办?

0 投票
0 回答
728 浏览

system - 以客户为中心的一致性的实际例子

在分布式系统中:原则和范例:Maarten van Steen 和 Tanenbaum。第三版

第 7 章:一致性和复制。

我试图了解以客户为中心的一致性和以数据为中心的一致性之间的区别。

以客户为中心的一致性的实际例子。- 单调读取。- 单调写入。- 阅读你的作品。- 写跟随你的阅读。

书中已经有关于基于 Web 的邮件应用程序的示例来解释最终的一致性。

但我仍然不相信这些到底在哪里使用。

如果有人可以向我指出任何材料或解释使用这些一致性模型的一些实际场景。这会很有帮助。

谢谢!

0 投票
1 回答
22 浏览

laravel-5 - 如果记录不存在则插入,如果存在则更新

Hiii 我有 2 个数据库表,列表:1“id,invoice_id,主题,总计”表:2“id,invoice_id,item_name,price”。每当我尝试在 invoice_id 的帮助下更新记录时,如果记录没有存在于项目表中,它不会在项目表中插入新项目。

在这里我附上了我的 JSON 数据

这里的一个问题是我的 JSON 也无法发送 item_id,所以如果没有项目 ID,我如何更新我的记录...???我的表中没有第三项

这是我的控制器

我除了这样的输出

但我的实际输出是

此输出在更新时覆盖 item_name。有什么办法可以解决这两个问题。

0 投票
1 回答
2345 浏览

c# - Unity3d Photon custom room property problem for making countdown timer

I'm trying to make countdown timer for adding my game match by using custom properties. But i'm stuck somewhere. Timer is working but it's not shows same time with another clients who join later. My script here:

0 投票
2 回答
1399 浏览

c# - 为什么 WMI 的结果在标准模式和 Windows 7 中的管理员用户中不同?

我想保护我的应用程序。所以我读取了硬盘序列号并进行了比较。该应用程序在管理员用户模式下效果良好,但在标准用户模式下效果不佳。

我用 C# 编写了我的应用程序。但是为了读取硬盘序列号,我使用了我在 Delphi 中编写的 dll 文件。

我尝试使用 NET,所以我使用了 WMI 类Win32_DiskDrive,但这种方法在标准用户模式下也有不好的结果。

在标准用户模式下:

  1. 如果是 Delphi dll,它会抛出拒绝访问错误
  2. 在 WMI 的情况下,标准用户与管理员用户的输出不同。

注意:此问题(NO.2)仅在 Windows 7 中。

0 投票
2 回答
3172 浏览

android - 将 MutableLiveData 公开为 LiveData 的正确方法?

考虑以下公开方式MutableLiveData

方法A

方法B

是否有理由使用方法 B 而不是方法 A?

0 投票
1 回答
123 浏览

python - How to groupby the keys in dictionary and sum up the values in python?

How to groupby two keys in dictionary and get the sum of the values of the other key val.

Input:

In this example, I want to groupby the key1 and the key2, and then sum up the value in val.

Expected:

Actually, I don't want to convert the dictionary data into pandas.DataFrame then convert back to dictionary to achieve it, because my data is actually very big.


Update:

To help understand the generating val_sum, I post my code using pandas.DataFrame.

And the result is shown as follows:

0 投票
1 回答
18 浏览

php - 我的 php 注册文件在数据库中创建了太多条目

我有一个名为reg.php的文件,它为登录系统扩展了我的registration.php

注册与 mysqli 数据库连接,我在 php 中手动增加了用户 ID,而不是在 mysqli 中自动增加,因为我无法完成这项工作。

当我点击注册按钮时,我的代码在数据库中创建了两个条目,我不知道为什么。

我想要的只是一个条目。

0 投票
1 回答
157 浏览

ios - Adding a custom label to a prototype cell in a split view

I am working on a dictionary app in a SplitViewController. On the master view controller I want to show the various entry words AND the number of times that they've been tapped, while on the detail I want to show the word definition and details. I've set up everything so far, except the number of times that a word has been tapped, which should be showing on the Main view controller. How do I manage to customise the various labels in the main view controller, adding a label?

0 投票
2 回答
1539 浏览

python - Python/Django remove text in variable

at my views.py i have the following line

which creates a PGP message with a version information like this

-----BEGIN PGP MESSAGE-----

Version: XYZ

How can i remove/replace this version line?

if i try:

i get back:

Thanks and regards

0 投票
1 回答
163 浏览

c - 如何在 15 和 18 处处理此警告。“警告:数组下标的类型为 'char' [-Wchar-subscripts]”

问题是这个警告在 15 和 18 警告:array subscript has type 'char' [-Wchar-subscripts]

处理样本输入:他们是学生。aeiou 样本输出:Thy r stdnts。

我可以运行它,但我不知道警告。

这里

0 投票
2 回答
133 浏览

javascript - My class created doesn't export an object

I need to create the class ShoppingCart in the file ShoppingCart.js and export it to a test file and i get the error that my class is not a constructor

I know the problem is not in import export because before creating the js file i got the error that it couldn't find the module. I also tried creating a new instance of the class inside the file and it worked

The code for my test file is

when i run the test file i get

0 投票
1 回答
2087 浏览

php - 如何使用 microsoft-graph sdk php 让 Outlook 免费繁忙的日程安排

我正在使用 microsoft-graph api sdk 这里是 url:msgraph-sdk-php

我需要检查 Outlook 日历中用户的约会是否可用/忙碌。

我正在尝试使用以下代码

我收到以下错误:消息:“客户端错误:POST https://graph.microsoft.com/v1.0/me/calendar/getschedule导致400 Bad Request响应:↵{↵“错误”:{↵“代码”:“RequestBodyRead”,↵“消息”:“尝试读取空集合参数值时我(截断...)↵</p>

我还检查了这个微软文档的详细信息,这里是网址:outlook-get-free-busy-schedule

我没有在文档中找到使用 php microsoft-graph sdk 的 getschedule-api。我需要使用 php microsoft-graph api sdk。

请为我提供有关此错误的任何解决方案。

谢谢。

0 投票
1 回答
145 浏览

css - Chrome浏览器中css网格的奇怪行为?

我在 Chrome 和 Firefox 中观察到这段代码的不同行为: HTML :

因此,在 Chrome 中:

  • 项目 11 和 12没有紫色背景(为什么?)
  • 第一行的高度是 34.2px(为什么?)

在火狐中:

  • 第 11 项和第 12 项确实有紫色背景(我认为应该如此)
  • 第一行的高度是 18.4px,这是 div 中项目的高度,我认为这是正确的行为

任何想法为什么会发生这种情况?

0 投票
0 回答
1785 浏览

python - 如何在 python 的推文列上应用 coreNlp(Stanford NLP)?

我的代码是:-

所以这里我的数据框是 DataSet_new,我的推文列是 tweet_stemming 我想在这个列上使用 nlp,我想要斯坦福分数列中的结果,比如(情绪值和情绪)

将情绪值转换为 numpy 以便于使用

谁能帮我?

0 投票
2 回答
1838 浏览

fastlane - bitrise 在 Applications/Xcode-beta.app/Contents/Developer 找不到传输器

我正在尝试使用 bitrise 和 fastlane 将 ios 存档上传到 testflight,但是存档成功后我收到错误"Could not find transporter at Applications/Xcode-beta.app/Contents/Developer"并且工作流失败。

这是我的快车道文件

0 投票
1 回答
1744 浏览

node.js - Puppeteer 从 elementHandle 获取元素导致协议错误

我正在尝试为某个用户撰写的帖子抓取某个 Facebook 页面,并以某个单词开头。

我越来越

错误:协议错误(Runtime.callFunctionOn):目标已关闭。当我试图获取用户名元素时

在这一行:

让 usernameElement = await post.$('.fwb');

不知道这里出了什么问题,有什么建议吗?

0 投票
1 回答
1775 浏览

spring - 如何在spring boot中配置多个身份验证提供?

在我的 Spring Boot 项目中,我想提供 2 个身份验证提供程序。
1. 从数据库
验证用户 2. 从 LDAP 验证用户。

如何在 Spring Boot 中配置多个身份验证提供程序。

0 投票
0 回答
1808 浏览

javascript - 带有滞后的移动按钮控件的 JavaScript 游戏

我创建了一个简单的键盘控制 JavaScript 游戏(我最近完成的前端训练营的额外任务)。几天前,我决定为移动设备添加控件,虽然键盘控制效果很好(游戏的响应是即时的),但移动控件“遭受”某种滞后。

主游戏控制JS代码:

游戏预览:链接

此处链接到 GitHub 存储库:link

如您所见,我尝试了一个 jQuery 解决方案 - 控件工作,但仍然具有相同的滞后。我会很感激任何帮助。