操作
19,225 2:02 | ➔ | 0.10000000000000007 ħ |
19,225 2:02 | 🡰 | -0.1 ħ |
19,226 2:02 | 0.1 ħ | ➔ | #t-130001 | (+0.1 ḥ ⇌ Mindey) |
这个想法是每个线程都有一个环形缓冲区,当一个套接字被接受时,一条消息被放在环形缓冲区上,线程开始监听那个用户。
所有其他线程都会收到所有用户的通知,因此他们也可以向他们回显数据。
这是高效的,因为一个线程可以服务数以万计的连接并且有多个线程。
一个问题是多线程的一个通用问题,它是从一个线程为多种事件中的一种提供服务。我依赖于我正在轮询 ringbuffer 和 epoll 的事实。
The idea is that each thread has a ringbuffer, when a socket is accepted, a message is put on the ringbuffer and the thread begins listening to that user.
All the other threads are notified of all the users so they can also echo data to them.
This is efficient as a thread can serve thousands-millions of connections and there are multiple threads.
One problem, which is a generic problem for multithreading is servicing one of multiple kinds of events from one thread. I rely on the fact I am polling a ringbuffer and epoll.
我的 vagrant 设置使用永久性磁盘并使用 ansible 来部署 cronjob 和同步脚本。它由 YAML 文件配置。我还安装了 psycopg2,并找到了有关如何在 Postgres 中检索数据库中表的文档。现在只需编写同步算法即可。
我的问题是检测哪一方是获胜副本。
当一侧更改数据时,应有不同的散列并且检测到更改的行。这部分我明白了。
问题是检测哪一方是最新的变化,哪一方应该获胜。我可能需要介绍一个版本列。
如果我有一个最后更新的时间戳字段,我可以使用它。或版本列,但我明确试图避免将新列引入架构。这意味着它要困难得多。
My vagrant setup uses persistent disks and uses ansible to deploy the cronjob and sync script. It is configured by YAML file. I've also installed psycopg2 and I found documentation on how to retrieve the tables in a database in Postgres. It's just a matter of writing the sync algorithm now.
My problem is detecting which side is the winning copy.
When one side changes the data there shall be a different hash and the changed rows are detected. This part I understand.
The problem is detecting which side is the latest change and which side should win. I might need to introduce a version column.
If I had a last updated timestamp field I could use that. Or a version column but I am expressly trying to avoid introducing new columns to the schema. It means it's a lot harder.
现在,具有默认语言的域上的配置文件仅以当前选择的语言(或全部,如果“泛语”打开)显示问题和内容,但没有默认语言的域除外。
Now, it the profiles on domains with default language, appear with questions and content only in the currently selected language (or all, if "Panlingual" is switched on), except for the domains that have no default language.
以下描述了注册和联系用户的工作方式。此外,如何将来自与用户的对话中的某些内容作为公共或社区资料的一部分。
The below is a description, of how does the registering and contacting a user works. Also, how some of the content from conversations with users can be made a part of public or community profile.
现在,给某人一个指向某人的 Infinity 个人资料的链接更方便,并期望他们能够轻松地查看自己的想法和项目,并开始互动。
Right now, it is more convenient to give someone a link to one's Infinity profile, and expect them to have comfort to review one's ideas and projects, and start interacting.
⬜️ 需要将 JSON 文档映射到数字,以便“文档 id 0 hobbies[0].name=sam”变为 0@0.0=sam”,这允许通过扫描数字之间的一系列键来进行有效检索。 ⬜️需要编写代码将数字转回字段名称 ⬜️需要集成键空间优化器,因为我们重新排序数字以提高跨列表连接的效率,例如文档 0 = {"hobbies":{("name": "God"),{"name": "databases"), {" name": "computers")}) hobbies 可能是 0,name 可能是 1,我们有 3 个列表项 0、1、2 我们希望所有相同类型的列表索引在排序迭代器中相邻,所以我们翻转它们到最后所以 0@0[1]="God" 变成 0@1.0, 0@1.1 0@1.2 ⬜️ 需要为用于 SQL 连接的内容创建键值 ⬜️ 需要创建一个文档,定义人们期望在 JSON 文档上执行的连接
⬜️ need to map a JSON document to numbers so "document id 0 hobbies[0].name=sam" becomes 0@0.1=sam" this allows for efficient retrievals by scanning a range of keys between numbers. ⬜️need to write code to turn numbers back into field names ⬜️need to integrate keyspace optimiser, as we reorder numbers for efficiency of joins across lists for example document 0 = {"hobbies":{("name": "God"),{"name": "databases"), {"name": "computers")}) hobbies might be 0, name might be 1 and we have 3 list items 0, 1, 2 we want all list indexes of the same kind to be adjacent in the sort iterator, so we flip them to the end so 0@0[1]="God" becomes 0@1.0, 0@1.1 0@1.2 ⬜️ need to create keyvalues for what is used for SQL joins ⬜️ need to create a document which defines the joins that people expect to do on a JSON document
我有 3 台机器,每台机器都有 1 个提供存储的驱动器 该驱动器作为一个大型驱动器公开,其中包含所有机器的存储空间
I have 3 machines each with 1 drive that provides storage The drive is exposed as one large drive with storage from all the machines
我还没有上传密钥,但我可能会。它们只是测试键。
我正在使用 virtualbox vagrant 持久卷。这意味着我可以拥有一个与每个 VM 关联的存储磁盘。
I haven't uploaded the keys, but I might. They're just test keys.
I am working on using the virtualbox+vagrant persistent volumes. This means I can have a storage disk associated with each VM.
我在这上面花了几个小时。
如果这适用于所有程序循环,我们可以拥有更高效的程序。
I spent a few hours on this.
If this was applied to all looping of programs, we could have even more efficient programs.
用 Java 重写 Python 代码,以便可以使用真正的多线程 实现循环运行线程,重复尝试执行与该线程号匹配的第 N 个产品
Rewrite Python code in Java so true multithreading can be used Implement loop runner threads that repeatedly try execute Nth product that matches that thread number
A. 为库存管理选择合适的系统。 我需要以下列表: 1- 组件 2- 材料 3- 产品 4- 包装材料 5- 包装解决方案 6- ATO-组件(按订单组装) 7- 生产信息文件
B. 定义我的所有列表:
A. Choose a suitable system for INVENTORY management.
I need LISTS of:
1- Components
2- Materials
3- Products
4- Packaging materials
5- Packaging solutions
6- ATO-components (Assemble-to-order)
7- Production info file
8- Raw MAterials resources (nu)
9- Empty spots of land dumps (nu)
10- Drivers of trucks that are independent (nu)
B. Define ALL my LISTS:
Communities
Locations
Routes
Distribution centers and supermarkets
将我的系统转到 COPY-LEFT。
因此,我构建了我认为最适合我的社区品牌的系统,并且我将其全部复制到左侧。
在我看来,这是通往自由的唯一途径。
欢迎评论。
TURN MY SYSTEM TO COPY-LEFT.
SO I BUILD THE SYSTEM THAT I IMAGINE IS BEST FOR MY COMMUNITY-BASED BRAND, AND I MAKE IT ALL COPY-LEFT.
THIS IS THE ONLY WAY TO FREEDOM IN MY OPINION.
COMMENTS ARE WELCOME.
2小时 我对我创造的东西相当满意。我认为 API 可能会更好。或者等待结果的实施可能会更好。 由于嵌套循环,查看是否有任何新结果的计算成本很高。我认为这可以做得更好。 理想的嵌套循环应该只需要一些 divmod 指令和添加。否则,它们将主导所使用的性能。
2 hours I am fairly happy with what I created. I think the API could be better. Or the implementation of waiting for results could be better. The calculation to see if there are any new results is expensive due to nested loops. I think this could be done better. Ideally nested loops should only take a few divmod instructions and additions. Otherwise they shall dominate performance used.
2-4 小时 我不记得我是什么时候开始的
我得到重复的条目。
父循环如下所示:
对于字母中的字母: 对于数字中的数字:
对于符号中的符号:
然后我尝试在内部循环中使用一个新的并发循环来扩展它。
但是每次迭代看起来都一样!它不等同于:
对于字母中的字母: 对于数字中的数字:
对于符号中的符号:
对于嵌套在代码中: 对于嵌套中的表情符号: 打印(字母数字符号嵌套表情符号)
我需要某种方式通过任意数量的循环来扩展循环,比如循环树。
2-4 hours I cannot remember when I began
I get duplicate entries.
The parent loop looks this:
for letter in letters: for number in numbers: for symbol in symbols:
Then I try extend it with a new concurrent loop inside the innerloop.
But each iteration would look the same! It's not equivalent to this:
for letter in letters: for number in numbers: for symbol in symbols: for nested in codes: for emoji in nested: print(letter + number + symbol + nested + emoji)
I need some way of extending the loop through an arbitrary number of loops, like a tree of loops.