08:10 < bridge> war is no more, we landed fixes for russia and ukraine 08:10 < bridge> :justatest: 08:10 < bridge> >_> 08:44 < bridge> bruh 11:44 < bridge> ima fix https://github.com/ddnet/ddnet/issues/6638 11:45 < bridge> @Ryozuki could you change the representation in the server to `std::optional` everywhere? 11:45 < bridge> so we don't have the magic value -9999 there 11:45 < bridge> context? 11:46 < bridge> isnt more -9999 a magic value that has to be sent due to the client interpreting it specially 11:46 < bridge> i see it in the server info in the browser sometimes 11:46 < bridge> but yeah you can’t send a std optional over net lol 11:47 < bridge> I'm guessing heinrich is saying it should be optional everywhere within the server and only get serialized as -9999 11:47 < bridge> yeah 11:47 < bridge> which is half that way already 11:50 < bridge> ah i see 11:52 < bridge> yup, but the score is somehow -9999 and that has to be interpreted by the 0.7 code to be changed to -1, I think 11:52 < bridge> why is any negative score value possible 11:52 < bridge> time or real score 11:52 < bridge> just de/serialize as unsigned 11:52 < bridge> i think the cclient in serverbrowser.h needs to stay non optional 11:54 < bridge> I only meant in the server; but theoretically, even the serverbrowser.h could be made `std::optional` 11:55 < bridge> true 12:23 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110150923608653914/image.png 12:23 < bridge> fixed it, but sometimes there is 1 player showing without time at the top 12:23 < bridge> rly weird 12:24 < bridge> his time is 6:43 12:24 < bridge> in game 12:32 < bridge> -3223 12:32 < bridge> why does this guy report a negative score 12:33 < bridge> is this some kind of bug? 12:33 < bridge> idk i see them too 12:33 < bridge> oh 12:33 < bridge> the current client displays them as having no time 12:33 < bridge> but he has 53 mins 12:34 < bridge> in game 12:34 < bridge> damn 12:39 < bridge> well the score is either full negative to 0 being time 0 12:39 < bridge> or positive to 0 12:39 < bridge> so abs fixes it 12:41 < bridge> client-side? could you only do the `abs` if the server doesn't specify that it's doing time scores? 12:42 < bridge> the thing is 12:42 < bridge> ddnet is reporting time score 12:42 < bridge> and some clients send a negative score for some reason 12:42 < bridge> 1-3 usually 12:42 < bridge> idk why 12:42 < bridge> clients? 12:42 < bridge> game servers? 12:42 < bridge> im looking at where ddnet sends the server info 12:42 < bridge> the ddnet client, reports a player having a negative score 12:42 < bridge> like -3305 12:42 < bridge> whne it should be positive 12:43 < bridge> because ddnet reports time score 12:43 < bridge> (oficial server) 12:43 < bridge> hmmm 12:43 < bridge> that's weird 12:43 < bridge> the current client 16.9 doesnt even show them having time 12:43 < bridge> due to this 12:43 < bridge> but u see them with time when u join 12:43 < bridge> and look tab 12:44 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110156120410030191/image.png 12:44 < bridge> i have this on the sort rn 12:44 < bridge> and it displays all good 12:44 <+ChillerDragon> ircd u heinrich 12:44 < bridge> i had to change the render of the score too in the browser 12:44 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110156230565036082/image.png 12:44 < bridge> (but we shouldn't add compatibility with buggy servers if we can just fix the buggy servers) 12:44 < bridge> this is to render the negative score players on time too 12:44 < bridge> true 12:44 < bridge> altho this fix is harmless 12:44 < bridge> im trying to find where ddnet sends the info 12:45 < bridge> src/engine/server/server.cpp 12:45 < bridge> `CServer::UpdateRegisterServerInfo` 12:45 < bridge> `m_aClients[i].m_Score == -1 ? -9999 : m_aClients[i].m_Score` 12:45 < bridge> its this currently 12:46 < bridge> added by u 12:46 < bridge> i guess here its a good place 12:46 < bridge> to use the optional 12:46 < bridge> i guess i forgot to chang eit 12:47 < bridge> yea 12:47 < bridge> note that this supports setting the time to 9999, even 12:47 < bridge> true 12:47 < bridge> but its not backcompat 12:47 < bridge> to old clients 12:47 < bridge> or is it 12:48 < bridge> i dont care but i know u care 12:48 < bridge> I think for this particular thing, I don't care so much 12:48 < bridge> but let me check anyway 12:48 < bridge> (because it's not a problem when trying to play the game) 12:49 < bridge> what score do we send to sixup 12:49 < bridge> when no score is there 12:49 < bridge> I checked it when doing my PR, you can look there 12:49 < bridge> -1, I think 13:11 < bridge> > The absolute(CurrentClient.m_Score) >= 0 seems pointless. If it's supposed to check for MIN_INT, then the call to absolute is already UB. 13:11 < bridge> no 13:11 < bridge> it is meant to check for the negative values ddnet sends sometimes 13:13 < bridge> the int min is used on a temp var to stort 13:13 < bridge> sort, its never there 13:14 < bridge> absolute converts a number into a non-negative number 13:14 < bridge> yeah 13:14 < bridge> so checking whether the absolute is greater or equal to zero sounds pointless 13:14 < bridge> ah true 13:14 < bridge> xd 13:17 < bridge> well i dont have the will to figure out why the sv sends negative sometimes 13:17 < bridge> so u can accept the fix or wait a undetermined amount of time 13:33 < bridge> Isn’t it supposed to be negative for times? 13:35 < bridge> it doesnt matter 13:35 < bridge> the client always did abs on the score 13:35 < bridge> time and score handling sucks 13:36 < bridge> cuz back compat 13:36 < bridge> i hate back compat 13:36 < bridge> and i shouldnt have gotten into this 13:36 < bridge> i regret itn ow xd 13:39 < bridge> idk why ddnet-libs got updated 13:39 < bridge> and how to revert it 13:39 < bridge> today is not my day oof 13:41 < bridge> Reset mixed, cd into submodule, reset hard, cd back out, commit, force push 13:43 < bridge> reset mixed? 13:43 < bridge> how 13:44 < bridge> Well first, is it the last commit or another commit you updated submodule in? 13:44 < bridge> idk 13:44 < bridge> warning: --mixed with paths is deprecated; use 'git reset -- ' instead. 13:45 < bridge> ❯ git reset --mixed upstream/master -- ddnet-libs/ 13:45 < bridge> warning: --mixed with paths is deprecated; use 'git reset -- ' instead. 13:45 < bridge> Unstaged changes after reset: 13:45 < bridge> M ddnet-libs 13:45 < bridge> It seems to be the very first commit 13:45 < bridge> i did this 13:45 < bridge> Do you want to squash your commits? 13:45 < bridge> my inner self doesnt want to, cuz commit points xd 13:45 < bridge> but i dont mind 13:46 < bridge> Δ ddnet-libs 13:46 < bridge> ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 13:46 < bridge> 328fd20..625457e 13:46 < bridge> Ok, `git reset —hard origin/pr_fix_info; git rebase -i upstream/master` 13:46 < bridge> In the interactive rebase mark the very first commit with `e` instead of `pick` 13:47 < bridge> ah ye 13:47 < bridge> i fixup'ed the others 13:47 < bridge> felt guilty 13:48 < bridge> Rebase will check out your first commit, when there cd into the submodule, `git reset —hard HEAD`, get out, `git commit —amend`, `git rebase —continue` and a force push to finish it up 13:48 < bridge> ❯ git reset --hard HEAD 13:48 < bridge> HEAD is now at 625457e Update libraries 13:48 < bridge> i think thats the wrong commit 13:49 < bridge> oh 13:49 < bridge> i just needed to git pull 13:49 < bridge> XD 13:49 < bridge> ❯ git pull 13:49 < bridge> Updating 625457e..328fd20 13:49 < bridge> Fast-forward 13:50 < bridge> got it 13:50 < bridge> Nope 13:50 < bridge> Still managed to update ddnet-libs 😄 13:51 < bridge> nah 13:51 < bridge> refresh 13:52 < bridge> ill remove the useles math header too 13:52 < bridge> You made 2 commits, one changing ddnet-libs, the next reverting it 13:52 < bridge> lol true 13:52 < bridge> xd 13:52 < bridge> With the exact same name 13:53 < bridge> Git struggles 13:53 < bridge> now 13:54 < bridge> i tested it a bit, and it works nice 13:54 < bridge> Congrats 13:54 < bridge> points are shown in order, time in ordere 13:54 < bridge> idk if i did test any backcompat time server 13:54 < bridge> cuz idk which one is 13:54 < bridge> well 13:55 < bridge> fokko one is 13:55 < bridge> maybe 13:55 < bridge> Unique probably isn’t all the way up to date 13:56 < bridge> @Learath2 do u know 13:56 < bridge> if gores reports some time 13:56 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110174347429158922/image.png 13:56 < bridge> Hm, KoG has been trying to follow closer to master, but idk if they got the time flag yet 13:57 < bridge> But judging by your screenshot backcompat does look broken 13:57 < bridge> @Avolicious update kog, make it send "score_kind": "time" to masters ty bye 13:57 < bridge> idk if its set to backcompat 13:57 < bridge> or points here 13:57 < bridge> Always the easy way out with you people 😄 13:58 < bridge> xd 13:58 < bridge> I have electromagnetism to go study. This isn’t in the RC yet is it? 13:58 < bridge> If it is the RC is not shippable imo 13:59 < bridge> wdym 14:00 < bridge> @Learath2 im making him a favour 14:00 < bridge> btw 14:00 < bridge> 16.9 14:00 < bridge> shows same 14:00 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110175300345671780/image.png 14:00 < bridge> so its not that its not backcompat 14:00 < bridge> its thatis interpreted as points 14:00 < bridge> Mh, then 16.9 shouldn’t have been shipped, meh 14:00 < bridge> u mean all versions? 14:00 < bridge> since kog changed ddnet to kog 14:01 < bridge> has been like this iirc 14:01 < bridge> when u join it shows time tho 14:01 < bridge> the proper fix here is for them to send a score_kind 14:01 < bridge> and not us to add a special gores check 14:01 < bridge> A negative score and a raceish~ gametype should always result in time score displayed 14:01 < bridge> KoG is latest ddnet lol 14:01 < bridge> not latest enough 14:01 < bridge> Its latest latest 14:02 < bridge> update to current master 14:02 < bridge> its current master 14:02 < bridge> is that server updated 14:02 < bridge> or have you pushed in the last 10 minutes? 14:02 < bridge> do u send score_kind 14:02 < bridge> y 14:02 < bridge> 7 months ago 14:02 < bridge> Then it’s worse than the backcompat being broken 14:02 < bridge> @Avolicious ah 14:03 < bridge> its "client_score_kind" 14:03 < bridge> first KoG server that I check doesn't send it 14:03 < bridge> `"client_score_kind": "time"` 14:03 < bridge> `"tw-0.6+udp://5.181.124.84:8303"` 14:03 < bridge> u assume the worst of us 14:03 < bridge> and not others 14:03 < bridge> smth 14:03 < bridge> in: `https://master1.ddnet.org/ddnet/15/servers.json` 14:04 < bridge> backcompat is only set on these 14:04 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110176314721308732/image.png 14:04 < bridge> race and fastcap 14:04 < bridge> so we not forcefully setting gores to backcompat 14:04 < bridge> they should send the proper flag 14:05 < bridge> Ah I remember they changed gametypes, it’s Gores now 14:05 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110176545005383722/Screenshot_2023-05-22_140502.png 14:05 < bridge> Maybe for some reason that codepath isn’t being taken? Or the server just hasn’t been updated due to a silent deployment issue? 14:06 < bridge> Though looks pretty hardcoded to me 14:06 < bridge> can you confirm that `"tw-0.6+udp://5.181.124.84:8303"` is on your latest master? @Avolicious 14:06 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110176860941324369/image.png 14:06 < bridge> u not sending it 14:07 < bridge> Yes, are the latest stable ones 14:07 < bridge> @heinrich5991 could the master filter it out? 14:07 < bridge> it should reflect all u send right 14:07 < bridge> odd 14:07 < bridge> the master doesn't look at the JSON 14:07 < bridge> yeah 14:07 < bridge> why is it not there 14:07 < bridge> to me, it looks like that particular server doesn't send it 14:08 < bridge> which would mean that the server is likely not runnign the code that Avo thinks it's running 14:08 < bridge> none do 14:08 < bridge> havne't checked the others 14:08 < bridge> but Ryo did, probably 🙂 14:08 < bridge> `UpdateRegisterServerInfo` is where the flag gets set 14:08 < bridge> I've not changed anything on HTTPs Register stuff 14:10 < bridge> but are u sure the deployed servers are using the version u expect 14:10 < bridge> If you didn’t change anything there then I’m also voting some deployment issue 14:10 < bridge> Servers do have this version 14:10 < bridge> We verify it by comparing the SHA256 File hash 14:10 < bridge> And Git commit hash is also deployed in the container image 14:10 < bridge> Okay, then it’s divine intervention 14:11 < bridge> not having the source, we can't trace it as easily 14:11 < bridge> actually, unlikely to be a source issue 14:11 < bridge> but likely deployment 14:11 < bridge> oh i forgot its closed source 14:12 < bridge> can't help a lost cause 14:12 < bridge> (im joking pls no ban) 14:16 < bridge> @Learath2 i ruined my kimetsu episode watch 14:17 < bridge> smh 14:17 < bridge> Because of timescores? 14:17 < bridge> ye 14:17 < bridge> stopped mid ep 14:17 < bridge> and now i have a meeting 14:17 < bridge> xdxd 14:17 < bridge> Oof 14:17 < bridge> i like to watch anime while i eat 14:26 < bridge> @Avolicious and I figured it out, the `client_score_kind` change was merged just after the last KoG release 14:28 < bridge> xD 14:42 < bridge> @heinrich5991 i think the abs should stay imho, we dont have a set standard on how to report the time, so maybe some server says kind: time and sends it negative 14:42 < bridge> the absolute works always 14:43 < bridge> i dont say we shouldnt fix the bug 14:43 < bridge> do u know if the http server info the server sends uses the info from the packer? 14:43 < bridge> `ADD_INT(q, !m_aClients[i].m_Score.has_value() ? -9999 : m_aClients[i].m_Score.value() == 9999 ? -10000 : -m_aClients[i].m_Score.value()); // client score` 14:43 < bridge> this is what we have on the packer 14:43 < bridge> well on the ptr i changed it to use a optional 14:45 < bridge> on the http i changed it to 14:45 < bridge> `m_aClients[i].m_Score.value_or(-9999)` 14:45 < bridge> but maybe i can abs the value there? but we wouldnt be getting to the root of the problem 14:45 < bridge> where the score is set to negative somwhere 14:46 < bridge> I think we should not do the abs in order to establish a standard 14:46 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110186963186765834/image.png 14:46 < bridge> there is this 14:47 < bridge> it does not 14:48 < bridge> we could probably just pass on the option in that code snippet 14:48 < bridge> in this one 14:48 < bridge> ok 14:49 < bridge> @heinrich5991 can i compare a std::optional 14:49 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110187721042964480/image.png 14:49 < bridge> for the expire 14:49 < bridge> can i simply so m_Score != Score 14:49 < bridge> xd 14:49 < bridge> do* 14:50 < bridge> in rust u can 14:50 < bridge> https://en.cppreference.com/w/cpp/utility/optional/operator_cmp 14:50 < bridge> seems so 14:50 < bridge> ok seems like its a sane optional 14:50 < bridge> the only thing it lacks is map 14:51 < bridge> `transform` 14:51 < bridge> C++23 though 14:51 < bridge> C++ finally catching up on basic functionality 14:52 < bridge> 😂😂 14:52 < bridge> Let's skip cpp20 14:53 < bridge> @heinrich5991 do u wanna break the compat then 14:54 < bridge> and allow 9999 time 14:54 < bridge> - we fix the bug 14:54 < bridge> - negative numbers mean no time 14:54 < bridge> - 0 and 9999 are valid times 14:55 < bridge> u know 14:55 < bridge> actuall 14:55 < bridge> ywe should drop score altogether for ddnet 14:55 < bridge> and show a proper time 14:55 < bridge> with more resolution even 14:56 < bridge> so instead of seconds 14:56 < bridge> we send miliseconds 14:59 < bridge> I'd rather not, probably 14:59 < bridge> we can already do this for the serverbrowser, just not ingame, I think 15:00 < bridge> ill just leave this comment 15:00 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110190433151238175/image.png 15:00 < bridge> in the in game time reporting 15:01 < bridge> this code is like this already btw 15:01 < bridge> im trying to find where its negative xd 15:02 < bridge> the `absolute` should probably be removed there 15:02 < bridge> oh 15:02 < bridge> maybe its set to negative if someone finished a map 15:02 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110191037097455656/image.png 15:02 < bridge> due to this 15:03 < bridge> this is on the onfinish 15:03 < bridge> I'd say: remove all the `absolute`s and think about whether we want negative or positive numbers, probably positive ones 15:03 < bridge> but that abs is on the ingame code 15:03 < bridge> not serverbrowser 15:03 < bridge> but yeah 15:03 < bridge> ill remove it 15:04 < bridge> it's inside the server, right? 15:04 < bridge> (the server is the creator of that value, it knows whether it's positive or negative) 15:04 < bridge> yeah 15:04 < bridge> im gonna remove it all and make sure its positive 15:04 < bridge> i think the source of the negative is the onfinish thing 15:05 < bridge> btw 15:05 < bridge> ah 15:05 < bridge> that makes sense 15:05 < bridge> @heinrich5991 whats better `-1 * m_Score.value()` or `-m_Score.value()` 15:05 < bridge> the latter IMO 15:07 < bridge> @heinrich5991 is it safe 15:07 < bridge> `m_Score = Result.m_Data.m_Info.m_Time;` 15:07 < bridge> where 15:07 < bridge> m_score is option 15:07 < bridge> m_time is option 15:07 < bridge> ? 15:07 < bridge> ```cpp 15:07 < bridge> public: template<> 15:07 < bridge> enable_if_t<__and_v<__not_>, is_constructible, is_assignable, __not_<__converts_from_optional>, __not_<__assigns_from_optional>>, std::optional &> operator=(const optional &__u) noexcept(__and_v, is_nothrow_assignable>) 15:08 < bridge> ``` 15:08 < bridge> i guess yes? xd 15:08 < bridge> oof 15:08 < bridge> let me check 😄 15:08 < bridge> (I'm not actually a C++ wizard) 15:08 < bridge> xD 15:09 < bridge> https://en.cppreference.com/w/cpp/utility/optional/optional 15:09 < bridge> 4 15:09 < bridge> seems like that's the `map` you've been looking for 😄 15:09 < bridge> lmao 15:09 < bridge> although very constrained 15:10 < bridge> > (conditionally explicit) 15:10 < bridge> not sure if I want to find out what that means 15:10 < bridge> well then 15:10 < bridge> ill fix this to be positive 15:10 < bridge> maybe i need to change again the sort on the info 15:10 < bridge> and this may mean partially broken until servers update 15:10 < bridge> and clients 15:10 < bridge> or idk 15:11 < bridge> sounds good 🙂 15:11 < bridge> @heinrich5991 how to make my sv register to a local master 15:11 < bridge> ill need this to test later 15:11 < bridge> `sv_register_url` 15:12 < bridge> set it to `sv_register_url http://127.0.0.1:1234/ddnet/15/register` 15:12 < bridge> and `http_allow_insecure 1` 15:13 < bridge> set it to `sv_register_url http://[::1]:8080/ddnet/15/register` 15:59 < bridge> i forgot 15:59 < bridge> where do i add a master to the client xd 16:00 < bridge> ~/.ddnet/ddnet-master-urls.cfg 16:01 < bridge> i dont have .ddnet 16:01 < bridge> i have .local/share/ddnet 16:01 < bridge> i dont see that file 16:02 < bridge> `ddnet-serverlist-urls.cfg` 16:02 < bridge> probably doesn't exist by default 16:02 < bridge> whats the format? 16:02 < bridge> put an URL into that file 16:02 < bridge> http://[::1]:8080 16:02 < bridge> ? 16:02 < bridge> yes 16:02 < bridge> it chooses the fastest responding server from that list 16:02 < bridge> ah, no 16:03 < bridge> http://[::1]:8080/path/to/servers.json 16:03 < bridge> the httpmaster doesn't serve that file though 16:03 < bridge> so perhaps a `python -m http.server` would work 16:04 < bridge> it needs to be a URL that you could also open in a web browser that serves this file 16:04 < bridge> file:// doesn't work IIRC 16:05 < bridge> ah 16:05 < bridge> 2023-05-22 16:05:23 I http: http://[::]:8080 failed. libcurl error (22): The requested URL returned error: 404 16:05 < bridge> 2023-05-22 16:05:23 E register/6/ipv6: error response from master 16:07 < bridge> hm 16:07 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110207367221620847/image.png 16:07 < bridge> ah gforgot 16:08 < bridge> `http_allow_insecure 1` ^^ 16:08 < bridge> but my server doesnt register 16:08 < bridge> it says the error i sent 16:08 < bridge> hmm 16:08 < bridge> use this value for `sv_register_url` 16:08 < bridge> oh 16:09 < bridge> it needs to be the full url 16:09 < bridge> yes 16:10 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110208103288418336/image.png 16:10 < bridge> yay 16:10 < bridge> it even shows 00 times 16:10 < bridge> nice 🙂 16:10 < bridge> @Jupeyy_Keks have you had a look at io_uring yet btw? ^^ 16:11 < bridge> gotta fix the sorting when unfinished tho 16:12 < bridge> miniserve ftw 16:12 < bridge> https://crates.io/crates/miniserve 16:13 < bridge> isn't it amazing that we have standards like http? ^^ 16:13 < bridge> with thousands of possible impls 16:13 < bridge> xd 16:13 < bridge> ones faster than others 16:13 < bridge> sure, and the python impl probably being very slow 16:13 < bridge> but I like interoperable software ^^ 16:14 < bridge> but idk if the python module is made with many utilities 16:14 < bridge> for the cli 16:14 < bridge> Wrong ping or did u actually mean me? 16:14 < bridge> miniserve has lot of stuff 16:14 < bridge> I actually meant you ^^ 16:14 < bridge> sounded like performance ^^ 16:14 < bridge> What issue did we have? ^^ 16:14 < bridge> you wanted to make the network faster 16:15 < bridge> anyway, I just stumbled upon io_uring once more and wondered whether you had looked at it already 16:15 < bridge> I've written a complete new network impl for the playground but I'm also pretty slow currently lmao 16:15 < bridge> oh, it's even in the arch repos ^^ 16:16 < bridge> But dunno, will iouring help for windows BCS it's not a kernel call or how can I imagine the performance increase here ? 16:16 < bridge> It's Linux apparently 16:17 < bridge> We have perf problems on windows for sure xd 16:18 < bridge> So how much faster is it? 😄 never seen it in action 16:18 < bridge> I think there's something like io_uring on windows as well 16:18 < bridge> it's called IO completion ports IIRC 16:19 < bridge> it skips the syscall, basically 16:19 < bridge> we put our recv request into a ringbuffer, and the kernel reads it from that ringbuffer 16:19 < bridge> I see, so the overhead is in the kernel instead? 16:19 < bridge> Or is it a raw memory address 16:20 < bridge> hmm, it's a raw memory address. not sure I understand your question 16:20 < bridge> instead of doing recv(buffer), we write (op_recv, buffer) into a ringbuffer 16:20 < bridge> I mean a non ringed memory address 16:21 < bridge> yes, I think 16:21 < bridge> Oh ok 16:21 < bridge> And the kernel checks periodically? 16:21 < bridge> yes, basically 16:22 < bridge> Would probably help us indeed 16:30 < bridge> ok i got this sorted 16:30 < bridge> all positivity 16:30 < bridge> no negativity 16:30 < bridge> nice! 16:30 < bridge> and the current servers also look sorted correctly 16:31 < bridge> @heinrich5991 i found that my client lingers before fully closing 16:31 < bridge> its due to this 16:31 < bridge> 2023-05-22 16:31:24 I http: https://master2.ddnet.org/ddnet/15/servers.json failed. libcurl error (28): SSL connection timeout 16:31 < bridge> 2023-05-22 16:31:24 I serverbrowse_http: found master, url='https://master1.ddnet.org/ddnet/15/servers.json' time=204ms 16:31 < bridge> 2023-05-22 16:31:24 I http: https://master4.ddnet.org/ddnet/15/servers.json failed. libcurl error (6): Could not resolve host: master4.ddnet.org 16:31 < bridge> 2023-05-22 16:31:24 I serverbrowse_http: determined best master, url='https://master1.ddnet.org/ddnet/15/servers.json' time=204ms 16:32 < bridge> it doesnt exist until the task is done 16:32 < bridge> yea, I think that's a currently existing problem 16:33 < bridge> we don't have a good way of aborting jobs currently 16:33 < bridge> I think @Learath2's PR would fix this particular problem 16:33 < bridge> https://github.com/ddnet/ddnet/pull/6646 16:33 < bridge> check it out again if ucan 16:33 < bridge> its rdy 16:33 < bridge> ^tm 16:33 < bridge> i think optional has == for opt == value but i dont know it exactly, it said also it does < with the inner so i didnt use that 16:33 < bridge> and just used a if 16:34 < bridge> somewhere 16:45 < bridge> @heinrich5991 idk if i can get SelectedServer->m_aGameType there 16:45 < bridge> hmm and shouldnt the ClientScoreKind be normalized just once, somewhere?= 16:45 < bridge> I guess that could be done 16:46 < bridge> I don't see why not, at least 16:46 < bridge> hey 16:46 < bridge> Noob here 16:46 < bridge> hi noob im dad 16:47 < bridge> can anyone suggest me any guide for to get this to understand thia 16:47 < bridge> understand what? 16:47 < bridge> i mean 16:48 < bridge> whats is going on here 16:48 < bridge> i see you all make websites 16:49 < bridge> we're building a game: https://ddnet.org/ 16:53 < bridge> im on the edge wondering if this is a troll or a confused person 16:53 < bridge> xd 16:53 < bridge> or a wannabe bot dev 16:53 < bridge> u never know these days 16:53 < bridge> ahhhhhhh 16:53 < bridge> just new here 16:53 < bridge> now i understood the gane ;) 16:54 < bridge> To be precise, the best game 16:54 < bridge> game 16:55 < bridge> i wish i was a dev \:D 16:57 < bridge> become one 16:57 < bridge> the internet is ur door to knowledge 16:57 < bridge> yes thanks for the support 16:58 < bridge> where shall i start ? i only have very little exprience in coding and all this 16:58 < bridge> whats the first thing i should start 16:59 < bridge> first you should learn to google 16:59 < bridge> and ask this very question to google 16:59 < bridge> or ur search engine of preference 16:59 < bridge> rest im sitting here and reading to gain knowledege' 16:59 < bridge> i recommennd reading this 16:59 < bridge> http://www.catb.org/~esr/faqs/hacker-howto.html 16:59 < bridge> thankss nate 16:59 < bridge> but its more aligned to my values 16:59 < bridge> idk about urs 17:00 < bridge> 😂 17:00 < bridge> > To follow the path: 17:00 < bridge> > look to the master, 17:00 < bridge> > follow the master, 17:00 < bridge> > walk with the master, 17:00 < bridge> > see through the master, 17:00 < bridge> > become the master. 17:00 < bridge> Fuck Google ask me 17:01 < bridge> > To be a hacker, you have to develop some of these attitudes. But copping an attitude alone won't make you a hacker, any more than it will make you a champion athlete or a rock star. Becoming a hacker will take intelligence, practice, dedication, and hard work. 17:01 < bridge> > 17:01 < bridge> > Therefore, you have to learn to distrust attitude and respect competence of every kind. Hackers won't let posers waste their time, but they worship competence — especially competence at hacking, but competence at anything is valued. Competence at demanding skills that few can master is especially good, and competence at demanding skills that involve mental acuteness, craft, and concentration is best. 17:01 < bridge> > 17:01 < bridge> > If you revere competence, you'll enjoy developing it in yourself — the hard work and dedication will become a kind of intense play rather than drudgery. That attitude is vital to becoming a hacker. 17:01 < bridge> i love this quote 17:01 < bridge> (hacker not being the word used to refer to crackers) 17:02 < bridge> I love this quote 17:02 < bridge> > Learn everything u need to make your game fast. Nobody can teach u that, and it's never perfect 17:02 < bridge> 17:02 < bridge> It's from me 17:04 < bridge> xd 17:04 < bridge> troll 17:04 < bridge> https://bugzilla.redhat.com/show_bug.cgi?id=2127453 17:05 < bridge> is this same kinda thing ? 17:05 < bridge> ok i think this guy is trolling 17:06 < bridge> and here i spent time to convert someone into a hacker 17:06 < bridge> smh 17:06 < bridge> brother 17:07 < bridge> im not trolling brother 17:07 < bridge> im going throught open source for now to gain knowledge 17:07 < bridge> ```javascript 17:07 < bridge> "Any fool can write code that computers understand. A good programmer writes code that humans can understand" - Martin Fowler 17:07 < bridge> ``` 17:08 < bridge> BTW it was good to Meet you all 17:08 < bridge> last question pleas 17:09 < bridge> light and good os for coding ? 17:09 < bridge> hence im not having a high end laptop 17:09 < bridge> how do they make money fron this ?? 17:10 < bridge> all the wrong questions 17:12 < bridge> if you are aiming to make money, this isn't the best developer channel for you. none of the developers here make money by contributing to the game ddnet 17:12 < bridge> the developers here do it because they like the game and enjoy coding :) 17:13 < bridge> yes i got it its passion .....!!! 17:13 < bridge> will stick to you guys ;) 17:13 < bridge> if you want a light and good os, you can probably use any popular linux distribution. ubuntu is probably the most popular one, though there are plenty others which offer different experiences 17:13 < bridge> atleast i will learn sone thing 17:23 < bridge> @heinrich5991 factored it out 17:23 < bridge> this should even bring more perf 17:23 < bridge> since its not done every time now 17:23 < bridge> or smth idk 17:23 < bridge> probs str_find_nocase is not that expensive xd 17:23 < bridge> (i tested it and works, race server shows time) 17:26 < bridge> `str_find_nocase(pEntry->m_Info.m_aGameType, "race")` 17:26 < bridge> this doesnt match ddrace right? xd 17:26 < bridge> ah well but its no problem cuz ddnet doesnt send unspecified 17:31 < bridge> Linux 🙃 17:32 < bridge> that should match "ddrace" and "ddracenetwork" 17:32 < bridge> yeah, but ddnet sends time kind, not unspecified 17:32 < bridge> so its ok 17:33 < bridge> yup 17:33 < bridge> Windows is going to eat ur resources for it’s shitty services. Ubuntu is right thing for you 17:33 < bridge> ah, now I understand your question 17:33 < bridge> KUbuntu 17:33 < bridge> Ubuntu with gnome sucks for ppl comming from windows 17:33 < bridge> ubuntu is only good because it has a manga 17:33 < bridge> https://mangadex.org/title/a6bfedbc-9846-4a97-9fcb-77a426d978e6/ubunchu 17:34 < bridge> there is a chapter where they fight a pro-windows school user 17:34 < bridge> xdd 17:34 < bridge> 😬 17:34 < bridge> ohh 17:34 < bridge> there is 3 episodes more! 17:34 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110229221088956527/image.png 17:34 < bridge> xD 17:34 < bridge> mint-chan 17:41 < bridge> @Heinf 17:41 < bridge> @heinrich5991 fixed ur comments btw 17:46 < bridge> thanks 17:46 < bridge> does anyone know python stdlib functions taking bools? 17:46 < bridge> what do they do if a non-bool is passed? 17:46 < bridge> error? call `bool()` on it? 17:48 < bridge> preferably a function implemented in C 17:50 < bridge> `os.walk()` gets a `topdown` boolean argument 17:50 < bridge> but it just gets put into an `if`, so it's interpereted as if `bool` was called on it 17:51 < bridge> but it just gets put into an `if`, so it's interpreted as if `bool` was called on it 17:54 < bridge> gpt-4 says: 17:54 < bridge> "Generally, Python's standard library functions are designed to be flexible and work with multiple data types. " 17:54 < bridge> and it names examples such as: 17:54 < bridge> `open` 17:54 < bridge> `json.dump` 17:54 < bridge> i also let it search the internet to verify what it said, take at your own risk 😂 17:55 < bridge> dont even know if they are part of stdlib as u mean it 17:58 < bridge> os.dup2 17:58 < bridge> xd 17:58 < bridge> `open` does indeed take a boolean, but it seems to be implemented in `_pyio.py` 17:58 < bridge> `json.dump` is kinda useless 17:59 < bridge> ah no, it also has boolean arguments 17:59 < bridge> but I bet it's implemented in python as well 18:02 < bridge> it also claims 18:02 < bridge> array sort 18:02 < bridge> 18:02 < bridge> but i doubt the reverse parameter ever reaches c 18:04 < bridge> we reached the milestone 18:04 < bridge> now 17.0 should be ready 18:04 < bridge> which milestone? 18:04 < bridge> big ^tm 18:04 < bridge> ah 18:04 < bridge> https://github.com/ddnet/ddnet/milestone/23 18:04 < bridge> here: ™ :p 18:04 < bridge> compose key ftw 18:05 < bridge> woah 18:05 < bridge> @Robyt3 nice work working with confusing code 18:06 < bridge> :justatest: 18:09 < bridge> i dunno what u mean... 18:09 < bridge> 18:09 < bridge> 18:09 < bridge> Meanwhile DDNet code: 18:09 < bridge> ```c++ 18:09 < bridge> float not_confusing_at_all (float x){ 18:09 < bridge> float xhalf = 0.5f*x; 18:09 < bridge> int i = *(int*)&x; 18:09 < bridge> i = 0x5f3759df - (i>>1); 18:09 < bridge> x = *(float*)&i; 18:09 < bridge> x = x*(1.5f - xhalf*x*x); 18:09 < bridge> return x; 18:09 < bridge> } 18:09 < bridge> ``` 18:09 < bridge> xd 18:09 < bridge> its "The inverse square root implementation in Quake 3" 18:09 < bridge> btw 18:10 < bridge> why does it take reference casts and dereferences 18:10 < bridge> i dunno, maybe it saves one CPU cycle 18:10 < bridge> ``` 18:10 < bridge> int i = *(int*)&x; 18:10 < bridge> int i = (int)x; 18:10 < bridge> ``` 18:10 < bridge> is this not the same 18:10 < bridge> should be a noop right 18:10 < bridge> idk 18:10 < bridge> no it's no nop 18:11 < bridge> well x is float 18:11 < bridge> it's missing the comments https://en.wikipedia.org/wiki/Fast_inverse_square_root#Overview_of_the_code 18:11 < bridge> its a reinterpret to me 18:12 < bridge> yeah, it converts float to int by preserving the bits 18:12 < bridge> the fast inverse square root trick came from treating the 32-bit floating-point word[note 2] as an integer, then subtracting it from a "magic" constant, 0x5F3759DF 18:12 < bridge> ah 18:12 < bridge> the trick is to do the cast as a noop 18:12 < bridge> actually 18:12 < bridge> right? xd 18:12 < bridge> thanks, it actually reaches C 18:14 < bridge> no it's no noop 18:14 < bridge> I mean those two lines are not the same 18:15 < bridge> true true 18:15 < bridge> i missed it 18:16 < bridge> reminds me of implementing tagged unions 18:43 < bridge> Did you figure out how it works? There is a decent video on it if not 18:51 < bridge> ill look at it someday xD 18:56 < bridge> https://youtu.be/NCuf2tjUsAY I think this was the one I watched 19:00 < bridge> how did they find it 19:02 < bridge> chatgpt 19:02 < bridge> ew 19:03 < bridge> soon™️ 19:03 < bridge> Who knows what was going through their minds 19:04 < bridge> It relies on the fact that the ieee754 representation of a float has it's exponent easily accessible and that square root of a multiplication can be split in two 19:05 < bridge> If you mean the magic number only god knows 19:12 < bridge> Oh and the cool property of logs that make exponentiation multiplication 19:23 < bridge> That's not how it works. I try to wait at least a week before release to give bugs a chance to be found 19:24 < bridge> oh yeah, i meant ready as in known bugs fixed 19:24 < bridge> xD 19:24 < bridge> @Voxel https://google.github.io/comprehensive-rust/welcome.html 19:25 < bridge> rust for C/C++ developers 19:25 < bridge> But I'm pretty happy with the RC process. Far fewer point releases since we started doing that 19:25 < bridge> nice 19:25 < bridge> crust 19:32 < bridge> god i want to jump all in and start making something stupid like rewriting the entirety of ddnet in rust because then we could compare the code and remove every and all crashes 19:33 < bridge> rewriting it in rust is probably gonna add more crashes 19:35 < bridge> wait wtf why 19:35 < bridge> isnt rust code built to prevent crashes 19:35 < bridge> because rewriting things introduces bugs 19:36 < bridge> and the current code has been tested in the real world for quite some time 19:36 < bridge> oh 19:37 < bridge> Less SIGSEGV, more Unhandled Error bubbling to main 😛 19:37 < bridge> *panics are easier to debug 19:38 < bridge> but yeah 19:38 < bridge> and rewriting is work 19:38 < bridge> u say this cuz ur new 19:38 < bridge> u dont know what ur saying 19:38 < bridge> no offsense 19:38 < bridge> i wanna do work that isnt boring ! 19:38 < bridge> unhandled error bubbling to main is harder to debug 19:39 < bridge> than an easy segfault 19:39 < bridge> idk 19:39 < bridge> panics have stacktraces too 19:39 < bridge> its 50:50 19:39 < bridge> segevs can be impossible to reproduce and give no debug info 19:39 < bridge> having dealt with this in complex code bases, yes 19:39 < bridge> segsegb can be impossible to reproduce and give no debug info 19:39 < bridge> segsegvs can be impossible to reproduce and give no debug info 19:39 < bridge> you don't know where the damn error comes from 19:40 < bridge> define complex 19:40 < bridge> 10 lines of code 19:40 < bridge> e.g. try to figure out why rustls rejects a certificate 19:40 < bridge> 10 lines of cpp code 19:40 < bridge> . 19:41 < bridge> 1 line of code, bcs no newline was used 19:41 < bridge> 0 lines, because all the code is in json files :troll: 19:44 < bridge> now that i think about it god yea 19:44 < bridge> i dont even know how to properly cpp so 19:44 < bridge> i grew up doing basic coding logic so i pretty much only know loops and how to format functions that dont look ugly 19:45 < bridge> mainly just basic coding logic 19:46 < bridge> coding is just basic coding repeated a lot of times :p 19:46 < bridge> hm, maybe not. maybe sometimes you need to design stuff 19:46 < bridge> but for small things, it works 19:46 < bridge> but like.. pointers and .. 19:49 < bridge> well voxel, rust is easier than cpp in this case 19:49 < bridge> 19:49 < bridge> if u dont aim for performance, but idiomacity, i'd generally say rust is easier 19:49 < bridge> 19:49 < bridge> e.g. if u use lots of Rc or Arc 19:49 < bridge> u can basically create code like in javascript 19:49 < bridge> 19:49 < bridge> in js u often copy objects, in rust u can do this too bcs of Copy macro 19:50 < bridge> hm 19:50 < bridge> yeah i had this plan for how i could use rust to my advantage 19:50 < bridge> exploiting an adobe product :troll: 19:51 < bridge> if i could somehow copy adobe animate frames outside the program i could apply advanced animation tactics without having adobe animate throttle the cpu 19:52 < bridge> because fun fact, adobe animatr limits to only a small percentage of your cpu, meaning its super fucking slow 19:52 < bridge> so if you were to run a javascript file in it, itd take ages and maybe freeze up 19:53 < bridge> so i want to somehow run all of this outside the program in something fast 19:54 < bridge> I can confirm, that is why no one used flash 19:55 < bridge> everyone used flash?! 19:55 < bridge> theres a whole community online who still relies on flash LOL 19:55 < bridge> and im in it 19:56 < bridge> Didn't they kill flash years ago? 19:56 < bridge> no i mean adobe animate 19:56 < bridge> there's tons of material in flash, people are working on preserving it 19:56 < bridge> the program to make flash files 19:58 < bridge> anyways there is nothing that comes close to adobe animate 19:58 < bridge> that is free and doesnt look ugly and is usable 20:07 < bridge> I used flash too, and made a long and cool animated stick fight video with it, but lost the files unfortunately 😦 20:08 < bridge> In the spirit of https://en.wikipedia.org/wiki/Xiao_Xiao, so must have been > 20 years ago 😄 20:08 < bridge> oh damn :((( 21:02 < bridge> ez, robyte makes new UI with tw UI code xd 21:09 < bridge> do u truly understand pointers 21:09 < bridge> they are hard to grasp 21:09 < bridge> one of the most abstract things 21:10 < bridge> flash animation was 21:10 < bridge> the biggest scene 21:11 < bridge> im a fan of krinkels 21:11 < bridge> https://www.newgrounds.com/ 21:11 < bridge> good old times 21:11 < bridge> krinkels made madness combat 21:12 < bridge> i know 21:13 < bridge> https://www.youtube.com/@KrinkelsNG/videos 21:13 < bridge> holy 21:13 < bridge> yutube url sucks 21:14 < bridge> i sent a meme in offtopic that relates to this whole adobe animate ordeal 21:14 < bridge> https://www.youtube.com/watch?v=hkYRmCKMCLo 21:14 < bridge> i was so into this 21:14 < bridge> and another one about a bunny killing 21:15 < bridge> DANGER 21:15 < bridge> you are not casting the value of x into an int, you’re casting a float pointer to an int pointer & dereferencing 21:15 < bridge> getting float data as an integer 21:16 < bridge> ur late to the paty 21:18 < bridge> i wake up 21:18 < bridge> When helping people I've found that the image of literal people pointing at stuff kinda helps 21:19 < bridge> Also talking about addresses as if they are regular home addresses 21:19 < bridge> i kinda know how pointers work? since i needed them for packet decompiling and stuff 21:19 < bridge> with classes and all 21:19 < bridge> you’re word souping 21:22 < bridge> @Voxel u havent struggled right 21:22 < bridge> i think u dont know em 21:22 < bridge> you can grasp the concept of pointers and still be completely in the dark on heap memory & how to manage your pointers 21:23 < bridge> @Voxel i recommend u make a linked list in C 21:23 < bridge> good way to learn 21:24 < bridge> i just copied another code segment in the same file lololol 21:24 < bridge> fabulous idea 21:27 < bridge> I don't remember why they're hard 21:27 < bridge> idk either 21:27 < bridge> if you model your memory as cells for bytes with positions 21:27 < bridge> they seem ez to me 21:27 < bridge> but i struggled 21:27 < bridge> can't you just say that a pointer is an integer saying which of these cells is meant? 21:28 < bridge> @Chairn what do u say 21:28 < bridge> or u havent teached c to completly new ppl 21:28 < bridge> (note that this doesn't represent correctly how pointers work in C, but kinda in x86 assembly) 21:28 < bridge> (but it was still the mental model with which I started, I think) 21:28 < bridge> they work the same in C they just have a type specifier attached for clarity's sake 21:29 < bridge> they can be trivially cast away 21:29 < bridge> no, unfortunately not 21:29 < bridge> pointers dont have a type, but in c they refer to the pointee type 21:29 < bridge> e.g. `float x; int *y = (int *)x;` is UB in C 21:29 < bridge> e.g. `float x; int *y = (int *)x; *y = 0;` is UB in C 21:30 < bridge> I don't understand "pointers don't have a type". in C, they do, no? 21:30 < bridge> they are still just an int 21:31 < bridge> yeye 21:31 < bridge> no, as I demonstrated above 21:31 < bridge> @heinrich5991 i just come from llvm 21:31 < bridge> llvm has opaque pointers 21:31 < bridge> they dont care what they point to 21:31 < bridge> a pointer is only a pointer 21:31 < bridge> I see 21:31 < bridge> ptr 21:31 < bridge> The pointer arithmetic is what is confusing to teach in my experience. It's not exactly intuitive what adding 1 to a traditional address means 21:31 < bridge> llvm used to have ptr with a type 21:31 < bridge> but that was just to satisfy C 21:31 < bridge> well 21:31 < bridge> it was to find errors in clang 21:31 < bridge> but llvm now is more generic 21:32 < bridge> clang is the one who needs to save the pointee type info 21:32 < bridge> this demonstrates pointer-specific operations but it doesn't say a pointer is anything but an integer 😃 21:32 < bridge> without such potentially dangerous operations pointers would be useless in C 21:32 < bridge> A pointer is most definitely not an integer. Atleast as far as the standard is concerned 21:32 < bridge> also not compilers 21:32 < bridge> https://llvm.org/devmtg/2015-10/slides/Blaikie-OpaquePointerTypes.pdf 21:32 < bridge> this 21:33 < bridge> they miscompile your stuff if you treat them like integers 21:33 < bridge> https://llvm.org/docs/OpaquePointers.html 21:33 < bridge> `float x; &x + 3;` is UB 21:33 < bridge> oh yeah for sure 21:33 < bridge> `x + 3` isn't UB for most values of an integer 21:34 < bridge> It guarantees that there is a way to cast OBJECT pointers to an integer and back through an `intptr_t` or `uintptr_t`. But not much else 21:34 < bridge> lots of info here 21:34 < bridge> i dont wanna spam the content xd 21:34 < bridge> > Pointee types provide some value to frontends because the IR verifier uses types to detect straightforward type confusion bugs. However, frontends also have to deal with the complexity of inserting bitcasts everywhere that they might be required. The community consensus is that the costs of pointee types outweight the benefits, and that they should be removed. 21:35 < bridge> that is awesome 21:35 < bridge> in rust its even more difficult 21:35 < bridge> to handle pointers 21:35 < bridge> i thought you couldn't without an unsafe block 21:35 < bridge> outright 21:36 < bridge> u can only deref in a unsafe 21:36 < bridge> you have `&` and `&mut` pointers which work without `unsafe` blocks 21:36 < bridge> but u can deal with em 21:36 < bridge> ah 21:36 < bridge> but there are subtle things 21:36 < bridge> this exists 21:36 < bridge> s 21:36 < bridge> https://doc.rust-lang.org/stable/std/ptr/macro.addr_of.html 21:36 < bridge> how do i live in this world knowing s exists 21:36 < bridge> > Create a const raw pointer to a place, without creating an intermediate reference. 21:36 < bridge> > 21:36 < bridge> > Creating a reference with &/&mut is only allowed if the pointer is properly aligned and points to initialized data. For cases where those requirements do not hold, raw pointers should be used instead. However, &expr as *const _ creates a reference before casting it to a raw pointer, and that reference is subject to the same rules as all other references. This macro can create a raw pointer without creating a reference first. 21:36 < bridge> > 21:36 < bridge> > Note, however, that the expr in addr_of!(expr) is still subject to all the usual rules. In particular, addr_of!(*ptr::null()) is Undefined Behavior because it dereferences a null pointer. 21:37 < bridge> well, time to ask for 40k 🙂 21:37 < bridge> > Create a const raw pointer to a place, without creating an intermediate reference. 21:37 < bridge> > 21:37 < bridge> > Creating a reference with &/&mut is only allowed if the pointer is properly aligned and points to initialized data. For cases where those requirements do not hold, raw pointers should be used instead. However, &expr as *const \_ creates a reference before casting it to a raw pointer, and that reference is subject to the same rules as all other references. This macro can create a raw pointer without creating a reference first. 21:37 < bridge> > 21:37 < bridge> > Note, however, that the expr in addr_of!(expr) is still subject to all the usual rules. In particular, addr_of!(*ptr::null()) is Undefined Behavior because it dereferences a null pointer. 21:37 < bridge> thats old xd 21:37 < bridge> remove space and it works 😉 21:38 < bridge> i did it without it intentionally 21:38 < bridge> He is slowly making his way 21:38 < bridge> you can use \ to not make it work 21:38 < bridge> s\/not//g 21:38 < bridge> s\/not// 21:38 < bridge> s 21:38 < bridge> ot\ 21:38 < bridge> you can use \ to make it not work 21:39 < bridge> is this a pointer or a reference? there is a difference 21:39 < bridge> what's the difference? 21:40 < bridge> they cant be nullable, but same 21:40 < bridge> ye 21:40 < bridge> what's the point of gpu acceleration just to print text to screen? 21:40 < bridge> perf 21:40 < bridge> why does he only answer what i say 21:40 < bridge> what about others 21:40 < bridge> xd 21:40 < bridge> you're having a 1 on 1 convo 😃 21:42 < bridge> hmm, that seems like a c++-specific difference 21:43 < bridge> e.g. function pointers in rust aren't nullable 21:43 < bridge> wuhh why 21:43 < bridge> There are lots of c++ specific small subtleties for ref vs ptr 21:43 < bridge> but then it's kind of moot to ask whether it's a pointer or a reference for other languages 21:44 < bridge> e.g. I don't know what java calls its references 21:44 < bridge> we can't talk about ref vs ptr globally 21:44 < bridge> but they're nullable 21:44 < bridge> i know for a fact C# has a very convoluted reference system 21:44 < bridge> we are not talking about that 21:44 < bridge> I was wondering how to answer this question 21:44 < bridge> well we were talking about rust 21:45 < bridge> well, in rust `&mut`/`&` is called "reference" 21:45 < bridge> i'm sure you can 'dereference' a reference outside of an unsafe block yea? 21:45 < bridge> yes 21:45 < bridge> but a real pointer which could fathomably point to anything, you can't 21:45 < bridge> there 21:45 < bridge> there's one difference 21:45 < bridge> damn, tiles looks like giant compared to 2D 21:46 < bridge> i didn't see that video until now 21:46 < bridge> it's awesome 21:46 < bridge> third person 3d client would be insane 21:47 < bridge> `*mut T` would be called a pointer though, no? There must be a reason they differentiate between the two 21:47 < bridge> well i know that in cpp references vs pointers are more strictly enforced 21:47 < bridge> yea, they're called (raw) pointers in rust 21:47 < bridge> A null ptr can exist in rust, but I don't think a null ref can exist there either 21:47 < bridge> a null object pointer can exist 21:48 < bridge> a null function pointer cannot 21:48 < bridge> there's a more up todate version here https://streamable.com/67bvjs 21:48 < bridge> or borrow 21:48 < bridge> ohhhhhhhhhhhhhh 21:48 < bridge> borrow 21:48 < bridge> i think borrow is more used 21:48 < bridge> huh? never heard that tbh 21:48 < bridge> https://doc.rust-lang.org/reference/types/pointer.html 21:48 < bridge> this poor tee 😭 21:49 < bridge> apparently pointer is used to refer to all these types: raw pointers, references, smart pointers 21:49 < bridge> a little misleading but it works i guess 21:49 < bridge> hmm i guess 21:49 < bridge> why is it misleading? 21:49 < bridge> looks like if first is true, then second is true as well 21:49 < bridge> about the borrow thing 21:50 < bridge> They should make a rust standard so I can become a rust standards lawyer too 21:50 < bridge> we just established that terminology is language-specific 21:50 < bridge> I can nitpick terminology 21:50 < bridge> if anything i'd have chosen the word 'reference' to encapsulate all 3. regardless of what form a pointer takes it's still just a tool for referencing, "references" can be borrow checked (?), smart pointers... yea 21:50 < bridge> so it cannot really be misleading unless you tell me what sets pointers apart from references cross-language 21:51 < bridge> philosophically speaking i think the term pointer is bound to its specific address implementation, where it's just a number that holds the address of a value it's referencing. a reference could be anything else 21:52 < bridge> that's what all three pointer types in rust are 21:52 < bridge> just a number in memory 21:52 < bridge> https://doc.rust-lang.org/reference/types/pointer.html 21:52 < bridge> if there were some theoretical language-specific entity tasked with keeping track of references by any means, with the underlying method being entirely irrelevant/possibly changing across implementations, it would be reasonable to call its objects 'references' 21:53 < bridge> the git does exist and is public though 21:53 < bridge> e.g. references there could be implemented with pointers, but that is not a requirement for it to still be a reference 21:53 < bridge> if you catch my drift 21:53 < bridge> this is all theoretical anyway i can't imagine a very good use case differentiating between the two 21:54 < bridge> yeahh i think they were just like, don't share this with your buddies 21:55 < bridge> damn it, 1040 friends? 21:56 < bridge> i'm more fascinated by robyt being in the kog clan 21:56 < bridge> don't you have to be top 100? 21:56 < bridge> this man gores 21:57 < bridge> oh so he does play 22:00 < bridge> can you reduce the image size a bit? 22:00 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1110296175308980344/image.png 22:00 < bridge> reading the backlog 22:01 < bridge> its dedication 22:01 < bridge> i dont need to do that 22:01 < bridge> since im always here 22:01 < bridge> :justatest: 22:01 < bridge> ChillerDragon doesn't see replies. @Chairn's message was a reply to yours, ChillerDragon 22:04 < bridge> Dijkstra seems fine because you want ALL paths 22:06 < bridge> I ended up doing BFS. Why do you think djikstra would work? Isn't the entire idea of djisktra discarding paths that can't possibly be the shortest? 22:06 < bridge> ah, actually a good idea, we could play the associated animation on the side 😉 22:07 < bridge> this looks fine imo 22:08 < bridge> https://tenor.com/view/f-bi-raid-swat-gif-11500735 22:09 < bridge> bad 22:13 < bridge> also in France 22:16 < bridge> do you speak baguette at least? 22:16 < bridge> no 22:16 < bridge> i speak catalan 22:19 < bridge> you gotta split on `<` and `>` and then split according to what's in between, because there are multiple garbages prepended 22:22 < bridge> ChillerDragon: ^ 22:38 < bridge> meh, didn't got time to review it (and there are some mistakes 😦 ) 22:39 < bridge> gl & hf 😛 22:45 < bridge> because floating point operations are fairly expensive, especially in 1999 22:45 < bridge> it's just an approximation of the inverse square root function, which surprisingly works pretty well 22:46 < bridge> i believe the factor they use is kinda experimental, but someone used Newton's method and shown that it was actually the optimal number 22:47 < bridge> technically, on x86/x87, it's not really a nop because it induces a transfer from the FPU to the CPU 22:47 < bridge> experimental 22:47 < bridge> wtf is x87 22:47 < bridge> Fpu 22:48 < bridge> ah 22:48 < bridge> Well but how. By hand? Xd 22:49 < bridge> technically, pointers are integers 22:50 < bridge> but if you go this path, everything is just a soup of bits and bytes 22:50 < bridge> and you interpret them as you wish 🙂 22:51 < bridge> hmm, this is not UB? it just takes the address of x and adds 3*sizeof(x) ? 22:52 < bridge> you're old !! 22:52 < bridge> sorry, you were the most interesting guy in the last 5 days 🙂 22:52 < bridge> xD 22:53 < bridge> a null ref can exist in c++, your phrasing suggests otherwise 22:54 < bridge> The standard does not allow for a null reference 22:54 < bridge> can u do &nullptr 22:54 < bridge> xd 22:54 < bridge> It'd give you a pointer 22:54 < bridge> true 22:54 < bridge> it only discards at the end if you don't optimize it 22:54 < bridge> to the nullptr 22:54 < bridge> hmm 22:54 < bridge> idk how to make one 22:55 < bridge> (Depends on the context) 22:55 < bridge> but it can be crafted though 22:55 < bridge> soon #6666 also 22:56 < bridge> Not without invoking UB 22:56 < bridge> surely, but it's not impossible to break compiler assumption 22:56 < bridge> C++20: 9.3.3.2p5 ... 22:56 < bridge> > [Note: In particular, a null reference cannot exist in a well-defined program, because the only way to create such a reference would be to bind it to the “object” obtained by indirection through a null pointer, which causes undefined behavior...] 22:58 < bridge> probably possible to create an invalid but non null reference too 23:00 < bridge> Are we talking about the same Djikstra's Algorithm? Doesn't it just devolve into breadth-first search if you remove the comparison with the shortest known route at any step? 23:01 < bridge> i don't know breadth-first search 😦 23:01 < bridge> iirc, Dijkstra discard when it reuses a node 23:02 < bridge> I realize there are a lot of UB in C/C++ that are actually quite well defined at assembly level... 23:12 < bridge> I misread 23:13 < bridge> nothing is even happening here 23:14 < bridge> for some reason i thought you were trying to do like this, assuming x is magically pointing to a valid float value (bare with me) 23:14 < bridge> float *x; *x += 3; 23:14 < bridge> that would be UB 23:16 < bridge> `&x + 3` gets you outside the 1 float you declared, even creating such a pointer is deemed UB 23:17 < bridge> since anything beyond &x + 1 is unknown yea 23:17 < bridge> thing is he would have to do something with &x + 3 for problems to arise 23:17 < bridge> atm it’s just a random expression 23:18 < bridge> C99: 6.5.6p8 even doing that + immediately invokes UB 23:18 < bridge> In practice indeed nothing will happen, but the compiler is allowed to shoot your parents for it 23:18 < bridge> so true 23:19 < bridge> for some reason i thought you were trying to do like this, assuming x is magically pointing to a valid float value (bare with me) 23:19 < bridge> `void *x; *x += 3;` 23:24 < bridge> Now that I think about it you can't do this. Something was bugging me but I couldn't put my hand on it. `nullptr` isn't even an `lvalue` 23:47 < bridge> Funfact: x + 1 is completely fine, even x++ 23:49 < bridge> yea cuz float is 2 bytes 23:49 < bridge> (Dereferencing it is still not ok, but you can hold and use that pointer) 23:49 < bridge> i think x++ would error in cpp 23:49 < bridge> Nope, that +1 takes you `sizeof *x` bytes out. So you are indeed outside 23:50 < bridge> For additions in C, if one operand is a pointer that doesnt point to an array object but another object, it's treated as an array of length 1. Holding/creating a pointer one past an array is allowed 23:51 < bridge> The more completely useless information you know the better 23:53 < bridge> This one is another reason why thinking about pointers as integers can lead you astray. Adding 1 doesn't add 1 to the number you are thinking of 23:53 < bridge> Interesting