所有问题

0 投票
0 回答
7 浏览

c# - Unity Prefab Enemies Behave the same

Hey Working on something new here. I have an enemy for a game I'm coding. I'm trying to modularize by stuff more so I have an overall AIMovement.cs file that handles well... movement. I also have AIUtility.cs which handles any randomization of the movement such that the parent makes simple calls and the utility takes care of most things concerning IEnumerators. So AIUtility makes use of System.Random to generate most of its wait times with maxes given by the editor. So at Start() I generate the random seed for waiting. The problem is that when the game starts I run a spawner script that basically spawns a random number of prefabs at the start of the game mostly used for testing at this point though I'm sure it will come in handy later. Its just that all my enemies behave in the exact same way! Now some enemies are originally made to teleport a few times (at random) and then self destruct. Its kind of cool to have it all happen at once and turn the game into a mini bullet hell but for standard enemies it totally sucks! How can I get this to stop? Here are the scripts. I did pull out some code that shouldn't change the problem as these scripts are made for more than one type of mob. Also a few things have not been implemented yet. If I need to restructure I'll cry, but I'll still do it. Any help is appreciated.
Spawner:

AIMovement.cs

Utility script

0 投票
3 回答
81 浏览

html - 无法左对齐图

我正在尝试将figure左对齐并将同一行上的文本向右对齐,这是我的 html:

我尝试了不同的属性,例如:

figure仍然占据整个行宽。我该如何解决?

0 投票
3 回答
902 浏览

android - Prevent LaunchedEffect from re-running on configuration change

I want to run the code only once when the composable is loaded. So I am using LaunchedEffect with key as true to achieve this.

This code is working fine but whenever there is any configuration change like screen rotation this code is executed again. How can I prevent it from running again in case of configuration change?

0 投票
1 回答
60 浏览

r - Taking a set of values with a equal or similar mean in R

I am working with R.

I have two sets of values. They look like this.

I took five values of the setA...

The mean of this set of words is 0.69.

Is there a way to select values of the setB that will have the same or very similar mean to 0.69?

So, I need a "random" sample of setB that will end up with a mean equal or around 0.69.

(In reality I have 800 values in setA, so is very difficult to select the values of the setB by just looking at them).

0 投票
1 回答
42 浏览

javascript - React use a form in a modal to pass the inputted data to a function

I am using react-bootstrap/Modal and react-hook-form. I want the user to insert data in the input which after submitting will go to the function where I want to make an object with it.

Thanks for helping!

EDIT:

I found the solution, I had to put the form in the modal but outside the modal components.

0 投票
2 回答
48 浏览

javascript - 如何在 create-react-app 中禁用“X-Powered-By”响应标头?

我正在使用 react.js 应用程序Create-react-app,在响应标头中我看到了 Express 的x-powered-by标头,我想禁用这个特定的标头字段。有没有办法做到这一点?在Next.js我们可以通过在配置文件中添加一些代码来禁用此标头字段,我们可以在我的场景中实现相同的功能吗?

0 投票
1 回答
35 浏览

java - Get indices of unique WebElements.getText() objects in an ArrayList

I have an ArrayList<WebElements> whose elements all have some pieces of text. I'd like to store the indices of those WebElements, which contain unique pieces of text in a new ArrayList<Integer>. E.g. if the texts are (a,b,c,a,b,d) then I'd need (1,2,3,6).

I tried getting the texts to ArrayList<String> piecesOfText with one stream, picking the uniques with another one into ArrayList<String> piecesOfTextUnique, then looping through piecesOfTextUniqueand getting the indices of those pieces of text in piecesOfText via indexOf()

This one does the job, but can someone suggest a more concise/elegant solution?

0 投票
1 回答
39 浏览

cognos - Cognos Analytics:按月将变量拆分为两个

在 Cognos Analytics 中,我有一个包含数据行的数据集(以 MB 为单位的已用磁盘空间),每行是 2 月或 6 月。因为我想比较两个月,所以我想创建两个新变量:一个是 2 月的数据,一个是 6 月的数据。在查询编辑器中,我尝试过:count (MB) when month = 'February'。这和其他几个条目不起作用。我想知道是否有人可以为我提供正确的代码行。

提前致谢!

0 投票
0 回答
15 浏览

raspberry-pi - 在我的 Mac 上为我的 Raspberry Pi 4 创建一个快捷方式

