06:19 <+bridge> [ddnet] @Ryozuki same mistake for me for part 2 09:46 <+bridge> [ddnet] my regex aint workin 09:46 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/785426878415765534/unknown.png 10:20 <+bridge> [ddnet] @Ryozuki try +? 10:20 <+bridge> [ddnet] matches the least amount of chars 10:21 <+bridge> [ddnet] but at least in the py regex engine, you can only extract the last match of something, so this wouldn't work 10:21 <+bridge> [ddnet] yeah im doing a different aproach 10:21 <+bridge> [ddnet] i use 2 regexes 10:21 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/785435904995098654/unknown.png 10:22 <+bridge> [ddnet] also what I did πŸ™‚ 10:22 <+bridge> [ddnet] :POGGIES: 10:22 <+bridge> [ddnet] rust regex is okay with \w in []? 10:22 <+bridge> [ddnet] why wouldnt it? 10:22 <+bridge> [ddnet] isnt \\w a standard 10:23 <+bridge> [ddnet] idk, let me test python's. I don't know if these \ classes are okay in [] 10:23 <+bridge> [ddnet] i always used em 10:23 <+bridge> [ddnet] and they worked 10:23 <+bridge> [ddnet] k, seems to work in py as well πŸ™‚ 10:23 <+bridge> [ddnet] TIL 10:23 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/785436389310332928/unknown.png 10:24 <+bridge> [ddnet] :O 10:24 <+bridge> [ddnet] i knew smth heinrich didnt? 10:24 <+bridge> [ddnet] 10:24 <+bridge> [ddnet] :POG: 10:24 <+bridge> [ddnet] this doesn't say anything about \w in [] 10:24 <+bridge> [ddnet] true 10:25 <+bridge> [ddnet] i guess u thought it didnt work cuz \w translates to `[a-zA-Z0-9_]` and it would mean a [] inside a [] 10:25 <+bridge> [ddnet] was that it? 10:25 <+bridge> [ddnet] yes, kinda 10:25 <+bridge> [ddnet] . also loses its special meaning in [] 10:25 <+bridge> [ddnet] . usually matches an arbitrary character, but in [] it only matches a dot 10:25 <+ChillerDragon> oh did not know that 10:26 <+ChillerDragon> so what is [\.] then? 10:26 <+bridge> [ddnet] just matching "." 10:26 <+bridge> [ddnet] one of the ways to escape a dot in regex 10:26 <+ChillerDragon> so [.] and [\.] is the same 10:26 <+bridge> [ddnet] huh? did you write the same string twice? 10:27 <+ChillerDragon> xd 10:27 <+ChillerDragon> did the bridge eat my backslash? 10:27 <+bridge> [ddnet] yes 10:27 <+ChillerDragon> https://zillyhuhn.com/cs/.1607333092.png 10:27 <+ChillerDragon> rude bridge 10:27 <+bridge> [ddnet] might be discord 10:34 <+bridge> [ddnet] 10:34 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/785438968141447198/unknown.png 10:39 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/785440377482117130/r_1464512_LrfhG.png 10:42 <+bridge> [ddnet] 10:42 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/785441200719134730/unknown.png 10:43 <+bridge> [ddnet] aah 10:49 <+bridge> [ddnet] my program is running for more than 1 minute :pepe_straight: 10:50 <+bridge> [ddnet] 2 minutes more or less 10:50 <+bridge> [ddnet] but i got the answer lmao 11:13 <+bridge> [ddnet] Does anyone know why my CI is failing? 11:14 <+bridge> [ddnet] I set the minimum CMake version to 2.8.12 already, but it still fails 11:14 <+bridge> [ddnet] https://github.com/fokkonaut/F-DDrace/runs/1509892132 11:32 <+bridge> [ddnet] yeah, all fail. I'm waiting for a good idea from @heinrich5991 about how to fix it πŸ˜„ 11:32 <+bridge> [ddnet] it's also because of gmock 11:38 <+bridge> [ddnet] sorry 😦 11:39 <+bridge> [ddnet] let me promise to fix it today 11:39 <+bridge> [ddnet] it's been on my todo list the whole weekend 11:50 <+bridge> [ddnet] using btreemap and btreesets i got it down 0.13s 11:50 <+bridge> [ddnet] 11:53 <+bridge> [ddnet] 11:58 <+bridge> [ddnet] day7? 11:59 <+bridge> [ddnet] there must be an algorithmic improvement lying around ^^ 11:59 <+bridge> [ddnet] with 2 parts 11:59 <+bridge> [ddnet] yeah i used a mess before 11:59 <+bridge> [ddnet] with hashmaps and recursion 11:59 <+bridge> [ddnet] xdd 12:00 <+bridge> [ddnet] my python solution runs in 0.04s, and I didn't optimize it for speed, but for speed of writing 12:00 <+bridge> [ddnet] it literally took 2 mins to get the answer 12:00 <+bridge> [ddnet] ah 12:00 <+bridge> [ddnet] i "time" ed it using cargo run 12:01 <+bridge> [ddnet] which adds a significant delay 12:01 <+bridge> [ddnet] ah 12:01 <+bridge> [ddnet] you traverse the data structure for each query 12:01 <+bridge> [ddnet] this does both a and b problem 12:01 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/785461023875268628/unknown.png 12:01 <+bridge> [ddnet] yea, mine also does a and b 12:01 <+bridge> [ddnet] how long is ur input?= 12:02 <+bridge> [ddnet] it also depends on that 12:02 <+bridge> [ddnet] i guess 12:02 <+bridge> [ddnet] 594 lines 12:02 <+bridge> [ddnet] the problem is that you do a search for each bag 12:02 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/785461216012140544/input 12:02 <+bridge> [ddnet] try with this input 12:02 <+bridge> [ddnet] yeah i guess its not optimized still 12:03 <+bridge> [ddnet] ``` 12:03 <+bridge> [ddnet] time python day7.py ryozuki7 12:03 <+bridge> [ddnet] 229 12:03 <+bridge> [ddnet] 6683 12:03 <+bridge> [ddnet] 12:03 <+bridge> [ddnet] ________________________________________________________ 12:03 <+bridge> [ddnet] Executed in 71.08 millis fish external 12:03 <+bridge> [ddnet] ``` 12:03 <+bridge> [ddnet] 0.07? 12:03 <+bridge> [ddnet] yes 12:03 <+bridge> [ddnet] :o 12:03 <+bridge> [ddnet] i win then 12:03 <+bridge> [ddnet] 12:04 <+bridge> [ddnet] I guess? ^^ 12:04 <+bridge> [ddnet] thats a weird time output 12:04 <+bridge> [ddnet] fish shell 12:04 <+bridge> [ddnet] yours is bash's 12:04 <+bridge> [ddnet] yea 12:05 <+bridge> [ddnet] > the problem is that you do a search for each bag 12:05 <+bridge> [ddnet] so how can i improve it 12:05 <+bridge> [ddnet] do it backwards 12:05 <+bridge> [ddnet] see which bag contains a shiny gold bag 12:06 <+bridge> [ddnet] and then check which bags contain those bags, etc. 12:06 <+bridge> [ddnet] ah 12:06 <+bridge> [ddnet] so i dont go that deep 12:06 <+bridge> [ddnet] everytime 12:06 <+bridge> [ddnet] yep 12:07 <+bridge> [ddnet] you'll only have to check exactly as many bags as the output is 12:08 <+bridge> [ddnet] i guess my second solution is good as it is right now right? 12:08 <+bridge> [ddnet] yes 12:08 <+bridge> [ddnet] problem b 12:09 <+bridge> [ddnet] hm 12:09 <+bridge> [ddnet] it could be better, but I didn't do it better either 12:09 <+bridge> [ddnet] if I may comment furtherly: don't pass `&String` as parameter, pass `&str`. it allows for strictly more types to be passed 12:09 <+bridge> [ddnet] same for `&Vec` β†’ `&[Type>` 12:09 <+bridge> [ddnet] same for `&Vec` β†’ `&[Type]` 12:10 <+bridge> [ddnet] (but that doesn't occur in this code) 12:10 <+bridge> [ddnet] yeah but i didnt want to type lifetimes everywhere 12:10 <+bridge> [ddnet] xd 12:10 <+bridge> [ddnet] `&String` has the same amount of lifetime parameters as `&str`, none 12:10 <+bridge> [ddnet] try it πŸ˜‰ 12:11 <+bridge> [ddnet] oh 12:11 <+bridge> [ddnet] just replace &String with &str and the code should still work. then you can remove .to_owned() from the function call 12:11 <+bridge> [ddnet] it doesnt complain on the .get 12:11 <+bridge> [ddnet] no 12:11 <+bridge> [ddnet] nice 12:11 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/785463494182436884/unknown.png 12:12 <+bridge> [ddnet] I don't see what you're trying to show me ^^ explain? πŸ™‚ 12:12 <+bridge> [ddnet] that it works 12:12 <+bridge> [ddnet] xD 12:12 <+bridge> [ddnet] kk ^^ 12:12 <+bridge> [ddnet] my vim can see errors 12:12 <+bridge> [ddnet] with rust-analyzer 12:12 <+bridge> [ddnet] fancy 12:12 <+bridge> [ddnet] see, it complains q is unused there 12:12 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/785463828657733662/unknown.png 12:13 <+bridge> [ddnet] and now do `println!("count {}", count(&bags, &"shiny gold".to_owned()) - 1);` β†’ `println!("count {}", count(&bags, "shiny gold") - 1);` for one less allocation πŸ™‚ 12:13 <+bridge> [ddnet] `&"shiny gold".to_owned()` β†’ `"shiny gold"` 12:13 <+bridge> [ddnet] ye works 12:13 <+bridge> [ddnet] nice 12:14 <+bridge> [ddnet] all I had to complain about, now I'll be quiet 12:14 <+bridge> [ddnet] if you want to fix the warning, you can replace the identifier by `_` or `_q` 12:14 <+bridge> [ddnet] ye did it 12:15 <+bridge> [ddnet] nice that you're doing it in rust ^^ 12:15 <+bridge> [ddnet] fancy neovim :POGGIES: 12:15 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/785464405609152512/unknown.png 12:15 <+bridge> [ddnet] ofc 12:15 <+bridge> [ddnet] i love rust 15:53 <+bridge> [ddnet] meh demos are broken again 15:53 <+bridge> [ddnet] "Invalid demo" 15:54 <+bridge> [ddnet] for like 8 of them 15:54 <+bridge> [ddnet] using save_replay 15:58 <+bridge> [ddnet] Am I overthinking day7? πŸ˜› 15:58 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/785520698814627900/g.png 16:00 <+bridge> [ddnet] probably? 16:00 <+bridge> [ddnet] yeah figures, kinda wanted to put it all in a graph and do a topological sort 16:14 <+bridge> [ddnet] oh, that worked πŸ˜› 16:20 <+bridge> [ddnet] maybe u should spred more the nodes 16:20 <+bridge> [ddnet] its a bit messy in the center 16:20 <+bridge> [ddnet] xd 16:20 <+bridge> [ddnet] spread* 16:21 <+bridge> [ddnet] @Learath2 r u using python still? 16:23 <+bridge> [ddnet] I really don't like Perl: https://github.com/def-/adventofcode-2020/blob/master/day07a.pl 16:26 <+bridge> [ddnet] @Ryozuki yeah using networkx 16:27 <+bridge> [ddnet] The second part is a little tricky though, still thinking about it 16:27 <+bridge> [ddnet] second part was easier for me 16:27 <+bridge> [ddnet] xd 16:27 <+bridge> [ddnet] I know what I want to do, not really sure how to put it in graph algorithms terms πŸ˜› 16:27 <+bridge> [ddnet] prolog and perl have the same file extension? 16:27 <+bridge> [ddnet] TIL 16:28 <+bridge> [ddnet] I need a sort of depth first search 16:29 <+bridge> [ddnet] 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 πŸ˜› 16:29 <+bridge> [ddnet] hmm 16:29 <+bridge> [ddnet] idk i just used btree map and set and a bit of brain 16:29 <+bridge> [ddnet] :pepe_straight: 16:29 <+bridge> [ddnet] 16:30 <+bridge> [ddnet] 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 πŸ˜› 16:31 <+bridge> [ddnet] https://doc.rust-lang.org/std/collections/struct.BTreeMap.html 16:31 <+bridge> [ddnet] :pepeH: 16:55 <+bridge> [ddnet] I can't believe how rusty I've gotten with algorithms... 17:00 <+bridge> [ddnet] today problem 17:00 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/785536291193618453/gx6l9oavzp361.png 17:29 <+bridge> [ddnet] Pf, I give up. I must be misunderstanding something 17:30 <+bridge> [ddnet] Heh, on Windows you can use Win+. to enter emojis, kind of works in DDNet 17:30 <+bridge> [ddnet] But with the mouse you can't select the emoji, only with keyboard. @TsFreddie could that be imrpoved? 17:31 <+bridge> [ddnet] 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 17:31 <+bridge> [ddnet] probably not tbh 17:31 <+bridge> [ddnet] I mean improve the experience with external program. 17:32 <+bridge> [ddnet] How about switching to not capturing input? then it works with external program. As is currently done in F1 17:32 <+bridge> [ddnet] We probably couldn't know when to switch. 17:33 <+bridge> [ddnet] I don't think win+. works like ime either 17:33 <+bridge> [ddnet] @deen IIRC we backed out of emojis last time 17:34 <+bridge> [ddnet] yes, because they were totally broken 17:34 <+bridge> [ddnet] uhm, I think because people abused them 17:34 <+bridge> [ddnet] but using a proper emoji font would also be better 17:34 <+bridge> [ddnet] Oh well 17:35 <+bridge> [ddnet] Our font texture is currently a 8bit channel. So basically only alpha iirc 17:35 <+bridge> [ddnet] We will need a separate texture for colored emojis 17:36 <+bridge> [ddnet] can't find anything on the issue tracker 17:37 <+bridge> [ddnet] https://forum.ddnet.tw/viewtopic.php?f=3&t=6058 17:44 <+bridge> [ddnet] 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. 17:46 <+bridge> [ddnet] Also probably will break in exclusive fullscreen mode like ime does. 18:24 <+bridge> [ddnet] I'm still way overcounting :/ 18:40 <+bridge> [ddnet] How am I supposed to clear out a folder in the tw source? 18:41 <+bridge> [ddnet] i wanna delete all files in a folder (or delete whole folder and re-create the empty folder :D) 18:41 <+bridge> [ddnet] how? 18:41 <+bridge> [ddnet] I cant use ListDirectory, as the file is still opened then 18:58 <+bridge> [ddnet] ListDirectory shouldn't open the individual files in the directory, then you can call RemoveFile on them 18:58 <+bridge> [ddnet] Does not seem to work 18:58 <+bridge> [ddnet] i will try it once again and make sure i am doing it correct 19:00 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/785566371479158845/unknown.png 19:00 <+bridge> [ddnet] this is correct, is it? 19:00 <+bridge> [ddnet] within the callback of the listdirectory 19:02 <+bridge> [ddnet] You should check the return value of RemoveFile. pName might be missing the prefix of the directory, and just be the filename 19:02 <+bridge> [ddnet] so you might have to put that together yourself 19:03 <+bridge> [ddnet] but that should be correct already 19:03 <+bridge> [ddnet] before calling ListDirectory i passed the right path that also worked before when directly calling 19:03 <+bridge> [ddnet] let me try it again 19:04 <+bridge> [ddnet] it found both files, but they are not deleted 19:04 <+ChillerDragon> https://zillyhuhn.com/cs/.1607364132.png 19:04 <+ChillerDragon> xd 19:05 <+bridge> [ddnet] oh @deen 19:05 <+bridge> [ddnet] thanks 19:05 <+bridge> [ddnet] it really cut off my path 19:05 <+bridge> [ddnet] in the front 19:15 <+bridge> [ddnet] https://github.com/Learath2/aoc/blob/master/2020/7/solve.py 19:15 <+bridge> [ddnet] Absolutely shameful how long this took me :/ Need to brush up on graphs again 19:32 <+bridge> [ddnet] Though it does print a cute graph if you use the dbg function πŸ˜› 19:44 <+bridge> [ddnet] I was also thinking about solving this with a graph db 20:46 <+bridge> [ddnet] @deen what assumption allowed you to reduce the problem so much? 22:10 <+bridge> [ddnet] tomorrow is the day of cmake fixes. I'm going to bed. sorry 22:15 <+bridge> [ddnet] qywinc 22:15 <+bridge> [ddnet] oops 22:43 <+bridge> [ddnet] @Learath2 which problem? AoC? I don't think I reduced anything 22:43 <+bridge> [ddnet] AoC, I had to use like an entire graph πŸ˜› 22:43 <+bridge> [ddnet] I just got really annoyed by the way types work in Perl, it's horrible 22:43 <+bridge> [ddnet] I have a hashmap too 22:44 <+bridge> [ddnet] but who knows that `$m{$a} = ...` makes $m a hashmap... 22:44 <+bridge> [ddnet] You seem to have reduced it to a hashmap somehow 22:44 <+bridge> [ddnet] I feel like there is no more development on DDNet since AoC 😦 22:45 <+bridge> [ddnet] tho I guess hashmaps can be interpreted as graphs somehow? 22:45 <+bridge> [ddnet] Exactly, I just recurse on subroutine (function would be too boring) `f` 22:45 <+bridge> [ddnet] I'm really lacking in theory 22:46 <+bridge> [ddnet] I just store the graph as key = from and value = to in the hashmap