00:40 < bridge> why isnt there a += operator for vec2 defined :pepeW: 00:40 < bridge> why isnt there a += operator for vec2 and float defined :pepeW: 00:40 < bridge> why isnt there a += operator for vec2 and float (T) defined :pepeW: 00:40 < bridge> why isnt there a += operator for vec2 and template type defined :pepeW: 00:41 < bridge> there is one for /= *= and -= but not for += 00:41 < bridge> just weird 00:41 < bridge> there is one for /=, *= and -= but not for += 00:41 < bridge> just weird 07:28 < bridge> hi 07:28 < bridge> just wanted to tell ya 07:29 < bridge> thx for keep mantaining this beautiful game 07:29 < bridge> without you all this couldn't be the same 07:29 < bridge> just thanks 07:30 < bridge> (I'm literally learning C++ just to understand the DDNet code and be part of you all) 07:56 < bridge> :pepeW: 08:15 < bridge> Hey is the 0.7 bridge used on official DDNet servers proprietary? 09:25 < bridge> vec2 does have += operator 09:26 < bridge> But only for vec2 and vec2 09:26 < bridge> u drunk? 09:27 < bridge> or what do you wanna add to a vec2? 09:27 < bridge> u mean like `vec2(1, 2) + 3 = vec(4, 5)` ? 09:28 < bridge> u mean like `vec2(1, 2) + 3 = vec2(4, 5)` ? 09:31 < bridge> No it's open source 09:34 < bridge> Hey 0.7 enjoyer why are you asking? :) 09:37 < bridge> vec2 a; 09:37 < bridge> a += 2 09:37 < bridge> Well it doesnt really make any sense tbh 09:38 < bridge> Huh? It adds 2 to X and y 09:38 < bridge> Huh? It adds 2 to x and y 09:38 < bridge> i dont understand ur question 09:39 < bridge> well my usecase was like v[i] * 32 + 16 09:39 < bridge> sus bot code 09:39 < bridge> vec2(16, 16) 09:39 < bridge> very sus Tas generator 09:40 < bridge> Holy shit it actually is a bot? :D 09:40 < bridge> :think_bot: 09:40 < bridge> ehmmm 09:40 < bridge> Hehe 09:40 < bridge> It's computer science 09:40 < bridge> πŸ§ͺπŸ”­ 09:40 < bridge> I won’t judge 09:41 < bridge> Got banned yesterday on if City for anti afk bot xD 09:41 < bridge> :ban: 09:41 < bridge> Haha 09:41 < bridge> :banhammer: 09:41 < bridge> stop discussing bot questions 09:41 < bridge> hehe 09:42 < bridge> ddnet \#developer the all you can ask channel for aspiring bot developers 09:42 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1178254435542114376/e21f26271474ed3862dae2d3b26e7c70.png?ex=657579f4&is=656304f4&hm=31f1e8485643791d5235a3f5f13c0d26b7d7fd5460124f6eeba2f3d37a2cb92d& 09:42 < bridge> xxxxD 09:56 < bridge> well ig it's just part of a pathfinding algorithm that finds the approximately perfect path for a Tee to go on a Gores map πŸ—ΊοΈ 09:56 < bridge> So no bot talk 09:57 < bridge> I'm trying to solve this game so I can finally break through this addiction 09:58 < bridge> It looks fancy too 10:34 < bridge> morning 10:38 < bridge> https://tytel.org/helm/ 10:39 < bridge> https://www.nature.com/articles/d41586-023-03697-w 10:39 < bridge> crispr the future 10:39 < bridge> tf 10:39 < bridge> helm for me is the app manager for kubernetes 10:40 < bridge> xd 10:40 < bridge> ew kubernetes 10:40 < bridge> shoo away 10:40 < bridge> the cloud will soon die 10:40 < bridge> no, cloud is good 10:40 < bridge> look at OVH when they burned 10:40 < bridge> at least it was saved in real clouds 10:50 < ChillerDragon> @Anime.pdf 10:50 < ChillerDragon> did the ping work? 10:50 < ChillerDragon> can someone help ping this weeb 10:50 < bridge> It looks like it worked 10:50 < ChillerDragon> thanks robsit 10:50 < ChillerDragon> yo anime pdf you still got wire? i slid into your dms 10:52 < bridge> chiller ur a secret weeb 10:52 < bridge> to be good dev u need to be weeb 10:53 < bridge> man i wish i could self host email without being blocked by china or the world 10:53 < bridge> i rly hate this side of email 10:53 < bridge> apparently u need to pick a hoster that likes to maintain good ip reputation 10:54 < bridge> hetzner doesnt have good because ppl often host vpns 10:54 < bridge> and vpns lower rep 10:55 < ChillerDragon> im not good dev and no weeb 10:55 < ChillerDragon> i like saying owo tho xd 10:56 < bridge> you are something that is a weeb for anime, just for tw 10:56 < bridge> https://github.com/lutris/docs/blob/master/HowToEsync.md 10:56 < bridge> @jupeyy_keks did u know about esync 10:57 < bridge> 10:57 < bridge> yeah 10:58 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1178273639523696681/rn_image_picker_lib_temp_8888723e-4ada-4bb0-ae0c-ed0f33cf63fa-1.jpg?ex=65758bd6&is=656316d6&hm=50573d4cf44228196af9836287175bd82e726872f9a15176682b30ff2414bde7& 10:58 < bridge> Who's car is this 10:59 < bridge> you dont only need a good reputation. domain lifetime, dane, dnssec, SPF and so on 11:00 < bridge> whats dane 11:00 < bridge> DANE 11:00 < bridge> anyway i had dkimp spf etc 11:00 < bridge> dkim also 11:00 < bridge> but china didnt accept my emails for ddnet wiki 11:00 < bridge> :c 11:00 < ChillerDragon> jopsti a weeb for tw is just called nerd xd 11:00 < bridge> https://de.wikipedia.org/wiki/DNS-based_Authentication_of_Named_Entities 11:00 < bridge> https://en.wikipedia.org/wiki/DNS-based_Authentication_of_Named_Entities 11:00 < bridge> chillerdragon: you ignored my awesome joke on offtopic xd 11:00 < bridge> @avolicious u have ur self hosted email? 11:01 < bridge> kog.tw does, yes 11:01 < bridge> and china users have no problem? 11:01 < bridge> I cant really tell so far, because the CHN registered player number is pretty low but worked so far 11:01 < bridge> I often fight with mail.ru support team 11:01 < bridge> they block us because our domain lifetime is too low 11:02 < bridge> Mail stuff is one of my worst nightmare as a sysadmin 11:02 < bridge> Just annoyint 11:02 < bridge> Just annoying 11:02 < ChillerDragon> oh no jopsti i will check it later i just cba to boot matrix now 11:03 < bridge> it's really worth to boot it up now 11:19 < bridge> ye 11:19 < bridge> i use fastmail for now 11:46 < bridge> Can anyone else with a non-QWERTY keyboard layout test #7544? For me `inp_translated_keys 1` doesn't do anything on Windows. When I bind something to Z I need to press Y instead to trigger the bind. 11:46 < bridge> https://github.com/ddnet/ddnet/issues/7544 11:50 < bridge> sry im qwerty 11:50 < bridge> arent germans azerty 11:51 < bridge> No, Germany uses qwertz 11:51 < bridge> I think azerty is mostly used in France 11:57 < bridge> I confirm that it does not do anything on Windows at least 11:58 < bridge> nothing changes on linux :thonk: 12:03 < bridge> With which keys did you try? Same example with Y-Z on an qwertz keyboard? 12:03 < bridge> I think the config variable was originally about someone rebinding capslock as escape 12:03 < bridge> Which seems completely different from this use case 12:03 < bridge> i bound echo test to y, and no matter what it was printing test on y 12:04 < bridge> If you have a qwerty keyboard then that should be correct at least 12:04 < bridge> it works the same with qwertz 12:04 < bridge> There's probably nothing to translate there 12:05 < bridge> So on qwertz you also get the correct keys each time? 12:05 < bridge> Maybe it never worked on Windows :pepeW: 12:05 < bridge> wait.. :thonk: 12:06 < bridge> It works correct when in text-input mode, for example when you type in the console 12:06 < bridge> But for key events like binding in the settings menu the keys are swapped 12:06 < bridge> i had to press y on qwery and z on qwertz 12:07 < bridge> Did `inp_translated_keys` change anything about this? Did you try with both `0` and `1`? 12:07 < bridge> i tried changing it 12:08 < bridge> nothign happened xd 12:08 < bridge> nothing happened xd 12:08 < bridge> So you tried the bind with both values once? 12:08 < bridge> `inp_translated_keys` should have effect immediately for all following key events 12:10 < bridge> I guess it only works for keys that are remapped differently, since the opener of the original issue confirmed that the variable worked 12:11 < bridge> I bound `echo y ehcho test` when i had qwerty layout it triggered the bind when pressing the key from image, when i set qwertz layout the bind was triggered on the same key as on the image above. command `inp_translated_keys` did nothing 12:11 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1178291950777016441/image.png?ex=65759ce4&is=656327e4&hm=7901d19f2efb4ed7271a935647c0b77df280c8547e48be43d19ee7f42ccf9377& 12:11 < bridge> i hope not i wrote it as clear as possible :pepeW: 12:12 < bridge> i hope i wrote it as clear as possible :pepeW: 12:12 < bridge> Yes, thanks πŸ™‚ 12:14 < bridge> @robyt3 i dont think inp_translated_keys is actually related to keyboard layouts 12:14 < bridge> it only converts scancodes to virtual codes i think 12:14 < bridge> #issues/ 12:14 < bridge> lol 12:14 < bridge> yeah, the other way around, but I guess it doesn't help in this case 12:14 < bridge> #4241 12:14 < bridge> https://github.com/ddnet/ddnet/issues/4241 12:15 < bridge> I don't think i do, even if i will download it back, it won't show any messages, you can contact me via email:greenthing: 12:17 < bridge> @robyt3 the question is what is cleaner: 12:17 < bridge> actually save the binds with a keyboard layout 12:17 < bridge> or 12:17 < bridge> just show the user in `binds` or `bind ` the translation between both layouts 12:17 < bridge> 12:17 < bridge> 12:17 < bridge> similar with time formats. 12:17 < bridge> u often save the time in a specific format, and only convert it on fly 12:17 < bridge> that has greater compability 12:18 < bridge> I don't quite understand the use case for not translating everything. If I `bind z echo test` I want the command to be executed when I press the key labelled `Z` on my keyboard. 12:19 < bridge> yeah, but if you switch keyboard layouts it's "broken" 12:19 < bridge> as said, the bind can be adjusted 12:19 < bridge> to transalte the z to y 12:21 < bridge> Is that how any other game does it? How often do you switch keyboard layouts? Having the binds be position independent makes to share them with other I guess 12:21 < bridge> Is that how any other game does it? How often do you switch keyboard layouts? Having the binds be position independent makes it easier to share them with other I guess 12:21 < bridge> Most games I played just ignore this issue it seems 12:22 < bridge> i guess historically we had weird problems with steam 12:22 < bridge> i guess historically we had weird problems with SDL2 12:22 < bridge> lol 12:22 < bridge> my brain is broken rn 12:22 < bridge> I don't really care about binds with this issue TBH, but it's a blocker for the editor undo/redo 12:23 < bridge> I don't know if it's possible to only do this for the UI without it becoming a mess 12:23 < bridge> what would the bind for editor be? 12:23 < bridge> Ctrl+Z/Y are supposed to be used for undo/redo 12:23 < bridge> But they would be swapped on QWERTZ keyboards 12:24 < bridge> i think that is a very german thing 12:24 < bridge> ctrl + y for undo 12:24 < bridge> ctrl + shift + y for redo 12:24 < bridge> that's how i know it at least 12:25 < bridge> It's also a Windows thing 12:25 < bridge> also on english layout? 12:25 < bridge> and language set to english 12:25 < bridge> https://support.microsoft.com/en-us/office/undo-redo-or-repeat-an-action-84bdb9bc-4e23-4f06-ba78-f7b893eb2d28 12:25 < bridge> This is how it is for most newer things 12:25 < bridge> > In most Microsoft Windows applications, the keyboard shortcut for the undo command is Ctrl+Z or Alt+Backspace, and the shortcut for redo is Ctrl+Y or Ctrl+Shift+Z. (Wikipedia) 12:26 < bridge> Maybe making this keybind system dependent would be the best way out of this mess without rewriting the entire input system 12:27 < bridge> mh ok, didnt know windows does that for other languages too 12:27 < bridge> always thought they do it based on locale 12:28 < bridge> well then i guess your argument is legit, position independent sounds better in this case 12:28 < bridge> let's just hope that SDL2 is not a mess anymore 12:28 < bridge> i have bad memories about it 12:29 < bridge> I can only imagine how many issues SDL3 porting would bring 12:29 < bridge> xdd 12:31 < bridge> I never quite understood that key translation PR. We probably just should have had our defaults depend on layout 12:32 < bridge> Teeworlds just binds chat to both Z and Y 12:35 < bridge> mh, winit simply translate my z key to Y 12:35 < bridge> our engine does that too right? 12:37 < bridge> winit pog rust pog 12:37 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1178298482046545950/image.png?ex=6575a2f9&is=65632df9&hm=b8a5ef457a66206a67d7664a1e0adcd4363030a991d67e774f934dec46bbd1ad& 12:37 < bridge> physical key is z 12:37 < bridge> rest is translated to y 12:37 < bridge> which makes sense 12:37 < bridge> I think we just use whatever scancode SDL provides though 12:38 < bridge> With translated keys it translates the keycode to scancode but that only affects some edge-cases I guess 12:39 < bridge> ah that was pressing y btw 12:40 < bridge> on german keyboard 12:41 < bridge> So the problem is that translating keys will simply respect the keyboard layout and we end up with the original scancode again 12:41 < bridge> So the problem is that translating keys will simply respecting the keyboard layout and we end up with the original scancode again 12:42 < bridge> yeah and if we dont use scancodes? 12:42 < bridge> do u think that makes trouble? xd 12:42 < bridge> I think that introduces https://github.com/teeworlds/teeworlds/issues/1531 12:42 < bridge> when i look at how winit implement logical keys 12:42 < bridge> And deen had specific reasons for using scancodes AFAICT 12:42 < bridge> i sweat a little 12:43 < bridge> https://github.com/rust-windowing/winit/blob/17296e98783a19c2f0a552340682e3de2b863de8/src/keyboard.rs#L1466-L1486 12:44 < bridge> a variant of different stuff xD 12:44 < bridge> following the w3c spec 12:44 < bridge> https://w3c.github.io/uievents-key/ 12:45 < bridge> chinese character bind support 😬 12:46 < bridge> With ddnet/SDL I get this: 12:46 < bridge> ``` 12:46 < bridge> Pressed Z on germany keyboard: sym=SDLK_z scancode=SDL_SCANCODE_Y translated=SDL_SCANCODE_Y 12:46 < bridge> Pressed Y on germany keyboard: sym=SDLK_y scancode=SDL_SCANCODE_Z translated=SDL_SCANCODE_Z 12:46 < bridge> ``` 12:46 < bridge> so some ppl change keyboard layouts quite often? 12:47 < bridge> mh interesting 12:47 < bridge> is that an enum? 12:47 < bridge> SDL_Keycode 12:47 < bridge> https://wiki.libsdl.org/SDL2/SDL_Keycode 12:48 < bridge> `SDL_SCANCODE_*` are identical to our `KEY_*` constants 12:48 < bridge> so they just use it differently logically 12:49 < bridge> we should probably look how SDL3 will do this tbh 12:49 < bridge> if they also follow the w3c spec, this gonna be a mess 12:49 < bridge> Yeah, probably better in the long run. We just need a workaround to unblock editor undo/redo. 12:51 < bridge> mh 12:51 < bridge> i mean the `+shift` solution would probably work 12:51 < bridge> could bind it to y and z 12:51 < bridge> Use the other standard? 12:52 < bridge> Ctrl + y is pretty much microsoft products only, and even then in vscode it isn't 12:52 < bridge> Yeah, so Undo = Ctrl+Y&Z and Redo = Shift+Ctrl+Y&Z 12:57 < bridge> I always used `Ctrl+Y` on windows to redo things, and for me it works in vscode. 12:57 < bridge> 12:57 < bridge> This layout problem is a thing that has been there forever, and honestly it's kinda bad to have to bind another key to be able to use the correct key on my keyboard. For example I have bound `w` to emote something, and it works when I press the `Z` key. Similarly, I bound `z` to something else and that bind works when I press the `W` key. I am using AZERTY layout, and while working on the editor undo/redo I always have to press `Ctrl+W` to undo 12:58 < bridge> I always used `Ctrl+Y` on windows to redo things, and for me it works in vscode. 12:58 < bridge> 12:58 < bridge> This layout problem is a thing that has been there forever, and honestly it's kinda bad to have to bind another key to be able to use the correct key on my keyboard. For example I have bound `W` to emote something, and it works when I press the `Z` key. Similarly, I bound `Z` to something else and that bind works when I press the `W` key. I am using AZERTY layout, and while working on the editor undo/redo I always have to press `Ctrl+W` to undo 12:58 < bridge> Maybe it's my vscode config then 12:58 < bridge> It does it if ur keyboard is set to German only 12:58 < bridge> It knows 12:59 < bridge> And apparently French 12:59 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1178303966933680138/image.png?ex=6575a815&is=65633315&hm=d4310f536689b0e4813e24a081636e52b82bdafa1d4cd1ed3ec41518cf29702c& 12:59 < bridge> Default keybindings of vscode from their docs 13:00 < bridge> @archimede67 uff wsad broken in any game u know? 13:00 < bridge> Bcs of this weird layout 13:01 < bridge> games that don't support key rebinding, but most games just work with azerty layout, also for me `wasd` is `zqsd` 13:02 < bridge> also its funny because everyone always say to press `a` to go left, while on my keyboard it is `q` 13:05 < bridge> xdd 13:05 < bridge> french troll mode 13:11 < bridge> @robyt3 so theoretically translating the key when typing the bind in the console couldℒ️ make sense in these cases, since the physical key will then work everywhere 13:11 < bridge> 13:11 < bridge> saving it as W in the bind would result in a very weird position for other users. 13:11 < bridge> 13:11 < bridge> On the other hand side: if you modify the .cfg directly using text editor you'd need to be aware of this. 13:11 < bridge> 13:11 < bridge> For the editor undo feature it's a bit more complex since it's not a purely translation problem, but more like a what ppl are used to problem xd 13:11 < bridge> 13:11 < bridge> So i guess, keep as is? XD 13:18 < bridge> @archimede67 Do you think Undo = Ctrl+Y&Z and Redo = Shift+Ctrl+Y&Z and would a good enough workaround? 13:19 < bridge> i'm using colemak. it's the same 13:19 < bridge> @archimede67 Do you think Undo = Ctrl+Y&Z and Redo = Shift+Ctrl+Y&Z would be a good enough workaround? 13:25 < bridge> Well I still never saw Ctrl+Y to undo something but if some are used to this then sure, but that won't solve the azerty layout problem, I would still have to press Ctrl+W for it to detect it as Ctrl+Z. Adding the Shift modifier to redo seems alright to me, but I believe that in the end we should definitely have a way to rebind editor hard-coded binds 13:26 < bridge> Either that or we need some special handling to translate those keys differently so the same keybinds work for everyone 13:27 < bridge> *or both* 13:27 < bridge> In my opinion we should find a way to have layout independent keybinds, meaning that if I bind the `z` key then pressing the corresponding labeled `z` key on my keyboard should trigger the bind 13:27 < bridge> Yeah, separate binds systems for ingame/menu/editor/demo etc would be cool as well 13:30 < bridge> imo this isn't a problem with our current system generally, it's just a problem with how the binds command in console interprets your key. because once the bind uses scancodes, it should work on the same position independent of the keyboard layout 13:31 < bridge> How does the "Controls" tab work for reading a key to bind? 13:32 < bridge> controls simply takes whatever u press 13:32 < bridge> and translate that to scancode anyway 13:33 < bridge> my point is really more like this: 13:33 < bridge> u press W on your fench keyboard -> internally it might use Z or Y or whatever the scancode is 13:33 < bridge> 13:33 < bridge> if you view the binds -> it converts this Z or Y to your current keyboard layout 13:33 < bridge> so it will show as W again 13:33 < bridge> and on german keyboard it will show Z 13:33 < bridge> and on english Y 13:33 < bridge> but the position on the keyboard is the same for all 13:34 < bridge> I press `q` to bind "Move left", I expect the bind to show `q` but it instead shows `a`. Can't we make it so it shows the correct key for the current keyboard layout? 13:34 < bridge> yes but imo this is only a display problem 13:35 < bridge> internally it should still use a `a` 13:35 < bridge> else this bind is not sharable across other layouts 13:36 < bridge> Do we want the binds to be sharable across other layouts? 13:36 < bridge> IMHO this makes most sense 13:36 < bridge> if u share your deepfly bind and suddenly the player has to press keys on the numpad, this would suck xD 13:36 < bridge> ofc not realistic example 13:37 < bridge> I guess yeah 13:40 < bridge> But now I come back to the initial issue, how to make Ctrl+Z work for everyone for example? 13:45 < bridge> For layouts where the Z position is at the same position as in the QWERTY layout it works, but for layouts where it is not the case, we have to press the key at that specific position, regardless of the label of said key, it could say "W", "F", "O", it doesn't matter 13:48 < bridge> you simply don't do it at all. 13:48 < bridge> 13:48 < bridge> You could make different default binds for different layouts 13:48 < bridge> 13:48 < bridge> Or you could make the whole binding handling differ between logical keys and scancodes 13:49 < bridge> but i'm sure just as learath i had a time where vscode used ctrl+y and ctrl+shift+y.. nowadays it seems to detect i'm using german keyboard and changed these binds 13:51 < bridge> How does apps do it then, it seems like no matter the layout, you have to press the same labeled key for the action to work, not the same key position 13:53 < bridge> that probably depends on the app 13:53 < bridge> i can understand that this sucks for tools like the editor 13:53 < bridge> as robyte said maybe a completely different handling would make sense for editor 13:53 < bridge> but for ingame it would be weird IMO 14:00 < bridge> ```x86asm 14:00 < bridge> numabs: 14:00 < bridge> mov rsi, rax 14:00 < bridge> neg rax 14:01 < bridge> cmovl rax, rsi ; rax is neg, restore its value 14:01 < bridge> ret 14:01 < bridge> ``` 14:01 < bridge> @learath2 pog abs 14:01 < bridge> with cmovl 14:01 < bridge> ```x86asm 14:01 < bridge> numabs: 14:01 < bridge> mov rsi, rax 14:01 < bridge> neg rax 14:01 < bridge> cmovl rax, rsi ; if rax is neg, restore its value 14:01 < bridge> ret 14:01 < bridge> ``` 14:23 < bridge> That is a cute way to do abs πŸ˜„ 14:24 < bridge> don't think that's how any compiler would write it though, I wonder if it has better performance 14:28 < bridge> Oh they do, that's cool 14:28 < bridge> gcc10 generates the old xor-sub one, but since gcc11 it generates the conditional move too 14:29 < bridge> <_voxeldoesart> is this assembly 14:32 < bridge> But if you use march native or any intel march it'll generate xor-sub again, that's curious 14:36 < bridge> yes 14:37 < bridge> ye its how i found it from internet xd 14:37 < bridge> For AMD it generates a cmov, for intel it generates xor-sub 14:38 < bridge> ```x86asm 14:38 < bridge> ; reverse_str(str, len) 14:38 < bridge> ; rdi, rsi 14:38 < bridge> reverse_str: 14:38 < bridge> ; rdi start ptr 14:38 < bridge> ; rax end ptr 14:38 < bridge> mov rax, rdi 14:38 < bridge> add rax, rsi 14:38 < bridge> sub rax, 1 14:38 < bridge> 14:38 < bridge> .loop: 14:38 < bridge> cmp rdi, rax 14:38 < bridge> jge .done 14:38 < bridge> mov r10b, [rax] 14:38 < bridge> mov r11b, [rdi] 14:38 < bridge> mov [rax], r11b 14:38 < bridge> mov [rdi], r10b 14:38 < bridge> add rdi, 1 14:38 < bridge> sub rax, 1 14:38 < bridge> 14:38 < bridge> jmp .loop 14:38 < bridge> 14:38 < bridge> .done: 14:38 < bridge> ret 14:38 < bridge> ``` 14:38 < bridge> i made this entirely myself, note that i dont do null terminated strings 14:38 < bridge> it probs is not optimized xd 14:39 < bridge> <_voxeldoesart> lowest level coder 14:46 < bridge> Not like you can do much to optimize it tbf, you could avoid using an extra register but that might be worse than better 14:46 < bridge> You can vectorize it I guess that would be an optimization 14:47 < bridge> Oh maybe XCHG? 14:48 < bridge> idk if it can do memory/memory xchg though 14:49 < bridge> Yeah no, there is no such addressing mode 14:55 < bridge> i made my own itoa 14:55 < bridge> but well this got bigger so i wont paste it 14:56 < bridge> https://github.com/edg-l/aoc2023-nasm/blob/4eb01a606b48a3fbb80838d092f068a48f4504a3/lib/string.asm#L40 14:56 < bridge> here 14:56 < bridge> for any base (tm) 14:56 < bridge> That is one big itoa 14:57 < bridge> are there short itoa? 14:58 < bridge> Hm, I think I saw one for apple2 in 6502 assembly. But yeah it's usually not very smol 15:00 < bridge> i dont follow any calling convention or do i setup a stack frame so mine is probs short (?) xD 15:00 < bridge> im wild so i dont even save registers 15:00 < bridge> i do it at call site 15:01 < bridge> so i know if i need to save a register, and this enables me to save some instructions if i know some functions work well witthout saving registers 15:01 < bridge> Ah but iirc it only had base10 15:02 < bridge> ```x86asm 15:02 < bridge> section .bss 15:02 < bridge> str_buf resb 32 15:02 < bridge> 15:02 < bridge> 15:02 < bridge> %include 'lib/lib.asm' 15:02 < bridge> 15:02 < bridge> section .text 15:02 < bridge> 15:02 < bridge> _start: 15:02 < bridge> mov rdi, [rsp] ; number of cli arguments 15:02 < bridge> lea rsi, [rsp + 8] ; first arg (*path) 15:02 < bridge> call main 15:02 < bridge> 15:02 < bridge> ; main(argc, argv) 15:02 < bridge> ; rdi, rsi 15:02 < bridge> main: 15:02 < bridge> call alloc_init 15:02 < bridge> 15:02 < bridge> lea rdx, [str_buf] 15:02 < bridge> mov rdi, 169 15:02 < bridge> mov rsi, 16 15:02 < bridge> call int_to_str 15:02 < bridge> 15:02 < bridge> lea rdi, [str_buf] 15:02 < bridge> mov rsi, rax 15:02 < bridge> call println 15:02 < bridge> 15:02 < bridge> mov rdi, rax 15:02 < bridge> call exit 15:02 < bridge> 15:03 < bridge> i made my own main handle xd 15:11 < bridge> Take a look at how gcc and clang optimize `std::to_chars` if you want to see something truly disgusting πŸ˜„ 15:12 < bridge> but the main idea is writing the string back to front by first figuring out the number of digits 15:15 < bridge> ohh 15:15 < bridge> ye 15:49 < bridge> Does anyone have a decent python resource? 15:49 < bridge> for wat 15:49 < bridge> begineers? 15:49 < bridge> lerato learning paiton axaxax 15:50 < bridge> Beginners would work 16:47 < bridge> kek 16:47 < bridge> @learath2 who u teaching 16:48 < bridge> I never really read anything on python, was just looking to polish my knowledge on it 16:49 < bridge> Oh also I found another algorithm that's unexpected, have any of you heard of Kadane's algorithm for the maximum subarray problem? 16:49 < bridge> I had a feeling one couldn't do better than O(nlogn), but apparently one can πŸ˜„ 16:51 < bridge> https://en.wikipedia.org/wiki/Maximum_subarray_problem 16:51 < bridge> wiki shows it 16:51 < bridge> first page 16:51 < bridge> xd 16:52 < bridge> Well duh, you can ofc google it, but how are you supposed to develop your intuition if you google everything? 16:52 < bridge> mimimi 16:52 < bridge> In this case I gave you the name of the problem, what if it occured as part of some other thing you wanted to do? 16:53 < bridge> xd 16:54 < bridge> The naive way to do it is O(n^3) so you can't even say just get a better computer :KEKW: 16:56 < bridge> naive would be 2^n :justatest: 16:57 < bridge> Only contiguous subarrays are considered 16:57 < bridge> So slices of the original array if you will 16:58 < bridge> oh right 17:02 < bridge> Anyone got any ideas why specifically the Ubuntu-20 build fails linking rust tests on this branch? https://github.com/Robyt3/ddnet/tree/Config-Refactoring 17:06 < bridge> i think itd be n^2 in that case then 17:07 < bridge> if you just iterate thru the array from beginning to end n times for each subset size 17:08 < bridge> the linear algorithm is cool though 17:08 < bridge> greedy algorithms always feel like cheats 17:14 < bridge> You also have to sum up the subsets, which is another O(n) so O(n^3) 17:14 < bridge> To get to O(n^2) you need to employ a very simple DP trick 17:16 < bridge> Have you tried just re-running it? Sometimes github actions just goof 17:16 < bridge> Yeah, it happens consistently 17:17 < bridge> master branch worked 1h before, so unless the CI changes something in that time it must be my changes 17:17 < bridge> master branch worked 1h before, so unless the CI changed something in that time it must be my changes 17:51 < bridge> Looks like I fixed it by removing `rustup default 1.48.0` from the non-fancy Linux initialization step 17:54 < bridge> why so olkd 17:54 < bridge> old 17:54 < bridge> Seems like it was just forgotten 17:54 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1178378321952776372/image.png?ex=6575ed55&is=65637855&hm=c8c6ea06b19180a5942ce2a420d16b1e48582f9419e2749764c82f1d7de4360c& 17:55 < bridge> But why does this cause a linking error in the tests due to my changes? 18:01 < bridge> any of u tried meson? 18:01 < bridge> it looks way faster than cmake 18:01 < bridge> ``` 18:02 < bridge> ❯ meson setup --buildtype=release --prefix=/usr builddir 18:02 < bridge> The Meson build system 18:02 < bridge> Version: 1.2.3 18:02 < bridge> Source dir: /data2/edgar/vkBasalt 18:02 < bridge> Build dir: /data2/edgar/vkBasalt/builddir 18:02 < bridge> Build type: native build 18:02 < bridge> Project name: vkBasalt 18:02 < bridge> Project version: undefined 18:02 < bridge> C compiler for the host machine: ccache cc (gcc 12.3.1 "cc (Gentoo 12.3.1_p20230825 p2) 12.3.1 20230825") 18:02 < bridge> C linker for the host machine: cc ld.bfd 2.40 18:02 < bridge> C++ compiler for the host machine: ccache c++ (gcc 12.3.1 "c++ (Gentoo 12.3.1_p20230825 p2) 12.3.1 20230825") 18:02 < bridge> C++ linker for the host machine: c++ ld.bfd 2.40 18:02 < bridge> Host machine cpu family: x86_64 18:02 < bridge> Host machine cpu: x86_64 18:02 < bridge> Program glslangValidator found: YES (/usr/bin/glslangValidator) 18:02 < bridge> Compiler for C++ supports arguments -Wno-unknown-pragmas: YES 18:02 < bridge> Found pkg-config: /usr/bin/pkg-config (1.8.1) 18:02 < bridge> Run-time dependency x11 found: YES 1.8.7 18:02 < bridge> Configuring config_paths.hpp using configuration 18:02 < bridge> Configuring vkBasalt.json using configuration 18:02 < bridge> Build targets in project: 3 18:02 < bridge> 18:02 < bridge> vkBasalt undefined 18:02 < bridge> 18:02 < bridge> User defined options 18:02 < bridge> buildtype: release 18:02 < bridge> prefix : /usr 18:02 < bridge> 18:02 < bridge> Found ninja-1.11.1 at /usr/bin/ninja 18:02 < bridge> ``` 18:02 < bridge> it did this instant 18:08 < bridge> mesa 18:16 < ChillerDragon> oddly satisfying that this line works the same way in c as in ruby ``puts("foo" "bar");`` 18:17 < ChillerDragon> https://zillyhuhn.com/cs/.1701019067.png 19:12 < bridge> never heard of this algorithm, what's the use case ? 19:13 < bridge> I suppose the problem is this 19:15 < bridge> It was originally explored as a reduced version of a more general problem of looking for a maximal rectangle in a 2d array 19:18 < bridge> I came across it as an exercise πŸ˜„ 21:37 < bridge> When AI Map Designing? 22:01 < bridge> <_voxeldoesart> when tune lock 22:10 < bridge> when tune lock 22:18 < bridge> locks are slow, better use barriers 23:41 < bridge> :justatest: 23:41 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1178465566508466229/image.png?ex=65763e95&is=6563c995&hm=22fc5400b7129e6d64ed2c16f6926f45d0d573b9af3d1bc43a1fb3cbeff16c90& 23:48 < bridge> Are ddnet maps Turing complete?