- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
目前我有代码:
import random
from psychopy import visual, event
win = visual.Window()
# A TextStim and five of each word-color pairs
stim = visual.TextStim(win)
pairs = 5 * [('blue', 'blue'), ('yellow', 'blue'), ('green', 'yellow'), ('red','red')]
random.shuffle(pairs)
# Loop through these pairs
for pair in pairs:
# Set text and color
stim.text = pair[0]
stim.color = pair[1]
# Show it and wait for answer
stim.draw()
win.flip()
event.waitKeys()
我试图将键盘上的键“f”分配给红色,“g”分配给蓝色,“h”分配给黄色,“j”分配给绿色,因此当参与者看到时按下“f”红色,我想记录 react 时间,我希望它说“正确”或“不正确”?我已经尝试了很多代码,但我认为我把它们放在错误的顺序或者我去错了地方!
最佳答案
实现此目的的一个巧妙方法是使用 python 字典作为键含义映射。所以一开始就定义
answer_keys = {'f': 'red', 'g': 'blue', 'h': 'yellow', 'j': 'green'}
作为一个简单的演示,然后
answer_keys['f'] == 'blue' # False
answer_keys['g'] == 'blue' # True
要在实验中使用它,请执行以下操作:
# Get answer and score it, and get RT
key, rt = event.waitKeys(keyList=answer_keys.keys(), timeStamped=True)[0] # Only listen for allowed keys. [0] to get just first and only response
score = answer_keys[key] == pair[1] # Whether the "meaining" of the key is identical to the ink color of the word.
# Show feedback
stim.text = 'correct' if score else 'incorrect' # show text depending on score
stim.text += '\nRT=%i ms' %(rt*1000) # Add RT to text, just for demo
stim.draw()
win.flip()
event.waitKeys() # Wait, just to leave it on the screen for a while.
关于python - Psychopy:如何让参与者使用键盘上的特定键做出响应。蓝色=f?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43214406/
我需要并行处理多个数据值(“SIMD”)。我可以使用 java.util.concurrent API (Executors.newFixedThreadPool()) 使用 Future 实例并行处
说未引用的参与者仍然订阅事件流是否正确?至少,这是我从 Akka 实验中得到的…… 我正在尝试在 EventBus 场景中为参与者实现弱引用。在这些情况下,事件监听器/参与者通常来来去去。与应该一直在
场景:我有这个代码: class MyActor extends Actor { def act() { react { case Message() => printl
我正在尝试对一条新闻帖子进行建模,其中包含有关发布该新闻的用户的信息。我认为最好的方法是发送用户摘要信息以及创建新闻帖子的消息,但我有点困惑如果底层用户信息发生变化如何更新该摘要信息。现在我有以下 N
开始学习Actor模型(使用Akka.net),打算在现在的项目中使用。我当前的任务是使用 IFilter 从不同的文件中提取文本。 IFilter 是一组带有 native 代码的 COM 服务器。
我在我的 Linux 服务器上安装了 openfire(版本:Openfire 3.9.3)。它在 2 天前工作正常,具有所有功能。我专注于存档消息插件。什么是问题: 1.当我开始与用户聊天时,它显示
感谢阅读这个问题。我有一个包含 5 个参与者的数据集,其中 10 个参与者有 8 个变量。我需要将数据集的每个参与者/行导出到一个单独的 pdf 文件中,并根据参与者名称为导出的 pdf 文件命名。附
在 Twilio REST API 中,是否可以检索已完成 session 的参与者列表?我试图在 session 结束时计算每个参与者的通话时长。我在 session 创建时传递了一个“ Actio
当使用 LDAP 存储实现 RBAC 模型时(我使用 Apache Directory 1.0.2 作为测试平台),一些参与者显然可以映射到特定的对象类: 资源 - 我没有看到此资源的清晰映射。 ap
我需要将数千个不同格式的 ms office 文档转换为一种通用格式。为了加快速度,我会使用 akka.net 将其并行化。 WordSaveAsActor 应该: 在单线程单元中运行 持有 Word
现在我们的 ASF 集群正在运行: Web API 项目 - 无状态且面向公众 Actor 项目 - 主要是 volatile 的,将数据保存在内存中,由某些 API 使用 我们正在试用 Applic
我在 R 中有一个 data.frame,其中一列指示实验中的参与者 subject,另一列指示 condition、trial_type 和最后一列,我的数字因变量 rt. 这是我使用 dput()
APARAPI project self 描述为: Aparapi allows Java developers to take advantage of the compute power of G
我正在使用 Vidyo.io 服务将视频 session 集成到我的 Android 应用程序中。我已经能够使用 android-vidyo-sdk 附带的 VidyoConnector 示例应用程序
只是一个小介绍: 有任务(任务表) 有用户(用户表) 用户可以参与不同的任务(task_has_user表) 参与者分为作者、实现者、检查者等。 我想获取以逗号分隔的参与者的所有任务列表,如下所示(数
我正在尝试实现 JUnit 测试来测试参与者。 我有这个 ActorTest : import org.junit.Test; import play.libs.Akka; import playte
我是一名优秀的程序员,十分优秀!