Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.org/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2023-11-26 00:00:00Z and 2023-11-27 00:00:00Z
06:28
just wanted to tell ya
06:29
thx for keep mantaining this beautiful game
06:29
without you all this couldn't be the same
06:29
just thanks
06:30
(I'm literally learning C++ just to understand the DDNet code and be part of you all)
Avatar
Avatar
Blazulite
(I'm literally learning C++ just to understand the DDNet code and be part of you all)
pepeW
Avatar
Hey is the 0.7 bridge used on official DDNet servers proprietary?
Avatar
Avatar
Teero
why isnt there a += operator for vec2 and template type defined pepeW (edited)
vec2 does have += operator
Avatar
Avatar
fokkonaut
vec2 does have += operator
But only for vec2 and vec2
Avatar
u drunk?
08:27
or what do you wanna add to a vec2?
08:27
u mean like vec2(1, 2) + 3 = vec2(4, 5) ? (edited)
Avatar
Avatar
jeremy
Hey is the 0.7 bridge used on official DDNet servers proprietary?
No it's open source
Avatar
chillerdragon BOT 2023-11-26 08:34:17Z
Hey 0.7 enjoyer why are you asking? :)
Replying to @jeremy Hey is the 0.7 bridge used on official DDNet servers proprietary?
Avatar
Avatar
fokkonaut
u mean like vec2(1, 2) + 3 = vec2(4, 5) ? (edited)
vec2 a; a += 2
Avatar
Well it doesnt really make any sense tbh
Avatar
Huh? It adds 2 to x and y (edited)
Avatar
i dont understand ur question
Avatar
well my usecase was like v[i] * 32 + 16
Avatar
chillerdragon BOT 2023-11-26 08:39:25Z
sus bot code
Avatar
vec2(16, 16)
Avatar
Avatar
chillerdragon
sus bot code
very sus Tas generator
Avatar
chillerdragon BOT 2023-11-26 08:40:10Z
Holy shit it actually is a bot? :D
Avatar
chillerdragon BOT 2023-11-26 08:40:25Z
Hehe
Avatar
It's computer science
08:40
🧪🔭
Avatar
chillerdragon BOT 2023-11-26 08:40:49Z
I won’t judge
08:41
Got banned yesterday on if City for anti afk bot xD
08:41
stop discussing bot questions
Avatar
chillerdragon BOT 2023-11-26 08:41:54Z
hehe
08:42
ddnet #developer the all you can ask channel for aspiring bot developers
Avatar
chillerdragon BOT 2023-11-26 08:42:39Z
xxxxD
Avatar
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 🗺️ So no bot talk
08:57
I'm trying to solve this game so I can finally break through this addiction
08:58
It looks fancy too
Avatar
morning
09:38
Helm is a free, cross-platform, polyphonic synthesizer with a powerful modulation system. Helm runs on GNU/Linux, Mac, and Windows as a standalone program or as a LV2/VST/VST3/AU plugin.
09:39
An algorithm that can analyse hundreds of millions of genetic sequences has identified DNA-cutting genes and enzymes that are extremely rare in nature.
09:39
crispr the future
09:39
helm for me is the app manager for kubernetes
09:40
ew kubernetes
09:40
shoo away
09:40
the cloud will soon die
Avatar
no, cloud is good
09:40
look at OVH when they burned
09:40
at least it was saved in real clouds
Avatar
ChillerDragon BOT 2023-11-26 09:50:05Z
@Anime.pdf
09:50
did the ping work?
09:50
can someone help ping this weeb
Avatar
It looks like it worked
Avatar
ChillerDragon BOT 2023-11-26 09:50:37Z
thanks robsit
09:50
yo anime pdf you still got wire? i slid into your dms
Avatar
chiller ur a secret weeb
09:52
to be good dev u need to be weeb
09:53
man i wish i could self host email without being blocked by china or the world
09:53
i rly hate this side of email
09:53
apparently u need to pick a hoster that likes to maintain good ip reputation
09:54
hetzner doesnt have good because ppl often host vpns
09:54
and vpns lower rep
Avatar
ChillerDragon BOT 2023-11-26 09:55:05Z
im not good dev and no weeb
09:55
i like saying owo tho xd
Avatar
you are something that is a weeb for anime, just for tw
09:56
@Jupstar ✪ did u know about esync
Avatar
yeah
09:58
Who's car is this
Avatar
Avatar
Ryozuki
apparently u need to pick a hoster that likes to maintain good ip reputation
you dont only need a good reputation. domain lifetime, dane, dnssec, SPF and so on
Avatar
whats dane
Avatar
DANE
Avatar
anyway i had dkimp spf etc
Avatar
dkim also
Avatar
but china didnt accept my emails for ddnet wiki
10:00
:c
Avatar
ChillerDragon BOT 2023-11-26 10:00:19Z
jopsti a weeb for tw is just called nerd xd
Avatar
DNS-based Authentication of Named Entities (DANE) is an Internet security protocol to allow X.509 digital certificates, commonly used for Transport Layer Security (TLS), to be bound to domain names using Domain Name System Security Extensions (DNSSEC).It is proposed in RFC 6698 as a way to authenticate TLS client and server entities without a ce...
Avatar
chillerdragon: you ignored my awesome joke on offtopic xd
Avatar
@Avolicious u have ur self hosted email?
Avatar
Avatar
Ryozuki
@Avolicious u have ur self hosted email?
kog.tw does, yes
Avatar
and china users have no problem?
Avatar
I cant really tell so far, because the CHN registered player number is pretty low but worked so far
10:01
I often fight with mail.ru support team
10:01
they block us because our domain lifetime is too low
Avatar
Mail stuff is one of my worst nightmare as a sysadmin
10:02
Just annoying (edited)
Avatar
ChillerDragon BOT 2023-11-26 10:02:53Z
oh no jopsti i will check it later i just cba to boot matrix now
Avatar
it's really worth to boot it up now
Avatar
Avatar
ReiTW
Mail stuff is one of my worst nightmare as a sysadmin
ye
10:19
i use fastmail for now
Avatar
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.
Avatar
For example, if you bind y echo test using a QWERTZ keyboard layout then you instead activate the bind with the Z key. This is detrimental for #7393, which uses Ctrl+Z/Y for the undo/redo actions r...
Avatar
sry im qwerty
10:50
arent germans azerty
Avatar
No, Germany uses qwertz
10:51
I think azerty is mostly used in France
Avatar
Avatar
Robyt3
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.
I confirm that it does not do anything on Windows at least
Avatar
Avatar
Robyt3
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.
nothing changes on linux thonk
Avatar
With which keys did you try? Same example with Y-Z on an qwertz keyboard?
11:03
I think the config variable was originally about someone rebinding capslock as escape
11:03
Which seems completely different from this use case
Avatar
Avatar
Robyt3
With which keys did you try? Same example with Y-Z on an qwertz keyboard?
i bound echo test to y, and no matter what it was printing test on y
Avatar
If you have a qwerty keyboard then that should be correct at least
Avatar
it works the same with qwertz
Avatar
There's probably nothing to translate there
11:05
So on qwertz you also get the correct keys each time?
11:05
Maybe it never worked on Windows pepeW
Avatar
wait.. thonk
Avatar
It works correct when in text-input mode, for example when you type in the console
11:06
But for key events like binding in the settings menu the keys are swapped
Avatar
i had to press y on qwery and z on qwertz
Avatar
Did inp_translated_keys change anything about this? Did you try with both 0 and 1?
Avatar
i tried changing it
11:08
nothing happened xd (edited)
Avatar
So you tried the bind with both values once?
11:08
inp_translated_keys should have effect immediately for all following key events
11:10
I guess it only works for keys that are remapped differently, since the opener of the original issue confirmed that the variable worked
Avatar
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
11:11
i hope i wrote it as clear as possible pepeW (edited)
Avatar
Yes, thanks 🙂
Avatar
@Robyt3 i dont think inp_translated_keys is actually related to keyboard layouts
11:14
it only converts scancodes to virtual codes i think
11:14
#issues/
11:14
lol
Avatar
yeah, the other way around, but I guess it doesn't help in this case
Avatar
#4241
Avatar
On Linux (X11), I have remapped my Caps Lock to ESC with setxkbmap us -option caps:escape -variant de_se_fi. In the original Teeworlds and in pretty much every game I know, they respect this settin...
Avatar
Avatar
ChillerDragon
yo anime pdf you still got wire? i slid into your dms
I don't think i do, even if i will download it back, it won't show any messages, you can contact me via emailgreenthing
Avatar
@Robyt3 the question is what is cleaner: actually save the binds with a keyboard layout or just show the user in binds or bind <key> the translation between both layouts similar with time formats. u often save the time in a specific format, and only convert it on fly
11:17
that has greater compability
Avatar
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.
Avatar
yeah, but if you switch keyboard layouts it's "broken"
Avatar
Avatar
Robyt3
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.
as said, the bind can be adjusted
11:19
to transalte the z to y
Avatar
Avatar
Jupstar ✪
yeah, but if you switch keyboard layouts it's "broken"
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 (edited)
11:21
Most games I played just ignore this issue it seems
Avatar
i guess historically we had weird problems with SDL2 (edited)
11:22
lol
11:22
my brain is broken rn
Avatar
I don't really care about binds with this issue TBH, but it's a blocker for the editor undo/redo
11:23
I don't know if it's possible to only do this for the UI without it becoming a mess
Avatar
Avatar
Robyt3
I don't really care about binds with this issue TBH, but it's a blocker for the editor undo/redo
what would the bind for editor be?
Avatar
Ctrl+Z/Y are supposed to be used for undo/redo
11:23
But they would be swapped on QWERTZ keyboards
Avatar
i think that is a very german thing
11:24
ctrl + y for undo ctrl + shift + y for redo
11:24
that's how i know it at least
Avatar
It's also a Windows thing
Avatar
also on english layout?
11:25
and language set to english
Avatar
Avatar
Jupstar ✪
ctrl + y for undo ctrl + shift + y for redo
This is how it is for most newer things
Avatar
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)
11:26
Maybe making this keybind system dependent would be the best way out of this mess without rewriting the entire input system
Avatar
mh ok, didnt know windows does that for other languages too
11:27
always thought they do it based on locale
11:28
well then i guess your argument is legit, position independent sounds better in this case
11:28
let's just hope that SDL2 is not a mess anymore
11:28
i have bad memories about it
Avatar
I can only imagine how many issues SDL3 porting would bring
Avatar
xdd
Avatar
I never quite understood that key translation PR. We probably just should have had our defaults depend on layout
Avatar
Teeworlds just binds chat to both Z and Y
Avatar
mh, winit simply translate my z key to Y
11:35
our engine does that too right?
Avatar
winit pog rust pog
11:37
physical key is z
11:37
rest is translated to y
11:37
which makes sense
Avatar
I think we just use whatever scancode SDL provides though
11:38
With translated keys it translates the keycode to scancode but that only affects some edge-cases I guess
Avatar
Avatar
Jupstar ✪
Click to see attachment 🖼️
ah that was pressing y btw
11:40
on german keyboard
Avatar
So the problem is that translating keys will simply respecting the keyboard layout and we end up with the original scancode again (edited)
Avatar
Avatar
Robyt3
So the problem is that translating keys will simply respecting the keyboard layout and we end up with the original scancode again (edited)
yeah and if we dont use scancodes?
11:42
do u think that makes trouble? xd
Avatar
Problem: Then you switch keyboard layout to Russian and starts the game, keys that uses alphabet letters don't work. A solution is only to switch back layout and restart the game. Some specs: D...
Avatar
when i look at how winit implement logical keys
Avatar
And deen had specific reasons for using scancodes AFAICT
Avatar
i sweat a little
11:44
a variant of different stuff xD
11:44
following the w3c spec
11:45
chinese character bind support 😬
Avatar
With ddnet/SDL I get this: Pressed Z on germany keyboard: sym=SDLK_z scancode=SDL_SCANCODE_Y translated=SDL_SCANCODE_Y Pressed Y on germany keyboard: sym=SDLK_y scancode=SDL_SCANCODE_Z translated=SDL_SCANCODE_Z
Avatar
so some ppl change keyboard layouts quite often?
11:47
mh interesting
11:47
is that an enum?
11:47
SDL_Keycode
11:48
SDL_SCANCODE_* are identical to our KEY_* constants
Avatar
so they just use it differently logically
11:49
we should probably look how SDL3 will do this tbh
11:49
if they also follow the w3c spec, this gonna be a mess
Avatar
Yeah, probably better in the long run. We just need a workaround to unblock editor undo/redo.
Avatar
mh
11:51
i mean the +shift solution would probably work
11:51
could bind it to y and z
Avatar
Avatar
Robyt3
Yeah, probably better in the long run. We just need a workaround to unblock editor undo/redo.
Use the other standard?
11:52
Ctrl + y is pretty much microsoft products only, and even then in vscode it isn't
Avatar
Yeah, so Undo = Ctrl+Y&Z and Redo = Shift+Ctrl+Y&Z
Avatar
Avatar
Learath2
Ctrl + y is pretty much microsoft products only, and even then in vscode it isn't
I always used Ctrl+Y on windows to redo things, and for me it works in vscode. 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 because W maps to Z and Z maps to W (edited)
Avatar
Maybe it's my vscode config then
Avatar
Avatar
Learath2
Maybe it's my vscode config then
It does it if ur keyboard is set to German only
11:58
It knows
11:59
And apparently French
Avatar
Avatar
Learath2
Maybe it's my vscode config then
Avatar
fee9b98 Added possibility to edit chat size and width. Refactored chat preview code. - archimede67 c00fb01 Merge pull request #7540 from archimede67/pr-chat-options - Robyt3
Avatar
Avatar
archimede67
Click to see attachment 🖼️
Default keybindings of vscode from their docs
Avatar
@archimede67 uff wsad broken in any game u know?
12:00
Bcs of this weird layout
Avatar
Avatar
Jupstar ✪
@archimede67 uff wsad broken in any game u know?
games that don't support key rebinding, but most games just work with azerty layout, also for me wasd is zqsd
12:02
also its funny because everyone always say to press a to go left, while on my keyboard it is q
Avatar
xdd
12:05
french troll mode
12:11
@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 saving it as W in the bind would result in a very weird position for other users. On the other hand side: if you modify the .cfg directly using text editor you'd need to be aware of this. 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 So i guess, keep as is? XD
Avatar
@archimede67 Do you think Undo = Ctrl+Y&Z and Redo = Shift+Ctrl+Y&Z would be a good enough workaround? (edited)
Avatar
Avatar
archimede67
also its funny because everyone always say to press a to go left, while on my keyboard it is q
i'm using colemak. it's the same
Avatar
Avatar
Robyt3
@archimede67 Do you think Undo = Ctrl+Y&Z and Redo = Shift+Ctrl+Y&Z would be a good enough workaround? (edited)
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
Avatar
Avatar
archimede67
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
Either that or we need some special handling to translate those keys differently so the same keybinds work for everyone
Avatar
Avatar
Robyt3
Either that or we need some special handling to translate those keys differently so the same keybinds work for everyone
or both
12:27
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
Avatar
Yeah, separate binds systems for ingame/menu/editor/demo etc would be cool as well
👍 1
Avatar
Avatar
archimede67
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
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
Avatar
Avatar
Jupstar ✪
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
How does the "Controls" tab work for reading a key to bind?
Avatar
controls simply takes whatever u press
12:32
and translate that to scancode anyway
12:33
my point is really more like this: u press W on your fench keyboard -> internally it might use Z or Y or whatever the scancode is if you view the binds -> it converts this Z or Y to your current keyboard layout
12:33
so it will show as W again
12:33
and on german keyboard it will show Z
12:33
and on english Y
12:33
but the position on the keyboard is the same for all
Avatar
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?
Avatar
yes but imo this is only a display problem
12:35
internally it should still use a a
12:35
else this bind is not sharable across other layouts
Avatar
Do we want the binds to be sharable across other layouts?
Avatar
IMHO this makes most sense
12:36
if u share your deepfly bind and suddenly the player has to press keys on the numpad, this would suck xD
12:36
ofc not realistic example
Avatar
I guess yeah
12:40
But now I come back to the initial issue, how to make Ctrl+Z work for everyone for example?
12:45
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
Avatar
Avatar
archimede67
But now I come back to the initial issue, how to make Ctrl+Z work for everyone for example?
you simply don't do it at all. You could make different default binds for different layouts Or you could make the whole binding handling differ between logical keys and scancodes
12:49
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
Avatar
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
Avatar
that probably depends on the app
12:53
i can understand that this sucks for tools like the editor
12:53
as robyte said maybe a completely different handling would make sense for editor
12:53
but for ingame it would be weird IMO
Avatar
See commit messages.

