Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/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 2022-08-26 00:00:00Z and 2022-08-27 00:00:00Z
Avatar
Demo viewer now has tooltips, in regards of Chairn!
04:41
Current list of Tooltips: Play the current demo Pause the current demo Slow down the demo Speed up the demo Slice the beginning of a cut Slice the beginning of a cut Export cut as a separate demo Toggle keyboard shortcuts
Avatar
whoever made that clamp is not so much of a genius, you could've already perform rounding onto the parameters of the function itself
05:26
and rounding should always take the closest whole number, idk if round_to_int is a custom function or not
Avatar
Comment: Made up "syndrome". Drmies (talk) 20:09, 25 August 2022 (UTC) ISS refers to the impulsive pressing of save-feature key combinations on any platform or system, typically an IDE but has been known to materialize frequently in other situations where the save-feature may not be present. Programmers are known to repeatedly hit the required k...
Avatar
yeah can the editor like, HAVE ctrl+s as save?
05:50
or if it does can it notify me when it DID save?
Avatar
it should, when the screen stops lagging it‘s done 😅
justatest 2
Avatar
I think we should take more advantage of the 1 new mention function in the editor, to communicate a bit more. Like, saying if you saved a map, or something else.
06:12
Like I just found out from this convo that ctrl + s worked.
Avatar
Avatar
deen
it should, when the screen stops lagging it‘s done 😅
Exactly
Avatar
i always wondered- what's else will be added into ddnet next, if anything's planned?
Avatar
I assume people have to make the things that are going to be in the next version idk how much planning you can have
Avatar
I‘m not using the ddnet next release, not sure what it‘s for
Avatar
I can only assume version 17.0, but that is a long ways from happening.
Avatar
lol intended lags
Avatar
Avatar
и чо
.
ну найди просто в сурсах место где встречается inp_mousesens и поменяй третье числовое значение на какое тебе душе угодно, я не думаю, что это тебе сильно поможет, но ладно
Avatar
Avatar
Cellegen
and rounding should always take the closest whole number, idk if round_to_int is a custom function or not
custom, its literally (int)(x + 0.5)
Avatar
Avatar
Cellegen
and rounding should always take the closest whole number, idk if round_to_int is a custom function or not
casting doesn't do any rounding check
09:36
imagine it just like removing the .xx
09:36
so that's why (int)4.9 == 4
09:36
and round_to_int is right
Avatar
Avatar
Jupstar ✪
there is a filter button bottom right (edited)
I can't find it?
Avatar
looks like you play on phone
Avatar
Avatar
Learath2
Also if you sort by ping and players it will still move china below EU if you are in the EU
yeah, that's nice but before I could filter out for example everything over 100 ping, and then sort by number of players to see where I can find people to play with. I can scroll past stuff so it's not a big deal, just it seems weird that there's this downgrade. (edited)
Avatar
It is a compromise we had to make. We traded the convenience of that for more safety against ddos. Malicious hosters were using the fact that clients ping every server to collect ips. Then they used these ips to either ddos servers with spoofing or targetted players in runs specifically
Avatar
Devs bad, they remove stuff
10:13
PepeA
Avatar
We did it just to annoy people because we are the prime evil
Avatar
@GoodGuyGreg old
10:23
10:23
and what's new now (ig it works like that)
10:24
10:24
no IP leakage anymore
10:26
(if anyone ask what I've used, it's excalidraw, pretty cool for that)
10:32
I think server instead sends everything while registering, but idk about that
Avatar
How players get the latency of the servers
Avatar
Avatar
Deleted User
How players get the latency of the servers
you get it only when you've joined it
10:46
afaik it gets cached
Avatar
so it's not the real ping?
10:48
on the server browser
Avatar
Avatar
Deleted User
so it's not the real ping?
it is
10:48
only yuo get that ping if you joined the server
10:49
overwise you get the region (EUR, etc.., can be wrong but people will correct me in case)
Avatar
Yes ok but it's the old cached ping not the current
Avatar
but I'd say it's not a "real time" ping
Avatar
OK thanks
Avatar
maybe this one is more accurate (server sends, master doesnt fetch)
Avatar
Avatar
Deleted User
Yes ok but it's the old cached ping not the current
correct and that‘s the main reason we removed the ping filter. when your favorite server one time had high ping, you never see it again
Avatar
maybe the ping should be in cache temporarily?
Avatar
Suggested by Pulsar yet again, I think this feature could be highly useful for a lot of mappers, so I'm trying to implement a functional history system. I'm planing to make the most of the actions that can be done inside the editor as reversible. This includes:
  • add layer
  • add group
  • rename layer/group
  • change tile (placing, removing)
  • edit quad (color, position, center, rotation)
  • edit layer properties (group, color, position, ...)
  • edit group properties (order, para x/y, ....
Avatar
Avatar
GoodGuyGreg
I can't find it?
u can add it to the internet tab i guess
Avatar
Avatar
Deleted User
maybe the ping should be in cache temporarily?
Yes, I think we need some algorithm here to give an accurate~ish ping at normal times. Maybe expire the outlier pings after a while
12:57
Cache ping on join, ping on leave and maybe a ping from mid session for like 5 sessions per server ip. Then we can discard outlier values every hour until we have a small enough range of values
Avatar
I wouldnt do it on leave, imagine getting kicked out due to ddos and it sets your ping to 999 :D
13:14
would only work if we wait for the pong_ex
13:15
and dont handle timeouts as 999 for that
Avatar
Avatar
fokkonaut
I wouldnt do it on leave, imagine getting kicked out due to ddos and it sets your ping to 999 :D
That's where the outlier pruning comes in, after an hour the outlier ping of 999 would get pruned from the cache
Avatar
ah yea
Avatar
Avatar
fokkonaut
I wouldnt do it on leave, imagine getting kicked out due to ddos and it sets your ping to 999 :D
Erik van Velzen 2022-08-26 13:46:48Z
The system that I'm going to be building would stop DDOS attacks
Avatar
Avatar
Erik van Velzen
The system that I'm going to be building would stop DDOS attacks
How so
14:09
Without even breaking the game compatibility
14:14
Smart, but careful so
14:15
Nice the new mode is to randomly add as friend with a nick, then the bot renames itself and sends you that as "System message"
💀 5
Avatar
yknow i always wondered about the arrangement of the settings bar: why is languages its own tab? i feel like you could place it in the empty spot of General and it'd work
Avatar
Avatar
ReiTW
and round_to_int is right
but again, the whole concept of rounding is to get the closest whole number
Avatar
Avatar
Erik van Velzen
The system that I'm going to be building would stop DDOS attacks
I told you its not as easy as you think. But sure go ahead, please let me know some details
Avatar
Avatar
Erik van Velzen
The system that I'm going to be building would stop DDOS attacks
What, I guess if you make a client for it
Avatar
velzen client (the ddnet client that mines eutherium)
Avatar
Erik van Velzen 2022-08-26 14:26:19Z
@ReiTW yeah sure I'll give you some more details on that right now I need to take care of my children
Avatar
round_to_int was as in round to the integer part of the float
Avatar
uhoh y tho
14:26
for what purpose (edited)
Avatar
Avatar
Cellegen
but again, the whole concept of rounding is to get the closest whole number
That's what round_to_int does
14:27
0.0-0.4 = 0
Avatar
Avatar
ReiTW
That's what round_to_int does
ahm, no what learath said makes sense (edited)
Avatar
Math 4th class
Avatar
0.5-0.9 = 1
Avatar
Avatar
Cellegen
for what purpose (edited)
it's fast, it gets an int, why not? 😄
Avatar
lol ok
14:28
I mean, what is used for doesn't rly matter :p
Avatar
Avatar
ReiTW
That's what round_to_int does
It's not the closest whole number, it's the whole part. round_to_int(2.9f) == (int)2.9f == 2
14:29
Round_to_int would return 3
Avatar
so it takes away the float extension parts
Avatar
Avatar
ReiTW
Round_to_int would return 3
it shouldn't, unless I'm misremembering the code
Avatar
so its floor(2.9f) then
Avatar
It does (int)(f + 0.5f)
14:30
So basically
Avatar
Oh, it is closest int
Avatar
Avatar
Voxel
so its floor(2.9f) then
probs not an actual code term but its a yes math term
14:31
More accurate rounding than simple casy
14:31
Cast
Avatar
Avatar
Voxel
so its floor(2.9f) then
No, because floor(-2.9f) = -3, (int)(-2.9f) = -2
Avatar
Avatar
ReiTW
Round_to_int would return 3
that's what I thought this function works, since normally rounding takes the nearest whole number off of a float: 0.5 and above rounds up to 1, a whole number closest to the float, otherwise (0.499x and below) 0
Avatar
an int cast always rounds towards 0
14:32
Closest whole integer towards 0
14:32
Anyway, I thought round_to_int was just a int cast, but apparently it's not
Avatar
towards 0, oh
14:32
now it makes sense
14:33
basically float2int function
Avatar
Avatar
Cellegen
basically float2int function
No, that's how I thought it worked. Apparently it's not
Avatar
round_to_int apparently rounds to the closest whole integer
Avatar
I meaaaaan return value from float2int and subtract 1 from it
14:34
trollge
Avatar
Doesn't work properly that way 😄
14:35
We add 0.5 to positive numbers, and subtract 0.5 from negative numbers, then we cast to int
Avatar
Avatar
Cellegen
I meaaaaan return value from float2int and subtract 1 from it
Imagine passint 1.0
14:35
Cast to 1
14:35
Then returns 0
14:35
Cuz of ur method
Avatar
i mean, you can have conditions for it
Avatar
It's heavier than the current method
Avatar
yeah, since taking away the float part is as easy as it sounds
Avatar
I love rust, and btw if u fancy doing guis with imgui, egui looks rly close, but actually better
14:43
And smth curious is that modding in ff14 uses imgui.net for guis
14:43
So it got me into a spiral of learning it
14:44
Too sad i have to use c# and not rust to mod it tho
14:45
also doesnt rust have like, ninnou to deal with ui and graphics related stuff?
Avatar
Whats ninnou
Avatar
oh wait. its nannou. i confused the name for a fish
14:46
An open-source creative-coding framework for Rust
Avatar
never heard of it
14:47
ah
14:47
thats for artists
14:47
not gui
14:47
egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native - GitHub - emilk/egui: egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
14:47
im using this
14:47
inspired by imgui
14:48
but well, it has all the goodies rust provides at compile time x)
14:48
demo
Avatar
Avatar
Ryozuki
I love rust, and btw if u fancy doing guis with imgui, egui looks rly close, but actually better
Not like it's the 50th time hearing that u love rust uhoh
Avatar
Avatar
Cellegen
Not like it's the 50th time hearing that u love rust uhoh
well and not the last probs
14:50
I'll try it one day sure
Avatar
im doing some internal tooling for my company with rust and egui
14:50
BASED
Avatar
i tried to try it
Avatar
Avatar
Voxel
i tried to try it
uhoh thonk
Avatar
its not a good starting language
Avatar
it isnt
14:51
cuz it shows all your novice errors
14:51
but not novice as in syntax, but as in things you have to consider when coding
Avatar
yea thats what i mean
Avatar
well "it isnt" isnt true
14:52
if you go and learn programming the hard way with rust
14:52
imho you end up in good shape
Avatar
im terrible at code optimization, even for DDNet xd
Avatar
but to appreciate rust you need to know the pains of c and c++
14:52
and for that you need to go past hello worlds
Avatar
🐦 Friendly little instrumentation profiler for Rust 🦀 - GitHub - EmbarkStudios/puffin: 🐦 Friendly little instrumentation profiler for Rust 🦀
15:03
good stuff
Avatar
@Ryozuki Imgui is damn so cool to use
15:11
i'll definetly look at the rust one
Avatar
you can use imgui on rust too but egui is cooler
15:13
and not a ffi binding
Avatar
You know what? Starting out with rust might not be the worst idea. I bet the borrow checker might be easier to get used to for a complete beginner than a veteran
Avatar
If you know what you are doing is safe but you just havent figured out the correct lifetimes to let the compiler know you just get angry. A beginner will never think they know better than the compiler 😄
15:15
and even ppl that know what they are doing do things wrong sometimes
15:16
but ultimately
15:16
its hard
15:17
because new ppl dont learn pointers until late
15:17
and in rust ur kinda forced
15:17
(to use references )
Avatar
depending on where you learn tho
15:17
sometimes pointers are the 1st advanced thing you learn
Avatar
most ppl will encounter their first fight with the borrow checker by doing simple for loop with a iterator
Avatar
Avatar
Ryozuki
most ppl will encounter their first fight with the borrow checker by doing simple for loop with a iterator
damn
15:18
lmao
Avatar
them being oblivious of what a iterator is
Avatar
actually true (happened to me)
Avatar
Avatar
Ryozuki
because new ppl dont learn pointers until late
Well my suggestion for a beginner language is and always will be C if you want to actually learn programming. Rust is a close second. So the pointer thing is not an issue atleast in my brain
Avatar
for me C isn't a hard language, but people's code makes it harder to work on
15:19
also it's a very small language to learn
Avatar
The low level stuff I think you just have to learn if you want to be a good programmer. You can use the standard library later
Avatar
@ReiTW
15:19
ofc if you read u understand
15:20
but new ppl dont tend to read compiler errors
15:20
thee is probs a example that makes more sense
15:20
but i wanted to make up smth fast xd
Avatar
Avatar
Learath2
Well my suggestion for a beginner language is and always will be C if you want to actually learn programming. Rust is a close second. So the pointer thing is not an issue atleast in my brain
yeah c is a good first language
15:21
i agree wholeheartedly
Avatar
I started with C
Avatar
it makes you appreciate rust more
15:21
so its a good thing
Avatar
thanks to Neox who gave me motivation xD (Neox is the NX|City creator & Monster too) (edited)
Avatar
Avatar
Ryozuki
@ReiTW
This error message is worse than I'm used to for the rust compiler actually. I wonder why there is no special case for it
Avatar
i also think that before i learnt C ididnt rly know shit
Avatar
Mutating the container you are iterating over accidentally is common enough to warrant a special message rather than a isn't 'Copy'
Avatar
its cuz you are kinda doing 2 things
Avatar
Avatar
Learath2
The low level stuff I think you just have to learn if you want to be a good programmer. You can use the standard library later
yes, remove the std lib which is something "added" to the language and it's a very small language to learn
Avatar
since i dont do for x in &a but for x in a
Avatar
using std after is ez af
Avatar
i moving a
15:23
if you do the help it says
Avatar
+ you never learn std
15:23
you can simply search functions etc.. online
Avatar
for x in &mut a?
15:24
.into_iter() would work sure but it does the same right?
15:25
u cannot mutate while iterating
Avatar
Avatar
ReiTW
+ you never learn std
I actually had an argument with my OS prof over this. He asked the signature of a specific linux function, execvpe or sth
Avatar
Who even programs like this. Do you know the signature of execvpe off the top of your head?
15:25
I've done a C exam on paper
15:25
it's worse than yours
15:26
if i had to do that
15:26
i would simply refuse
15:26
get up
15:26
and leave
15:26
not worht my time
Avatar
Avatar
ReiTW
I've done a C exam on paper
I did aswell. An Algorithms exam. I wrote a 5 page program
Avatar
everyone in class didn't understand a shit
15:26
the teacher also did a shit code
Avatar
i had a teacher with a "c++ background" teaching java nitpick over the usage of while vs for and continue; etc
15:28
you rly have to hold back to not argue when u are way more advanced than the class you are taking
15:28
cuz u gotta hold ur laughter
Avatar
The java teacher we had got in a 15 minute argument with me over using an array instead of an ArrayList
Avatar
@Learath2 this is one code from my teacher
15:28
#include <stdio.h> void read_line(char *arr, int size) { char *p = arr; char c; while ((p - arr) < size && (c = getchar()) != '\n' && c != EOF) *p++ = c; *p = 0x0; } int main(void) { char buf[10] = { 0x0 }; read_line(buf, sizeof(buf)); printf("%s\n", buf); } (edited)
Avatar
petty teachers nitpicking over petty stuff
Avatar
guess the problem
15:29
told him 100 times, he was like "you're wrong, u have to pay me a pizza lol"
15:29
he does ugly shit code
Avatar
At the end I told him I really didn't care whether he thinks the array is less performant or not, just to give me my points because it is correct code whether he likes it or not
Avatar
imho taking java as ur first lang is p bad
15:30
cuz u go pretyt fast into classes
15:30
and polymorphy
15:30
being oblivious of what pointers and references are
15:30
u rly dont know what u are doing
15:30
they rly like their animals and dogs and cats
15:31
smh
Avatar
Avatar
ReiTW
#include <stdio.h> void read_line(char *arr, int size) { char *p = arr; char c; while ((p - arr) < size && (c = getchar()) != '\n' && c != EOF) *p++ = c; *p = 0x0; } int main(void) { char buf[10] = { 0x0 }; read_line(buf, sizeof(buf)); printf("%s\n", buf); } (edited)
You mean the fact that he'll null terminate outside the bounds of the buffer?
Avatar
Avatar
Learath2
You mean the fact that he'll null terminate outside the bounds of the buffer?
exactly
15:31
even if that's nothing really special, that's bad code
Avatar
Yeah, can spot it even on a phone
15:32
and I even used addr sanitizer
15:32
to show him; he was like "tf is that, it shows nothing"
Avatar
Most professors teaching C don't seem to be interested in the language at all. They learn some and think they are good to teach it
15:34
he was good I'd say
Avatar
i think most teachers mostly havent worked on real code outside of academics at all
Avatar
He did a lot of things in the past
Avatar
The C guy we had was actually a Java guy
Avatar
I think he did a thesis in computer science
15:34
low level stuff
Avatar
real coders are those with a anime pfp having a furry website and doing crazy stuff
15:35
always matches the profile
15:35
kekw
Avatar
at least he had very good knowledge about Systems
15:36
the example
Avatar
Except for my computer architecture prof and the algorithms prof the rest of the computer profs have been very meh at my uni
Avatar
everything that we learned in Systems
15:36
are actually written here : https://tldp.org/LDP/tlk/tlk-toc.html
15:37
and he knows well his subject, pretty cool
Avatar
Way too arrogant for their knowledge level. Knowing theory really well doesn't qualify you to language lawyer in C
Avatar
all teachers are arrogant
Avatar
Avatar
Erik van Velzen
@ReiTW yeah sure I'll give you some more details on that right now I need to take care of my children
Erik van Velzen 2022-08-26 15:38:03Z
Basically I have a system that asking a small fee when interacting with server
Avatar
some have the right to be but most dont
Avatar
Avatar
Erik van Velzen
Basically I have a system that asking a small fee when interacting with server
Erik van Velzen 2022-08-26 15:38:36Z
Any attack would cost the attacker money
Avatar
im tired of this stupid crypto project
Avatar
Like I'll defer to you when we need someone to calculate the time complexity of an algorithm, but don't try to tell me signed integer overflow is not UB in C
Avatar
cant u just go another place to discuss this
15:40
i need to write my own blog post about atomics when using rust, i always keep coming back to https://doc.rust-lang.org/nomicon/atomics.html
The Dark Arts of Advanced and Unsafe Rust Programming
Avatar
Avatar
Ryozuki
cant u just go another place to discuss this
Erik van Velzen 2022-08-26 15:42:25Z
This is the developer room Please be kind to one another I'm still looking for the developer who can help me with this project
Avatar
yeah and you are not a dev
Avatar
Erik van Velzen 2022-08-26 15:43:14Z
I got $2,000 to spend
Avatar
jsut a bullshitter preaching shit
15:43
this is not a job offer channel
15:43
and you are certainly not contributing back to ddnet in any way
15:43
actually just bothering ppl
Avatar
Avatar
Ryozuki
actually just bothering ppl
Erik van Velzen 2022-08-26 15:45:21Z
No I'm not I'm rarely speaking Follow the rules be kind
15:47
1. Be nice and respectful. No aggressivity, toxicity, putting down others or their work. 2. Speak English. So everyone can understand. 3. Be relevant. This is about Teeworlds. 4. Don't advertise except if it is relevant to the discussion. Punishments start with a kick and can lead to a temporary ban. If the offense is severe, there will be a permanent ban.
15:47
i dont know about you but this is the ddnet discord
15:47
not teeworlds
15:47
and im certainly most ppl dont wanna hear ur shit
Avatar
Avatar
Learath2
You mean the fact that he'll null terminate outside the bounds of the buffer?
it also use wrong type for char c; should be int to detect EOF
Avatar
Avatar
Learath2
Except for my computer architecture prof and the algorithms prof the rest of the computer profs have been very meh at my uni
computer architecture profs are the best (soon i'll be one 😄 )
Avatar
Avatar
Ryozuki
jsut a bullshitter preaching shit
Erik van Velzen 2022-08-26 15:51:23Z
If those rules don't apply here then basically I can say whatever I want and stay here when I want But internally I believe in respect
15:52
@Learath2 someone send a big msg that got deleted
15:52
and triggered the bot
15:52
lol
Avatar
deen is dev botting, report
Avatar
probs this guy here our cryptobro
Avatar
Avatar
Ryozuki
jsut a bullshitter preaching shit
Rude D:
Avatar
truth hurts
Avatar
Idc but rude D:
Avatar
well he is either trying to scam ppl, or just too ignorant
Avatar
He is just offering a job, if you are not interested maybe just block him?
Avatar
He doesn't spam nor does he talk unprompted. He made a claim @ReiTW asked for justification
Avatar
Avatar
Chairn
it also use wrong type for char c; should be int to detect EOF
what's even the representation of a char with -1
Avatar
blocked then
Avatar
isnt that U+FFFD
15:57
doubt (edited)
15:57
it's a single byte?
Avatar
Specials is a short Unicode block of characters allocated at the very end of the Basic Multilingual Plane, at U+FFF0–FFFF. Of these 16 code points, five have been assigned since Unicode 3.0: U+FFF9 INTERLINEAR ANNOTATION ANCHOR, marks start of annotated text U+FFFA INTERLINEAR ANNOTATION SEPARATOR, marks start of annotating character(s) U+FFF...
Avatar
ah I see
15:58
funny
Avatar
Avatar
Chairn
it also use wrong type for char c; should be int to detect EOF
Heh, that too, missed it on account of the overflow being more obvious 😄
Avatar
There was a really cool talk I linked here by an Adobe engineer I can't seem to find anymore
16:09
Discords search is so shit :/
Avatar
sometimes it works
16:11
sometimes not
Avatar
Avatar
ReiTW
#include <stdio.h> void read_line(char *arr, int size) { char *p = arr; char c; while ((p - arr) < size && (c = getchar()) != '\n' && c != EOF) *p++ = c; *p = 0x0; } int main(void) { char buf[10] = { 0x0 }; read_line(buf, sizeof(buf)); printf("%s\n", buf); } (edited)
I think C programmers back in the day thought the more stuff you can fit in the condition of your loop, the better. Even k&r is full of that stuff (although they don't have UB there lmao)
Avatar
"talk" mathes "talker", "talking", "talks", "talky". "youtube" doesn't match youtube links
Avatar
I don't really understand the concept of UB tho
Avatar
Actually unreadable code
Avatar
@Cipy29 yes
16:12
imagine that
Avatar
I swear ElasticSearch and knn indexes are the worst idea computer science people ever came up with
Avatar
Stuff the language doesn't define is UB
Avatar
in a class of people who never did programming before
16:12
they can't understand a shit
Avatar
Like going past your allocated memory
Avatar
i am a developer😎😎😎
Avatar
Yes it allows you to search through billions of things. But what use is it if you cant find the things you want
Avatar
@worstwish
16:12
ok ban
Avatar
@Learath2 kiss me
Avatar
Damn my best developper @worstwish u're dead online or wut
❤️ 1
Avatar
Avatar
ReiTW
Damn my best developper @worstwish u're dead online or wut
ily bro
Avatar
Avatar
Cipy29
Stuff the language doesn't define is UB
Also stuff the language explicitly says is UB
16:14
If the standard doesnt say anything about it, or if it says it's UB it's UB 😄
Avatar
Using C at all? Believe it or not, UB
Avatar
What do you think a pointer is
16:15
Can it be a value
Avatar
Avatar
ReiTW
Damn my best developper @worstwish u're dead online or wut
cammostripes
issou 1
Avatar
Avatar
ReiTW
What do you think a pointer is
A pointer is an object that points to another
Avatar
cuz someone asked it on Rust discord and they answered : pointers are values, that might be in a variable
16:18
but for me a pointer is a variable or an object storing an address
Avatar
Well a pointer is an object which does have a value
Avatar
so a pointer can't be the value itself
Avatar
Avatar
Meekrioz
@Learath2 this one? https://youtu.be/ncHmEUmJZf4
No, it wasnt a cppcon talk. He was talking about CoW and documents
Avatar
Avatar
ReiTW
so a pointer can't be the value itself
Well colloquially we use it mostly interchangably, we refer to both the pointer object and it's value as "a pointer"
Avatar
@Ryozuki for you
Avatar
But in the standard when you see "pointer" it'll refer to a pointer object
Avatar
as an example for the pointer, they gave me that example : &1 as *const i32 (edited)
Avatar
Avatar
ReiTW
I don't really understand the concept of UB tho
Compiler makes assumptions to optimize code, u break those, unpredictable things happen
Avatar
In Rust idk. Idk the low level stuff about rust
Avatar
Avatar
Ryozuki
Compiler makes assumptions to optimize code, u break those, unpredictable things happen
yeah I see
Avatar
Avatar
Learath2
In Rust idk. Idk the low level stuff about rust
Ah im on mobile but there is stuff
Avatar
Avatar
Ryozuki
Compiler makes assumptions to optimize code, u break those, unpredictable things happen
My favourite one is null pointer optimization. If you dereference something without checking it'll assume it's non-null
Avatar
Rustonomicon is a good place go learn low leven things about rust
Avatar
Ah yes, keskonsamuz
Avatar
Avatar
ReiTW
as an example for the pointer, they gave me that example : &1 as *const i32 (edited)
@Ryozuki so for you this is a pointer or just a returned address that you can store in a variable
Avatar
@Ryozuki
Avatar
Avatar
Learath2
My favourite one is null pointer optimization. If you dereference something without checking it'll assume it's non-null
So int foo(int *p) { *p = 0; if(p) { bingo(); } will become *p = 0; bingo(); }
Avatar
Avatar
ReiTW
@Ryozuki so for you this is a pointer or just a returned address that you can store in a variable
A pointer
16:25
Its safe to have a variable that js a pointer btw, whats unsafe is to dereference it (edited)
Avatar
Even in C, when talking about normal stuff you'll say that's a pointer. Making a distinction between objects and their values is a very very languagelawyer thing
Avatar
yeah well
16:26
I'll still keep the original definition that's in the book by ritchie
16:26
it's the easiest to understand tho
Avatar
I think k&r only ever mentions the distinction 1 or 2 times
16:27
This book has lots of goodies
16:27
I always recommend ot
16:27
It
Avatar
It's when you start to read the standard where it becomes an issue. Because there are rules that apply to values and there are rules that apply to objects
Avatar
Avatar
Learath2
So int foo(int *p) { *p = 0; if(p) { bingo(); } will become *p = 0; bingo(); }
If it's UB with the 'if' it's also UB without so might as well double down lol
16:28
And this one of the most important things
Avatar
Avatar
Cipy29
If it's UB with the 'if' it's also UB without so might as well double down lol
The compiler says: Huh he dereferenced it, if it was null this would be UB, but that's insane, who would use UB lol, so p is non-null
Avatar
@Learath2 i found these two
16:29
but i dunno
Avatar
Avatar
Meekrioz
@Learath2 i found these two
What did you search for? Just "has: link"?
Avatar
Oh that guy is a genius btw
Avatar
I'll dig into all the links I posted later I guess, its not those 2 either, thanks for looking
Avatar
those are the youtube videos you posted without "talk" in the message
Avatar
Avatar
Ryozuki
Oh that guy is a genius btw
Yeah, mind boggling stuff he found
Avatar
wait there was one more
Avatar
@Learath2 what was the subject
16:31
the topic
Avatar
Avatar
ReiTW
@Learath2 what was the subject
CoW, smart pointers, something about hierarchical documents
Avatar
I like rust cows
16:32
monkalaugh
Avatar
No cows in C++ unless you make your own, which is turbosad
Avatar
Cow<'static, str>
16:32
Rly useful
Avatar
twinbop sux
Avatar
A lot of people at RustFest Paris mentioned Cows– which may be surprising if you’ve never seen std::borrow::Cow!
Avatar
Avatar
Ryozuki
Rly useful
Cows are even more useful with massive objects that are rarely modified
Avatar
i googled "CoW" to see what it is and i got greeted by this:
monkalaugh 1
16:33
wasn't helping PU_pepeFlowerSad
Avatar
Avatar
Meekrioz
i googled "CoW" to see what it is and i got greeted by this:
Copy on write 😄
Avatar
yea i figured OMEGADANCE
Avatar
use std::borrow::Cow; fn describe(error: &Error) -> Cow<'static, str> { match *error { Error::NotFound => "Error: Not found".into(), Error::Custom(e) => format!("Error: {}", e).into(), } }
Avatar
I miss coding AnyaSob
Avatar
All I do is math math math math math math math math math math
16:34
My brain is about to leak out of my ears
16:35
I left uni cuz maths but u shouldnt leave xd
Avatar
you think it was a youtube video learath
16:35
I’m sure it was an Adobe guy too
16:35
He talked about how they handled undo/redo using cow snapshots in photoshop
Avatar
Avatar
Ryozuki
use std::borrow::Cow; fn describe(error: &Error) -> Cow<'static, str> { match *error { Error::NotFound => "Error: Not found".into(), Error::Custom(e) => format!("Error: {}", e).into(), } }
The most important thing is that since Cow<'static, str> derefs2 to &str it may act as a drop-in replacement everywhere, where &str is expected. So, if last error variant was added to an already existing code base, all would just work without any major refactoring. In other languages like C++ you’d probably have to decide, [either] to return allocating version like std::string everywhere or get rid of the details and suffer from poor ergonomics, where you’d need to use such [a] method. Even worse, error entry with extra details may be very rare and yet, you’d need to make everything allocate just to stick it all in. Rust provides a solution that is zero cost for cases where extra details are not needed. It’s a brilliant example of “pay only for what you use” principle in action.
16:36
Kek
Avatar
this has to be the one
Avatar
Meek detective
🕵️ 1
Avatar
Avatar
Learath2
He talked about how they handled undo/redo using cow snapshots in photoshop
I saw that one great great video learned a ton of stuff
Avatar
Meek is a link stalker
Avatar
Ill watch it later
Avatar
i love searching up stuff and finding it
16:38
i dont think there is a job for it
16:38
that im qualified for
Avatar
@Learath2 by Free CI did you mean CircleCI?
Avatar
This is an excellent talk for anyone interested in how you can have nice free polymorphism
Avatar
Avatar
ReiTW
@Learath2 by Free CI did you mean CircleCI?
Github actions is free. We get macOS, Windows, Linux all for free
Avatar
yea but I tried to read your configs
16:39
this is hell
16:39
DDraceNetwork, a free cooperative platformer game. Contribute to ddnet/ddnet development by creating an account on GitHub.
Avatar
Before that we had go use like 3 providers for free CI. Travis for macOS, Circle for Linux and some thing with poop colored ui for Windows
Avatar
rn I'm using gitlab ci/cd feature & watchtower on docker to automatically pull the docker image if the hash is different & restart the container (edited)
Avatar
Avatar
Meekrioz
i dont think there is a job for it
Hm, maybe some government job exists for it?
Avatar
Avatar
ReiTW
rn I'm using gitlab ci/cd feature & watchtower on docker to automatically pull the docker image if the hash is different & restart the container (edited)
But do you host the docker container?
16:41
only not the image
Avatar
Yeah, on github they host the workers for free
16:41
I mean
16:41
you mean the workers
16:41
I'm using the shared runners
Avatar
Avatar
ReiTW
I'm using the shared runners
Gitlab provides them? Do they have macOS too?
Avatar
Avatar
Learath2
Hm, maybe some government job exists for it?
as i said, i don't think i'm qualified for it OMEGADANCE
Avatar
Avatar
Learath2
Hm, maybe some government job exists for it?
Tips from the NSA poggers
Avatar
True learath works for the nsa
16:42
aPES2_Insane
Avatar
Avatar
Meekrioz
as i said, i don't think i'm qualified for it OMEGADANCE
Why not? I’m sure some on the job training exists for stuff like this. Like some kind of archive office maybe?
16:42
you have personal runners that you can register, or shared runners yes, but you have a limit per month, good luck to reach it
Avatar
Avatar
Learath2
Why not? I’m sure some on the job training exists for stuff like this. Like some kind of archive office maybe?
meh government jobs are usually for students with background knowledge so they don't have to train them for too long.
Avatar
Avatar
ReiTW
Click to see attachment 🖼️
We get 2000 minutes free on github. I wonder how much of it we end up using
16:44
We get PRs too, those would add to the time used
Avatar
ig you can find statistics somewhere
Avatar
We also run our builds on CI and we build both debug and release
Avatar
Avatar
Learath2
We get 2000 minutes free on github. I wonder how much of it we end up using
Oh wait, that’s only for private repos. We get infinite free time for public repos 😄
16:47
That is hard to beat
16:49
that's cool
Avatar
Anyway, idk how much we use
16:49
I wonder if it’s more than 400 minutes
Avatar
Avatar
Ryozuki
real coders are those with a anime pfp having a furry website and doing crazy stuff
ryozuki no rust academia
Avatar
wot xd
Avatar
ur anime title
Avatar
They should teach the stacked borrows on academia
16:54
Well i mean, it came from academia
16:55
The paper
Avatar
where do u even always find all the links, are u like copy pasting the rust discord here? XD
16:58
Years of research
16:58
I just remember em xd
Avatar
When I have some time I really need to work with something like logseq to organize my knowledge
Avatar
Ye its nice
Avatar
Like that polymorphism talk. I really needed it but the only things I remembered about it was that it was am adobe guy and it had sth about cows in it
16:59
2 tags I could easily search for in a kniwledge cloud
16:59
s/kniwledge/knowledge/
Avatar
If u dont typo them that is
Avatar
Well I’m sure logseq can do some fuzzy searching
Avatar
mhh
17:10
/s/mhh/test2/
17:10
didnt that work in discord a while ago
Avatar
Don’t put a / before or at the end
Avatar
mhh (edited)
17:11
ah
17:11
nice
Avatar
Before is useless, after is a silly mistake by discord, they didn’t implement it properly
Avatar
just wanted to see if thats a message that gets send to the server, but doesnt pop up in irc, so i guess its a client side command ^^
Avatar
Yeah it’s client side from what I gather
Avatar
@Discord Mod
17:15
HUHH
Avatar
THATS SO ANNOYING
Avatar
that's what u get for not having bot protection
17:38
greenthing
Avatar
Is there not a way to run the build checks in ddnet github by yourself?
Avatar
after u contributed once it does
Avatar
Avatar
Ryozuki
most ppl will encounter their first fight with the borrow checker by doing simple for loop with a iterator
SO TRUE AHAHAHA
Avatar
Avatar
ReiTW
for me C isn't a hard language, but people's code makes it harder to work on
people try to use c as another language, its just "work with ur data nobo"
Avatar
Avatar
Voxel
Is there not a way to run the build checks in ddnet github by yourself?
if you have a fork they should run ok your fork too
Avatar
Avatar
Chairn
computer architecture profs are the best (soon i'll be one 😄 )
congratulations justatest
Avatar
Ohh... That makes sense.
Avatar
i think if ill search for learaths, heinrichs and ryozukis messages in this chat ill end up as master degree student in cs kek
Avatar
anyways i think im done with my PR, besides some high level optimization which i have no idea how to handle
Avatar
c7ddb0a Pad player demo filename with zeros instead of spaces - Robyt3 8d3351f Also record tunings for player demos - Robyt3 5c2f162 Remove unused DemoRecorder_IsRecording method - Robyt3 3f1b702 Fix demos recorded without mapdata not being loadable - Robyt3 63d0c8e Improve error message when map for demo cannot be found - Robyt3 d369a5b Write messages to all active demo recorders - Robyt3 6bd1e96 Add demo recorder/player to integration test - Robyt3 67267dd Merge #5773 - bors[bot]
Exported 518 message(s)