我正在尝试找到树(非二进制)的开源实现,如红黑,B树,2-3树或通用树,理想情况下用于Squeak/Pharo,但其他Smalltalk风格的任何其他实现将是没关系.我见过SqueakSource但是有太多的二叉树包,其中大部分似乎属于学生项目.你知道树的实现吗?
不得不改变这一点.我有两个数组,我想基本上将它们连接成一个数组.
completearray:= completearray, temparray."concatenate the new array to the existing one"
Run Code Online (Sandbox Code Playgroud)
我该怎么办?谢谢.
所以我在一个小谈话中有一个字符串,该字符串作为'$ 100xxxxxxZZ'来到TCP/IP连接,其中x是数字0-9或字母A-Z,ZZ是由发送者计算的校验和.使用字符串我需要计算'100xxxxxx'的校验和,以验证这是正确的消息和校验和.所以我需要能够删除'$ 100xxxxxxZZ'的'$'和'ZZ'
我已经知道如何截断'ZZ',这是我的代码:
ValidateMsg:replyWithCheckSum
Run Code Online (Sandbox Code Playgroud)|newMsg tempMsg| "removes the 'ZZ' from '$100xxxxxxZZ' " tempMsg := replyWithCheckSum copyFrom: 2 to: (replyWithCheckSum size -2). "CODE TO REMOVE THE '$' AND STORE INTO newMsg" "compares the 'ZZ' to the checksum calculated from newMsg" ^(self calcCheckSum: newMsg) = (self getCheckSumFromReply: replyWithCheckSum)
TL; DR如何在visualt 2.5中删除smalltalk中字符串中的第一个字符(是的,我知道这很古老)
我有两个日期需要比较,如果一个日期已经过去了。这意味着:
date1 := Date newDay: 10 month: 12 year: 2017
date2 := Date newDay: 1 month: 1 year: 2020
Run Code Online (Sandbox Code Playgroud)
所以在这种情况下date2是过去date1,所以我需要这是真的。
但
date1 := Date newDay: 10 month: 12 year: 2017
date2 := Date newDay: 3 month: 7 year: 2015
Run Code Online (Sandbox Code Playgroud)
应该返回false。
有人有提示吗?欣赏!