Checklist

  • [X] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet...
Avatar
numabs: mov rsi, rax neg rax cmovl rax, rsi ; if rax is neg, restore its value ret (edited)
13:01
@Learath2 pog abs
13:01
with cmovl
Avatar
That is a cute way to do abs 😄
13:24
don't think that's how any compiler would write it though, I wonder if it has better performance
13:28
Oh they do, that's cool
13:28
gcc10 generates the old xor-sub one, but since gcc11 it generates the conditional move too
Avatar
Avatar
Ryozuki
numabs: mov rsi, rax neg rax cmovl rax, rsi ; if rax is neg, restore its value ret (edited)
is this assembly
Avatar
But if you use march native or any intel march it'll generate xor-sub again, that's curious
Avatar
Avatar
Voxel
is this assembly
yes
Avatar
Avatar
Learath2
Oh they do, that's cool
ye its how i found it from internet xd
Avatar
For AMD it generates a cmov, for intel it generates xor-sub
Avatar
; reverse_str(str, len) ; rdi, rsi reverse_str: ; rdi start ptr ; rax end ptr mov rax, rdi add rax, rsi sub rax, 1 .loop: cmp rdi, rax jge .done mov r10b, [rax] mov r11b, [rdi] mov [rax], r11b mov [rdi], r10b add rdi, 1 sub rax, 1 jmp .loop .done: ret i made this entirely myself, note that i dont do null terminated strings
13:38
it probs is not optimized xd
Avatar
lowest level coder
Avatar
Not like you can do much to optimize it tbf, you could avoid using an extra register but that might be worse than better
13:46
You can vectorize it I guess that would be an optimization
13:47
Oh maybe XCHG?
13:48
idk if it can do memory/memory xchg though
13:49
Yeah no, there is no such addressing mode
Avatar
41d2c80 Add templated CHeap::Allocate function - Robyt3 ec6d7b4 Use nullptr instead of 0x0 - Robyt3 7a142df Move variable declarations closer to usages - Robyt3 591c08c Use static_casts instead of C style, remove unnecessary casts - Robyt3 c90899c Merge pull request #7549 from Robyt3/Memheap-Refactoring - def-
Avatar
i made my own itoa
13:55
but well this got bigger so i wont paste it
13:56
here
13:56
for any base (tm)
Avatar
That is one big itoa
Avatar
Avatar
Learath2
That is one big itoa
are there short itoa?
Avatar
Hm, I think I saw one for apple2 in 6502 assembly. But yeah it's usually not very smol
Avatar
Avatar
Learath2
Hm, I think I saw one for apple2 in 6502 assembly. But yeah it's usually not very smol
i dont follow any calling convention or do i setup a stack frame so mine is probs short (?) xD
14:00
im wild so i dont even save registers
14:00
i do it at call site
14:01
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
Avatar
Ah but iirc it only had base10
Avatar
section .bss str_buf resb 32 %include 'lib/lib.asm' section .text _start: mov rdi, [rsp] ; number of cli arguments lea rsi, [rsp + 8] ; first arg (*path) call main ; main(argc, argv) ; rdi, rsi main: call alloc_init lea rdx, [str_buf] mov rdi, 169 mov rsi, 16 call int_to_str lea rdi, [str_buf] mov rsi, rax call println mov rdi, rax call exit ❯ ./program a9
14:02
i made my own main handle xd
Avatar
Take a look at how gcc and clang optimize std::to_chars if you want to see something truly disgusting 😄
14:12
but the main idea is writing the string back to front by first figuring out the number of digits
14:15
ye
Avatar
Does anyone have a decent python resource?
Avatar
chillerdragon BOT 2023-11-26 14:49:36Z
for wat
14:49
begineers?
14:49
lerato learning paiton axaxax
Avatar
Beginners would work
15:47
@Learath2 who u teaching
Avatar
Avatar
Ryozuki
@Learath2 who u teaching
I never really read anything on python, was just looking to polish my knowledge on it
15:48
Oh also I found another algorithm that's unexpected, have any of you heard of Kadane's algorithm for the maximum subarray problem?
15:49
I had a feeling one couldn't do better than O(nlogn), but apparently one can 😄
Avatar
In computer science, the maximum sum subarray problem, also known as the maximum segment sum problem, is the task of finding a contiguous subarray with the largest sum, within a given one-dimensional array A[1...n] of numbers. It can be solved in O ( n ) {\displaystyle O(n)} time...
15:51
wiki shows it
15:51
first page
15:51
xd
Avatar
Well duh, you can ofc google it, but how are you supposed to develop your intuition if you google everything?
Avatar
mimimi
Avatar
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?
Avatar
The naive way to do it is O(n^3) so you can't even say just get a better computer KEKW
Avatar
naive would be 2^n justatest
Avatar
Only contiguous subarrays are considered
15:57
So slices of the original array if you will
Avatar
oh right
Avatar
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
Avatar
Avatar
Learath2
Only contiguous subarrays are considered
i think itd be n^2 in that case then
16:07
if you just iterate thru the array from beginning to end n times for each subset size
16:08
the linear algorithm is cool though greedy algorithms always feel like cheats
Avatar
Avatar
louis
i think itd be n^2 in that case then
You also have to sum up the subsets, which is another O(n) so O(n^3)
16:14
To get to O(n^2) you need to employ a very simple DP trick
Avatar
Avatar
Robyt3
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
Have you tried just re-running it? Sometimes github actions just goof
Avatar
Avatar
Learath2
Have you tried just re-running it? Sometimes github actions just goof
Yeah, it happens consistently
16:17
master branch worked 1h before, so unless the CI changed something in that time it must be my changes (edited)
Avatar
Looks like I fixed it by removing rustup default 1.48.0 from the non-fancy Linux initialization step
Avatar
why so olkd
16:54
old
Avatar
Seems like it was just forgotten
16:55
But why does this cause a linking error in the tests due to my changes?
Avatar
The old default version causes linking errors for the tests in the non-fancy Linux CI, i.e. with Ubuntu 20.04.