我想创建一个连接到我的网络上的 Raspberry 快捷方式,以便我可以随时在我的 Mac 上使用它。

我希望这样做我可以快速访问我的音乐库(在我的 Rpi 上连接的驱动器中)并在那里无缝复制文件。

有没有办法做到这一点?

在此处输入图像描述

0 投票
0 回答
27 浏览

javascript - 如何在php函数中传递javascript变量

我有这些 javascript 变量:

这些变量“item.description”和“element.name”我想传入php函数。

常见php文件中的php函数:

现在我想在该函数中传递 js 参数来翻译它们,因为我很容易翻译 php 变量,但是这里的名称和描述来自 js 代码,所以我想在那个特定的 php 函数中传递它们。

0 投票
1 回答
19 浏览

swiftui - 隐藏点籼稻

我一直在寻找这个答案并意识到互联网上没有内容(或者我找不到它)。最后我想通了,所以我在这里分享这个答案的回应。

如何从这里通过:

带点指示器的 TabView 寻呼机

对此:

没有点指示器的 TabView 寻呼机

0 投票
1 回答
27 浏览

laravel - 在 laravel 的注册页面中检索数据库值

我在 laravel 项目中有注册身份验证,我需要一些现有数据应该显示在注册表单上,请指导我..

这是我的注册页面,我需要在注册表单中获取现有的数据库值。例如

这个怎么自定义.​​..

我试过在web.php文件中添加

而在我的UserController.php

但不能同时使用 post 和 get 进行注册身份验证

0 投票
0 回答
34 浏览

javascript - AJAX API 上的实时视频处理缓慢

我正在做一个机器学习项目。实时工作。我需要将视频从网络摄像头发送到特定的 API(烧瓶)并再次显示给用户(预测后)。

使用以下 POST 方法时,在 localhost 中确实非常慢。

代码 1

但是当使用直接cap = cv2.VideoCapture(0)而没有 API 发布它的工作正常。

有什么解决办法吗?

编辑 (烧瓶后端部分)

0 投票
0 回答
87 浏览

docker - 卷曲错误 52:尝试使用 dbpedia Spotlight docker 进行注释时来自服务器的空回复

我无法从dbpedia/spotlight docker图像中得到正确的回复。我记得大约一年前使用:databus标签,它在UNIX环境中工作,但现在:

  1. sudo docker pull dbpedia/spotlight-english:databus产量 Error response from daemon: pull access denied for dbpedia/spotlight-english, repository does not exist or may require 'docker login': denied: requested access to the resource is denied。这让我使用:latest标签和

  2. 我现在在 OSX 环境中(不确定这是否会改变任何东西)。

所以我试图运行:

哪个开始图像:

但不回复 curl 请求注释:

这里有什么帮助吗?我需要使用:databus标签吗?如果是这样,我在哪里可以找到它?dockerhub 上唯一可用的标签是:latest。另外,我检查了防火墙,它已关闭。

感谢您的时间和关注,卢卡斯。

0 投票
0 回答
186 浏览

github - 仅在 deployment_status 和特定分支上的 github 工作流

与此问题类似,如何使用“deployment_status”小猫仅在 QAS 分支上运行 Github Actions? 我只想在特定分支上执行工作流,但要与deployment_status触发器结合使用。

develop所以我只想在部署完成并且我们在分支上时执行我的端到端测试。

这里的问题是:在触发器deployment_statusgithub.ref没有设置变量。它也写在文档中。所以我不能手动检查我是否在正确的分支上。

另一方面:如果我使用deployment_status触发器,我不能使用branchesbranches-ignore组合使用。这根本行不通。

任何想法如何解决这个问题?

0 投票
1 回答
252 浏览

javascript - Electron - dialog.showOpenDialog 如何打开目录选择对话框并在 Windows 上显示“灰显”文件

在 macOS 上,我看到文件变灰,但在 Windows 上,我只能看到文件夹。

我怎样才能让windows文件夹选择对话框显示我选择的文件夹内的文件?

mac 上的示例(文件显示为灰色):

https://i.stack.imgur.com/qP1iv.png

0 投票
1 回答
40 浏览

python - 如何访问 __init_ 函数的属性

有没有办法访问init的属性而不将它们分配给 self.attribute = attribute 例如:

我希望打印 __init__argument 而不在构造函数中分配 self.o = o 并在 f 中使用 print(self.o)

