操作
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.