Checklist

  • [ ] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps ...
Avatar
any of u tried meson?
17:01
it looks way faster than cmake
17:01
❯ meson setup --buildtype=release --prefix=/usr builddir The Meson build system Version: 1.2.3 Source dir: /data2/edgar/vkBasalt Build dir: /data2/edgar/vkBasalt/builddir Build type: native build Project name: vkBasalt Project version: undefined C compiler for the host machine: ccache cc (gcc 12.3.1 "cc (Gentoo 12.3.1_p20230825 p2) 12.3.1 20230825") C linker for the host machine: cc ld.bfd 2.40 C++ compiler for the host machine: ccache c++ (gcc 12.3.1 "c++ (Gentoo 12.3.1_p20230825 p2) 12.3.1 20230825") C++ linker for the host machine: c++ ld.bfd 2.40 Host machine cpu family: x86_64 Host machine cpu: x86_64 Program glslangValidator found: YES (/usr/bin/glslangValidator) Compiler for C++ supports arguments -Wno-unknown-pragmas: YES Found pkg-config: /usr/bin/pkg-config (1.8.1) Run-time dependency x11 found: YES 1.8.7 Configuring config_paths.hpp using configuration Configuring vkBasalt.json using configuration Build targets in project: 3 vkBasalt undefined User defined options buildtype: release prefix : /usr Found ninja-1.11.1 at /usr/bin/ninja
17:02
it did this instant
Avatar
Avatar
Ryozuki
any of u tried meson?
mesa
Avatar
ChillerDragon BOT 2023-11-26 17:16:18Z
oddly satisfying that this line works the same way in c as in ruby puts("foo" "bar");
17:17
Avatar
Before !image After !image

