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 2020-12-07 00:00:00Z and 2020-12-08 00:00:00Z
Avatar
@Ryozuki same mistake for me for part 2
Avatar
sadSnail my regex aint workin sadSnail
Avatar
@Ryozuki try +?
09:20
matches the least amount of chars
09:21
but at least in the py regex engine, you can only extract the last match of something, so this wouldn't work
Avatar
yeah im doing a different aproach
09:21
i use 2 regexes
09:21
Avatar
also what I did 🙂
Avatar
rust regex is okay with \w in []?
Avatar
why wouldnt it?
09:22
isnt \w a standard
Avatar
idk, let me test python's. I don't know if these \ classes are okay in []
Avatar
i always used em
09:23
and they worked
Avatar
k, seems to work in py as well 🙂
09:23
TIL
09:24
:O
09:24
i knew smth heinrich didnt?
09:24
monkaSteerS
Avatar
this doesn't say anything about \w in []
09:25
i guess u thought it didnt work cuz \w translates to [a-zA-Z0-9_] and it would mean a [] inside a []
09:25
was that it?
Avatar
yes, kinda
09:25
. also loses its special meaning in []
09:25
. usually matches an arbitrary character, but in [] it only matches a dot
Avatar
[quakenet] ChillerDragon BOT 2020-12-07 09:25:59Z
oh did not know that
09:26
so what is [.] then?
Avatar
just matching "."
09:26
one of the ways to escape a dot in regex
Avatar
[quakenet] ChillerDragon BOT 2020-12-07 09:26:33Z
so [.] and [.] is the same
Avatar
huh? did you write the same string twice?
Avatar
[quakenet] ChillerDragon BOT 2020-12-07 09:27:01Z
xd
09:27
did the bridge eat my backslash?
Avatar
yes
Avatar
[quakenet] ChillerDragon BOT 2020-12-07 09:27:21Z
09:27
rude bridge
Avatar
might be discord
09:43
aah
09:49
my program is running for more than 1 minute pepe_straight
09:50
2 minutes more or less
09:50
but i got the answer lmao
Avatar
Does anyone know why my CI is failing?
10:14
I set the minimum CMake version to 2.8.12 already, but it still fails
Avatar
yeah, all fail. I'm waiting for a good idea from @heinrich5991 about how to fix it 😄
10:32
it's also because of gmock
Avatar
sorry 😦
10:39
let me promise to fix it today
10:39
it's been on my todo list the whole weekend
Avatar
using btreemap and btreesets i got it down 0.13s
10:50
aPES4_Steering
Avatar
day7?
10:59
there must be an algorithmic improvement lying around ^^
10:59
yeah i used a mess before
10:59
with hashmaps and recursion
10:59
xdd
Avatar
my python solution runs in 0.04s, and I didn't optimize it for speed, but for speed of writing
Avatar
it literally took 2 mins to get the answer
11:00
ah
11:00
i "time" ed it using cargo run
11:01
which adds a significant delay
Avatar
ah
11:01
you traverse the data structure for each query
Avatar
this does both a and b problem
Avatar
yea, mine also does a and b
Avatar
how long is ur input?=
11:02
it also depends on that
11:02
i guess
Avatar
594 lines
11:02
the problem is that you do a search for each bag
11:02
try with this input
11:02
yeah i guess its not optimized still
Avatar
time python day7.py ryozuki7 229 6683 ________________________________________________________ Executed in 71.08 millis fish external
Avatar
yes
11:03
i win then
11:03
sadSnail
Avatar
I guess? ^^
Avatar
thats a weird time output
Avatar
fish shell
11:04
yours is bash's
11:05
the problem is that you do a search for each bag
11:05
so how can i improve it
Avatar
do it backwards
11:05
see which bag contains a shiny gold bag
11:06
and then check which bags contain those bags, etc.
11:06
so i dont go that deep
11:06
everytime
Avatar
yep
11:07
you'll only have to check exactly as many bags as the output is
Avatar
i guess my second solution is good as it is right now right?
Avatar
yes
Avatar
problem b
Avatar
hm
11:09
it could be better, but I didn't do it better either
11:09
if I may comment furtherly: don't pass &String as parameter, pass &str. it allows for strictly more types to be passed
11:09
same for &Vec<Type>&[Type] (edited)
11:10
(but that doesn't occur in this code)
Avatar
yeah but i didnt want to type lifetimes everywhere
11:10
xd
Avatar
&String has the same amount of lifetime parameters as &str, none
11:10
try it 😉
Avatar
just replace &String with &str and the code should still work. then you can remove .to_owned() from the function call
Avatar
it doesnt complain on the .get
Avatar
no
11:11
Avatar
I don't see what you're trying to show me ^^ explain? 🙂
Avatar
that it works
11:12
xD
Avatar
kk ^^
Avatar
my vim can see errors
11:12
with rust-analyzer
Avatar
fancy
Avatar
see, it complains q is unused there
11:12
Avatar
and now do println!("count {}", count(&bags, &"shiny gold".to_owned()) - 1);println!("count {}", count(&bags, "shiny gold") - 1); for one less allocation 🙂
11:13
&"shiny gold".to_owned()"shiny gold"
Avatar
ye works
Avatar
nice
11:14
all I had to complain about, now I'll be quiet
11:14
if you want to fix the warning, you can replace the identifier by _ or _q
Avatar
ye did it
Avatar
nice that you're doing it in rust ^^
Avatar
fancy neovim POGGIES
11:15
ofc
11:15
i love rust
Avatar
meh demos are broken again
14:53
"Invalid demo"
14:54
for like 8 of them
14:54
using save_replay
Avatar
Am I overthinking day7? 😛
Avatar
probably?
Avatar
yeah figures, kinda wanted to put it all in a graph and do a topological sort
Avatar
oh, that worked 😛
Avatar
maybe u should spred more the nodes
15:20
its a bit messy in the center
15:20
xd
15:20
spread*
15:21
@Learath2 r u using python still?
Avatar
@Ryozuki yeah using networkx
15:27
The second part is a little tricky though, still thinking about it
Avatar
second part was easier for me
15:27
xd
Avatar
I know what I want to do, not really sure how to put it in graph algorithms terms 😛
Avatar
prolog and perl have the same file extension?
15:27
TIL
Avatar
I need a sort of depth first search
15:29
but I need to know where I'm coming from too and the billion functions in networkx don't make it easy to find what I'm looking for 😛
15:29
idk i just used btree map and set and a bit of brain
15:29
pepe_straight
15:29
sadSnail
Avatar
A btree? Huh, that graph is most definitely not binary, I'll take a look at your solution when I'm done, I'm intrigued 😛
15:31
pepeH
Avatar
Hi, I'm currently working on official DDNet package for FreeBSD, and I've noticed that it uses the same dotdir as teeworlds (package of which I also maintain). The question is whether such configuration is safe, e.g. can ddnet modify (and possibly break) teeworlds configs or can teeworlds modify (and possibly break) ddnet configs, taking into account that either teeworlds or ddnet configs format may change in the future. Wouldn't it be safer to use dedicated dotdir for ddnet?
Avatar
I can't believe how rusty I've gotten with algorithms...
Avatar
today problem
Avatar
Pf, I give up. I must be misunderstanding something
Avatar
Heh, on Windows you can use Win+. to enter emojis, kind of works in DDNet
16:30
But with the mouse you can't select the emoji, only with keyboard. @TsFreddie could that be imrpoved?
16:31
and of course our font doesn't support emojis well. Should we add more, and if so, in color? I noticed colored fonts don't work currently
Avatar
probably not tbh
16:31
I mean improve the experience with external program.
Avatar
How about switching to not capturing input? then it works with external program. As is currently done in F1
Avatar
We probably couldn't know when to switch.
16:33
I don't think win+. works like ime either
Avatar
@deen IIRC we backed out of emojis last time
Avatar
yes, because they were totally broken
Avatar
uhm, I think because people abused them
Avatar
but using a proper emoji font would also be better
16:34
Oh well
Avatar
Our font texture is currently a 8bit channel. So basically only alpha iirc
16:35
We will need a separate texture for colored emojis
Avatar
can't find anything on the issue tracker
Avatar
I do want a better selection of emoticons in teeworlds in general. Some of them works similarly like the angry ones (looks like we have four of them) while not having sad / crying ones.
Avatar
Avatar
TsFreddie
We probably couldn't know when to switch.
Also probably will break in exclusive fullscreen mode like ime does.
Avatar
I'm still way overcounting :/
Avatar
https://www.freshports.org/games/DDNet Thanks to @AMDmi3. Not sure if "pkg install DDNet" can also be used.

Checklist

  • [ ] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test if it works standalone, system.c especially
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Te...
Avatar
How am I supposed to clear out a folder in the tw source?
17:41
i wanna delete all files in a folder (or delete whole folder and re-create the empty folder :D)
17:41
how?
17:41
I cant use ListDirectory, as the file is still opened then
Avatar
ListDirectory shouldn't open the individual files in the directory, then you can call RemoveFile on them
Avatar
Does not seem to work
17:58
i will try it once again and make sure i am doing it correct
18:00
18:00
this is correct, is it?
18:00
within the callback of the listdirectory
Avatar
You should check the return value of RemoveFile. pName might be missing the prefix of the directory, and just be the filename
18:02
so you might have to put that together yourself
Avatar
but that should be correct already
18:03
before calling ListDirectory i passed the right path that also worked before when directly calling
18:03
let me try it again
18:04
it found both files, but they are not deleted
Avatar
[quakenet] ChillerDragon BOT 2020-12-07 18:04:56Z
18:04
xd
Avatar
oh @deen
18:05
thanks
18:05
it really cut off my path
18:05
in the front
Avatar
Advent of Code. Contribute to Learath2/aoc development by creating an account on GitHub.
18:15
Absolutely shameful how long this took me :/ Need to brush up on graphs again
Avatar
Though it does print a cute graph if you use the dbg function 😛
Avatar
I was also thinking about solving this with a graph db
Avatar
@deen what assumption allowed you to reduce the problem so much?
Avatar
tomorrow is the day of cmake fixes. I'm going to bed. sorry
Avatar
@Learath2 which problem? AoC? I don't think I reduced anything
Avatar
AoC, I had to use like an entire graph 😛
Avatar
I just got really annoyed by the way types work in Perl, it's horrible
21:43
I have a hashmap too
21:44
but who knows that $m{$a} = ... makes $m a hashmap...
Avatar
You seem to have reduced it to a hashmap somehow
Avatar
I feel like there is no more development on DDNet since AoC 😦
Avatar
tho I guess hashmaps can be interpreted as graphs somehow?
Avatar
Exactly, I just recurse on subroutine (function would be too boring) f
Avatar
I'm really lacking in theory
Avatar
I just store the graph as key = from and value = to in the hashmap
Exported 242 message(s)