更新:

再次感谢你的例子,它们对我很有帮助,我并不是说 夺走他们的一切。

Aren't the currently given examples, as far as I understand them & state-machines, only half of what we usually understand by a state-machine? In the sense that the examples do change state but that's only represented by changing the value of a variable (and allowing different value- changes in different states), while usually, a state machine should also change its behavior, and behavior not (only) in the sense of allowing different value changes for a variable depending on the state, but in the sense of allowing different methods to be executed for different states.

还是我对状态机及其常用用法有误解?


最初的问题:

我发现了关于c#中的状态机和迭代器块的讨论,以及用于创建状态机和c#的工具,所以我发现了很多抽象的东西,但作为一个新手,所有这些都有点令人困惑。

因此,如果有人能提供一个c#源代码-示例,实现一个简单的状态机,可能只有3,4个状态,那就太好了,只是为了了解它的要点。

我有一个。txt文件的值。

这些值如下所示:

Value1
Value2
Value3
Value4

我的目标是将值放在一个列表中。当我这样做时,列表看起来像这样:

['Value1\n', 'Value2\n', .〕

\n不需要。

这是我的代码:

t = open('filename.txt')
contents = t.readlines()

在接下来的TensorFlow函数中,我们必须在最后一层中输入人工神经元的激活。我能理解。但我不明白为什么叫logits?这不是一个数学函数吗?

loss_function = tf.nn.softmax_cross_entropy_with_logits(
     logits = last_layer,
     labels = target_output
)

更改crontable文件后是否需要重新启动cron ?

在Python中,调用例如temp = open(filename,'r').readlines()会得到一个列表,其中每个元素都是文件中的一行。然而,这些字符串在末尾有一个换行符,这是我不想要的。

我怎么能得到没有换行符的数据?

我在MySQL中有一个消息表,记录用户之间的消息。除了典型的id和消息类型(所有整数类型)之外,我需要将实际的消息文本保存为VARCHAR或text。我设置了3000个字符的前端限制,这意味着消息永远不会被插入到db中,超过这个长度。

使用VARCHAR(3000)或TEXT有什么基本原理吗?仅仅编写VARCHAR(3000)让人感觉有些违反直觉。我已经通过Stack Overflow上的其他类似帖子,但最好获得特定于这种类型的常见消息存储的视图。

如何在Python中读取文件的每一行,并将每一行存储为列表中的元素?

我想逐行读取文件,并将每一行附加到列表的末尾。