Checklist

  • [x] Tested the change ingame
  • [x] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible nu...
Avatar
Avatar
Learath2
Oh also I found another algorithm that's unexpected, have any of you heard of Kadane's algorithm for the maximum subarray problem?
never heard of this algorithm, what's the use case ?
Avatar
Avatar
Chairn
never heard of this algorithm, what's the use case ?
It was originally explored as a reduced version of a more general problem of looking for a maximal rectangle in a 2d array
18:18
I came across it as an exercise 😄
19:06
fd6c4ec Fix alignment of buttons in vote menu. - furo321 fc8728b Merge pull request #7551 from furo321/align-vote-menu - Robyt3
Avatar
When AI Map Designing?
Avatar
when tune lock
Avatar
when tune lock
Avatar
locks are slow, better use barriers
21:51
e7f4be1 Remove unnecessary rustup default 1.48.0 in non-fancy Linux CI - Robyt3 0213535 Merge pull request #7550 from Robyt3/CI-Rustup-Remove-Default - def-
Avatar
Move all code for handling of config variables from console to config manager. The console no longer depends on the config manager, instead the config manager now depends on the console. Add structs to manage config variables of different types (int, color and string). The config manager now keeps a list of all config variables, so usage of the preprocessor can be avoided except for code to initially create all config variables. Additionally, a separate list of just the game config varia...
Avatar
Many valgrind errors "Conditional jump or move depends on uninitialised value" appear when running the integration test (also in the CI). For some reason this doesn't cause the CI to fail though it probably should. The uninitialized variables are likely the result of #6256, which removed the mem_zero of CClient. Full error log at 0213535dd8ce88e9eb2088c894a9536a05736758: valgrind.log
Avatar
Are ddnet maps Turing complete?
Avatar
Description of Changes Disables Wayland, it's super broken/buggy in basically every scenario. KDE isn't too buggy, GNOME is a complete disaster. Stupid obsession with CSD in Gnome => in...
23:18
Disables Wayland, it's super broken/buggy in basically every scenario. KDE isn't too buggy, GNOME is a complete disaster. Stupid obsession with CSD in Gnome => inconsistency Inability to position windows => window position saving doesn't work, log window attaching (not merged yet) doesn't work Hacks in render-to-main because WL craps itself otherwise Despite said hacks, game list still glitches after stopping emulation, happens more often in gnome NVIDIA just crashes in swap chain creation under Wayland Broken global menus and many others Until they sort their s**t out, which is unlikely, since there's been very little progress over the last decade, just keep it disabled. For the Flatpaks, users can re-enable it with flatseal if they really want the crappy experience.
23:18
lmao
23:21
Quoting @stenzek > But Wayland is just broken, and everyone would rather sit around arguing with each other instead of actually addressing the design flaws. > It's not the first time such a proposal has been put forward. Something that developers need for their applications to work properly on WL (particularly multi-window applications), and it gets vetoed. Every other OS manages this fine. But apparently we're in the wrong for not conforming to some warped view of how applications should be, despite our applications working fine on every other platform. This is so damn true. Wayland lacks a Linus-style BDFL saying that the kern... the compositor is for applications, and not the other way around. We won't have nice things until Wayland maintainers stop thinking about what their end users must or must not do, and start closing feature gaps with X and compositors/window managers on other OSes. Right now they're reinventing the wheel while making it square.
Avatar
When I have to scroll to see the ping,i know it was ryo xddd
Avatar
Avatar
Ryozuki
Disables Wayland, it's super broken/buggy in basically every scenario. KDE isn't too buggy, GNOME is a complete disaster. Stupid obsession with CSD in Gnome => inconsistency Inability to position windows => window position saving doesn't work, log window attaching (not merged yet) doesn't work Hacks in render-to-main because WL craps itself otherwise Despite said hacks, game list still glitches after stopping emulation, happens more often in gnome NVIDIA just crashes in swap chain creation under Wayland Broken global menus and many others Until they sort their s**t out, which is unlikely, since there's been very little progress over the last decade, just keep it disabled. For the Flatpaks, users can re-enable it with flatseal if they really want the crappy experience.
Xdd for every broken no joke
Avatar
is wayland that bad?
Avatar
Under kde it's quite ok. But for some reason there are driver bugs extremely often when i try it out
23:32
And it's faster than x11
23:32
That's ofc argument for me brownbear
23:38
But it's true they always take like twenty years to implement stuff. And the maintainers are pretty based. Tearing took like two years until it was merged and then another year to be merged into the graphics drivers
Exported 379 message(s)