Operacijos
19,225 2:02 | ➔ | 0.10000000000000007 ħ |
19,225 2:02 | 🡰 | -0.1 ħ |
19,226 2:02 | 0.1 ħ | ➔ | #t-130001 | (+0.1 ḥ ⇌ Mindey) |
Idėja yra ta, kad kiekviena gija turi skambėjimo buferį, kai priimamas lizdas, į ringbuffer įdedamas pranešimas ir gija pradeda klausytis to vartotojo.
Visos kitos gijos yra informuojamos apie visus vartotojus, kad jie taip pat galėtų joms perduoti duomenis.
Tai efektyvu, nes gija gali aptarnauti tūkstančius milijonų jungčių ir yra keletas gijų.
Viena problema, kuri yra bendra kelių gijų problema, yra vienos iš kelių įvykių aptarnavimas iš vienos gijos. Aš pasitikiu tuo, kad apklausiu „ringbuffer“ ir „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.
Mano valkataujanti sąranka naudoja nuolatinius diskus ir ansible, kad įdiegtų cronjob ir sinchronizavimo scenarijų. Jis sukonfigūruotas naudojant YAML failą. Taip pat įdiegiau psycopg2 ir radau dokumentus, kaip gauti lenteles duomenų bazėje Postgres. Dabar belieka parašyti sinchronizavimo algoritmą.
Mano problema yra nustatyti, kuri pusė yra laimėjusi kopija.
Kai viena pusė pakeičia duomenis, turi būti kitokia maiša ir aptinkamos pakeistos eilutės. Šią dalį aš suprantu.
Problema yra nustatyti, kuri pusė yra naujausias pokytis ir kuri turėtų laimėti. Man gali reikėti pristatyti versijos stulpelį.
Jei turėčiau paskutinį kartą atnaujintą laiko žymos lauką, galėčiau jį naudoti. Arba versijos stulpelis, bet aš aiškiai stengiuosi išvengti naujų stulpelių įvedimo į schemą. Tai reiškia, kad tai daug sunkiau.
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.
Dabar profiliai domenuose su numatytosiomis kalbomis rodomi su klausimais ir turiniu tik šiuo metu pasirinkta kalba (arba visomis, jei įjungta „Panlingual“), išskyrus domenus, kuriuose nėra numatytosios kalbos.
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.
Žemiau pateikiamas aprašymas, kaip vyksta registracija ir susisiekimas su vartotoju. Taip pat, kaip tam tikras pokalbių su vartotojais turinys gali būti įtrauktas į viešąjį arba bendruomenės profilį.
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.
Šiuo metu patogiau kam nors duoti nuorodą į savo „Infinity“ profilį ir tikėtis, kad jiems bus patogu peržiūrėti savo idėjas, projektus ir pradėti bendrauti.
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 dokumentą reikia susieti su skaičiais, kad „dokumento ID 0 pomėgiai[0].name=sam“ taptų 0@0.0=sam. Tai leidžia efektyviai gauti duomenis nuskaitant raktų diapazoną tarp skaičių. ⬜️Reikia parašyti kodą, kad skaičiai vėl virstų laukų pavadinimais ⬜️reikia integruoti klavišų erdvės optimizavimo priemonę, nes pertvarkome skaičius, kad sujungimai būtų efektyvūs sąrašuose, pvz., document 0 = {"hobbies":{("vardas": "Dievas"),{"vardas": "duomenų bazės"), {" pavadinimas": "kompiuteriai")}) pomėgiai gali būti 0, pavadinimas gali būti 1 ir mes turime 3 sąrašo elementus 0, 1, 2 norime, kad visi tos pačios rūšies sąrašo indeksai būtų greta rūšiavimo iteratoriuje, todėl juos apverčiame iki galo, todėl 0@0[1]="Dievas" tampa 0@1.0, 0@1.1 0@1.2 ⬜️ Reikia sukurti raktines reikšmes, kurios naudojamos SQL sujungimams ⬜️ reikia sukurti dokumentą, kuris apibrėžia sujungimus, kuriuos žmonės tikisi atlikti JSON dokumente
⬜️ 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
Turiu 3 įrenginius su 1 disku, kuriame yra saugojimo vietos Diskas rodomas kaip vienas didelis diskas su visų įrenginių saugykla
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
Neįkėliau raktų, bet galiu. Tai tik bandomieji raktai.
Aš dirbu naudodamas virtualiosios dėžutės valkatos nuolatinius tomus. Tai reiškia, kad galiu turėti saugojimo diską, susietą su kiekviena 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.
Tam praleidau kelias valandas.
Jei tai būtų taikoma visoms programų kilpoms, galėtume turėti dar efektyvesnes programas.
I spent a few hours on this.
If this was applied to all looping of programs, we could have even more efficient programs.
Perrašykite Python kodą Java, kad būtų galima naudoti tikrą daugiagiją Įdiekite kilpos paleidimo gijas, kurios pakartotinai bando vykdyti N-ąjį produktą, atitinkantį tą gijos numerį
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. Pasirinkite tinkamą atsargų valdymo sistemą. Man reikia SĄRAŠŲ: 1- Komponentai 2- Medžiagos 3- Produktai 4- Pakavimo medžiagos 5- Pakavimo sprendimai 6- ATO komponentai (Surinkimas pagal užsakymą) 7- Gamybos informacijos failas
B. Apibrėžkite VISUS mano SĄRAŠUS:
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
PASUKITE MANO SISTEMĄ Į KOPIJUOTĄ – KAIRĖJE.
TODĖL KURIU SISTEMĄ, KURIĄ ĮSIVAIZDUOJU GERIAUSIA MANO BENDRUOMENĖS PREKĖS ŽENKLEI, IR KURIAU VISKĄ KOPIJAI.
TAIP VIENINTELIS KELIS Į LAISVĘ, MANO NUOMONĖS.
KOMENTARAI SVEIKI.
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 valandos Esu gana patenkinta tuo, ką sukūriau. Manau, kad API galėtų būti geresnė. Arba rezultatų laukimo įgyvendinimas galėtų būti geresnis. Skaičiavimas, norint pamatyti, ar yra naujų rezultatų, yra brangus dėl įdėtų kilpų. Manau, kad tai būtų galima padaryti geriau. Idealiu atveju įdėtoms kilpoms reikia tik kelių divmod instrukcijų ir papildymų. Priešingu atveju jie turi dominuoti naudojamuose veiksmuose.
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 valandas nepamenu, kada pradėjau
Gaunu pasikartojančius įrašus.
Pirminė kilpa atrodo taip:
už laišką raidėmis: už skaičių skaičiais:
simboliui simboliuose:
Tada bandau jį išplėsti nauja lygiagrečia kilpa vidinės kilpos viduje.
Bet kiekviena iteracija atrodytų taip pat! Tai nėra lygiavertis šiam:
už laišką raidėmis: už skaičių skaičiais:
simboliui simboliuose:
įdėtiems kodams: jaustams įdėtoje: spausdinti (raidės skaičiaus simbolis įdėtas jaustukas)
Man reikia tam tikro būdo, kaip išplėsti kilpą per tam tikrą skaičių kilpų, pavyzdžiui, kilpų medį.
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.