我只想节省代码,例如在 f: print(test.init .o) 的打印语句中使用类似的东西类似的东西

0 投票
0 回答
30 浏览

javascript - 反应句柄函数

我是 React 的新手,有点挣扎。我有两个类似的组件,我正在处理在 IOS 上打开模式时向后滚动。我已经通过这种方式解决了这个问题:

然后将其应用于模态作为回报。

第二个组件的编写方式不同,我真的不知道如何应用相同的功能。

应用这两个功能的最佳方法是什么?

谢谢

0 投票
1 回答
43 浏览

android - 在 jetpack compose 中制作自定义网格

我有以下代码:

问题是我在按钮中得到相同的文本 3 次,这是有道理的,因为循环。我想要做的是有多行 3 个按钮,但按钮文本中有许多项目,并将每个文本用于按钮文本

0 投票
0 回答
6 浏览

javascript - 不要通过 XMLHttpRequest POST 获取我的数据

我正在努力将我的数据从 html 表单导入 mySQL 2 天,现在......

当我解决了maaany问题时,我被一个(恕我直言)空FormData对象困住了。我有一个表格

数据传输不需要重定向到新页面,所以我选择了 XMLHttpRequest,也支持过时的浏览器。该代码或多或少是从教程中复制粘贴的。

到达登陆页面forms/pricing.php,点击“go”成功将一些固定值(为调试输入)存入数据库。但是,$_POSTvar 似乎是空的,我的数据对象是通过 PDO 存储的

商店'1'而不是$_POST["fromDate"]. 而且在console.log(data);(其中数据是 POST 的 FormData,如第二个片段所示)的控制台输出中,我找不到任何数据。

我究竟做错了什么?

0 投票
0 回答
16 浏览

python - 如何在python中创建一个自写的静态函数库

我有一个具有多个静态函数的 python 脚本。我想将完整的 python 脚本转换为 python 库

这是我想要将其转换为库的完整 python 脚本。我该怎么做?

0 投票
0 回答
32 浏览

android - 如何全局检测设备是否处于手势导航状态?

背景

我在一个应用程序上工作,该应用程序具有显示在其他应用程序上的浮动 UI(使用 SAW 权限,又名“显示在其他应用程序上”)。

它还处理可能来自侧面的触摸事件。

问题

似乎在某些设备上,启用手势导航后,触摸侧面可能会优先考虑系统导航而不是应用程序。

我试过的

我想更改 UI,以便至少它会更大并且更容易触摸,但前提是操作系统的当前配置是手势导航。

可悲的是,我发现的所有与手势相关的问题都与您何时已经在 Activity 中有关,并提供处理保护区。我发现没有什么与简单检测有关,更不用说没有 View/Activity/Window。

问题

仅给定 Activity/View 之外的基本类,我如何检测(包括更改时的回调)设备是否正在进行手势导航?

0 投票
0 回答
49 浏览

react-native - 在 React Native 上使用 Share.shareSingle

我有一个应用程序,一旦用户单击社交图标,我想在其中将特定数据共享到 Facebook、Twitter 和 LinkedIn 等社交媒体。但是 react-native-share 在 IOS 上不支持 Twitter 和 LinkedIn。我需要从我的应用程序中分享标题和消息。

这是我的代码,您对如何解决它有什么建议吗?

0 投票
0 回答
10 浏览

c# - c# 新闻文章标题的组合框

我正在尝试在 c# 中制作自己的项目作为练习。我制作了一个表单,用户可以在其中创建新闻文章,此外,我还制作了一个表单,用户可以通过选择标题来更新和删除新闻文章。

但由于某种原因,我在尝试访问组合框时收到此错误:错误 CS0122'UpdateDeleteNewsArticleForm.cbArticleTitle' 由于其保护而无法访问 我觉得这与抽象类有关,但我必须使用它。

抽象类文章的代码(两种文章类型继承自):

组合框的代码:

有人知道如何在不删除抽象方面的情况下解决这个问题吗?

0 投票
1 回答
133 浏览

python - 将 pyvis 图形导出为矢量或 .png 图像。有办法吗?

我正在寻找一种将 pyvis 生成的巨大图形导出为矢量图形 .svg 或至少 .png 格式的方法。有没有办法做到这一点?到目前为止,我只找到了保存/导出为 .html 文件的选项。

提前致谢。