04:30 <+bridge> [ddnet] !KGxsyoVGiJnswWhQld\:matrix.org 06:08 <+bridge> [ddnet] gg heinrich 06:12 <+bridge> [ddnet] ty, gg 06:12 <+bridge> [ddnet] made a mistake today reading the part 2 specification 06:12 <+bridge> [ddnet] submitted the wrong answer first 06:15 <+bridge> [ddnet] pretty cool puzzles so far 06:15 <+bridge> [ddnet] I guess I can expect next times as well, so I will setup quick loading & splitting 06:15 <+bridge> [ddnet] pretty cool puzzles so far 06:15 <+bridge> [ddnet] I guess I can expect file input next times as well, so I will setup quick loading & splitting 06:17 <+bridge> [ddnet] yes, it's file input every day 06:17 <+bridge> [ddnet] I also have a template file with common stuff 06:17 <+bridge> [ddnet] check out last year's aoc to get an idea what the common ways of preprocessing the inputare 06:18 <+bridge> [ddnet] i will, thanks 06:18 <+bridge> [ddnet] seems just like project euler but easier 07:48 <+bridge> [ddnet] today was easier 07:59 <+bridge> [ddnet] hm, don't think so 08:00 <+bridge> [ddnet] im sure more people struggle looping with a sliding window than splitting text 08:00 <+bridge> [ddnet] xd 08:00 <+bridge> [ddnet] ah, I guess 08:01 <+bridge> [ddnet] today I wrote an actual for loop 08:01 <+bridge> [ddnet] yesterday it was just a list comprehension ^^ 08:01 <+bridge> [ddnet] well thats a loop too 08:01 <+bridge> [ddnet] but without the state 08:03 <+bridge> [ddnet] but I guess I see your point 08:03 <+bridge> [ddnet] 😀 08:03 <+bridge> [ddnet] i love this smiley face 08:48 <+bridge> [ddnet] @Ryozuki case in point, one of my friends took 20min to parse the input data, but had no problems yesterday 08:48 <+bridge> [ddnet] :o 08:54 <+bridge> [ddnet] the first puzzle from 2020 where you have to find the pair of 2 numbers that add up 2020, has a nice solution idea I saw in a google interview. You start with an empty ordered set. You check if list[i] is contained in that set, if yes you found the pair (it is list[i] and (2020 - list[i]). if not, add (2020 - list[i]) to the ordered set. A pretty neat (and somewhat fast) solution. I am not sure if this approach works for 3 targets though 08:55 <+bridge> [ddnet] the first puzzle from 2020 where you have to find the pair of 2 numbers that add up 2020, has a nice solution idea I saw in a google interview. You start with an empty ordered set. You check if list[i] is contained in that set, if yes you found the pair (it is list[i] and (2020 - list[i]). if not, add (2020 - list[i]) to the ordered set. A pretty neat (and somewhat fast) solution. I am not sure if this approach can be adjusted to work for 3 tar 08:56 <+bridge> [ddnet] I guess you can still meet in the "middle" 08:56 <+bridge> [ddnet] test whether 2020 - a - b is in the set for any pair a, b from your set 08:56 <+bridge> [ddnet] (where "set" means your input data in a set datastructure) 09:03 <+bridge> [ddnet] I can't quite grasp the logic. If not found, what would you add to the set? 09:07 <+bridge> [ddnet] ```py 09:07 <+bridge> [ddnet] input = […] 09:07 <+bridge> [ddnet] input_set = set(input) 09:07 <+bridge> [ddnet] for a, b in itertools.combinations(input, 2): 09:07 <+bridge> [ddnet] if 2020 - a - b in input_set: 09:07 <+bridge> [ddnet] return a, b, 2020 - a - b 09:07 <+bridge> [ddnet] ``` 09:07 <+bridge> [ddnet] untested, coded in the discord chat message box 😄 09:14 <+bridge> [ddnet] Ahhh ok now I got it. Very nice. So you can search for any number of summands without increasing time complexity. 09:15 <+bridge> [ddnet] hm, this is O(n^2), unfortunately 09:17 <+bridge> [ddnet] which day is it? 09:18 <+bridge> [ddnet] 1 09:18 <+bridge> [ddnet] oh yea my solution is not pretty xd 09:18 <+bridge> [ddnet] Oh , combinations adds I see. I guess I will see it live in C++ when I try to implement the idea. 09:55 <+bridge> [ddnet] https://gist.github.com/edg-l/b8f6fcd860411de8b9ec8158f6491477 09:55 <+bridge> [ddnet] i made the day 2 in rust but trying to do it super rusty 09:55 <+bridge> [ddnet] idk if it fits xd 10:20 <+bridge> [ddnet] aoc is so weird. Do you even have to write a program? Or can you solve it just based on your input? xd 10:20 <+bridge> [ddnet] well, if you don't write a program you're likely to be slower than people who do write a program 10:20 <+bridge> [ddnet] the input is quite large 10:20 <+bridge> [ddnet] but there is only 1 input? 10:21 <+bridge> [ddnet] one input for each person 10:21 <+bridge> [ddnet] im pretty sure im faster not writing a program xd 10:21 <+bridge> [ddnet] I'm pretty sure you're faster writing a program 10:22 <+bridge> [ddnet] @Ryozuki your `Default` impl can be replaced by `#[derive(Default)]`. but maybe you liked the explicitness? 10:23 <+bridge> [ddnet] oh i forgot about it 10:23 <+bridge> [ddnet] xD 10:23 <+bridge> [ddnet] well being explicit is not bad i guess 10:25 <+bridge> [ddnet] omg wrong answer 10:25 <+bridge> [ddnet] i hate aoc 10:25 <+bridge> [ddnet] u are faster with a program im sure 10:25 <+bridge> [ddnet] wats the catch on day2? 10:25 <+bridge> [ddnet] aint i summing all up and then calc x \* y? 10:26 <+bridge> [ddnet] ah nvm 10:26 <+bridge> [ddnet] depth is not negative \:D 10:26 <+bridge> [ddnet] ok no way i would have been that fast in a proper written program 10:27 <+bridge> [ddnet] image.png 10:27 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/915896865529147392/image.png 10:27 <+bridge> [ddnet] that's a program 😉 10:27 <+bridge> [ddnet] you have to calculate the times it goes up 10:27 <+bridge> [ddnet] and ye thats a program 10:27 <+bridge> [ddnet] it cant be run again tho 10:27 <+bridge> [ddnet] I can run it on my input, too 10:28 <+bridge> [ddnet] yea i guess 10:28 <+bridge> [ddnet] ok thats weird 10:28 <+bridge> [ddnet] https://en.wikipedia.org/wiki/Computer_program 10:28 <+bridge> [ddnet] omg part two? -.- 10:28 <+bridge> [ddnet] tl;dr 10:29 <+bridge> [ddnet] i rq 11:00 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/915905180485189632/unknown-1.png 11:01 <+bridge> [ddnet] xd 11:01 <+bridge> [ddnet] ez sort 11:59 <+bridge> [ddnet] linear time sort even 12:00 <+bridge> [ddnet] under the assumption that setTimeout takes constant time 12:00 <+bridge> [ddnet] and you have to scale it by the largest element so you don't wait too long, but can also find that in linear time 12:01 <+bridge> [ddnet] (but there are better linear time sorting algorithms for ints) 12:19 <+bridge> [ddnet] Now I wanna know 12:20 <+bridge> [ddnet] https://en.wikipedia.org/wiki/Radix_sort 12:26 <+bridge> [ddnet] yeah that's quite fast. Tradeoff seems to be more memory allocations 13:24 <+bridge> [ddnet] Are you going to fix $total_time? It has been broken for around 6 months now 13:42 <+bridge> [ddnet] its a feature 13:46 <+bridge> [ddnet] You are right, nevermind 13:53 <+bridge> [ddnet] ?xd 13:53 <+bridge> [ddnet] what are you even talking about? 14:08 <+bridge> [ddnet] Broken? 14:40 <+bridge> [ddnet] Are you going to fix $total_time? It has been broken for around 2 months now 14:40 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/915960693415620628/unknown.png 14:40 <+bridge> [ddnet] @Learath2 it doesn't update 14:43 <+bridge> [ddnet] total time of what is this 14:44 <+bridge> [ddnet] Well it's supposed to be the total finish times, so if you didnt finish any maps it wont change 14:45 <+bridge> [ddnet] I have finished a lot of maps 14:45 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/915961761138614292/unknown.png 15:17 <+bridge> [ddnet] That's funny, I just added DDNet here: https://en.wikipedia.org/wiki/List_of_open-source_video_games 15:17 <+bridge> [ddnet] And then clicked on Talk and saw that someone requested it 3 days ago 😄 https://en.wikipedia.org/wiki/Talk:List_of_open-source_video_games#DDraceNetwork%2C_an_actively_developed_fork%2Fmod_of_Teeworlds 15:17 <+bridge> [ddnet] Anyone want to attempt to submit a wiki article for it? I'm honestly not sure how strict it is at the moment in Wikipedia, and it's usually bad style to write an article about your own project, not objective 15:18 <+bridge> [ddnet] > DDraceNetwork is an actively developed fork/mod of Teeworlds, and it isn't mentioned in Wikipedia at all (searching yields nothing). 15:18 <+bridge> [ddnet] its mentioned in wikidata 15:18 <+bridge> [ddnet] i edited it a bit somewhen 15:18 <+bridge> [ddnet] lmao minecraft is listed there? 15:18 <+bridge> [ddnet] https://www.wikidata.org/wiki/Q60566097 15:18 <+bridge> [ddnet] wikidata is part of wikimedia, but not wikipedia 15:19 <+bridge> [ddnet] :poggers: 15:19 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/915970341967392789/unknown.png 15:19 <+bridge> [ddnet] true 15:19 <+bridge> [ddnet] Yesterday I added the new versions on wikidata 15:19 <+bridge> [ddnet] we dont have a wikipedia article sadly 15:19 <+bridge> [ddnet] i wonder if creating it ourselves is against the rules 15:19 <+bridge> [ddnet] probs 15:19 <+bridge> [ddnet] i dont know much 15:19 <+bridge> [ddnet] wow that list is very short *sad noises* 15:19 <+bridge> [ddnet] Someone could try writing one, just check previously what the criteria of notoriety are 15:20 <+bridge> [ddnet] https://en.wikipedia.org/wiki/Wikipedia:Notability 15:20 <+bridge> [ddnet] I see lots of unpopular open source games have articles, so should be possible 15:27 <+bridge> [ddnet] Not many articles in English though: https://www.gamingonlinux.com/2020/08/five-years-later-free-and-open-source-ddracenetwork-is-now-on-steam/ 15:28 <+bridge> [ddnet] it doesnt need to be english 15:28 <+bridge> [ddnet] but ye 15:29 <+bridge> [ddnet] https://gamefabrique.com/games/ddracenetwork/ 15:29 <+bridge> [ddnet] i found this fishy thing 15:29 <+bridge> [ddnet] lmao 15:31 <+bridge> [ddnet] 15:31 <+bridge> [ddnet] Don't link to some automated pages 😄 15:31 <+bridge> [ddnet] 15:31 <+bridge> [ddnet] is this known? 15:31 <+bridge> [ddnet] xd 15:32 <+bridge> [ddnet] someone plays league with this name 15:32 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/915973583174508604/unknown.png 15:32 <+bridge> [ddnet] ok i stop 15:32 <+bridge> [ddnet] to much google 16:18 <+bridge> [ddnet] that big install button comes with a bunch of malware and adware 😄 16:59 <+bridge> [ddnet] meh, im wasting sooo much time .__. 16:59 <+bridge> [ddnet] 16:59 <+bridge> [ddnet] ```Bash 16:59 <+bridge> [ddnet] #!/bin/bash 16:59 <+bridge> [ddnet] # Advent of Code 02 16:59 <+bridge> [ddnet] shopt -s lastpipe 16:59 <+bridge> [ddnet] p1f=$(grep forward "$1" | cut -d' ' -f2 | tr '\n' '+ ' | rev | cut -c2- | rev | bc) 16:59 <+bridge> [ddnet] p1d=$(grep down "$1" | cut -d' ' -f2 | tr '\n' '+ ' | rev | cut -c2- | rev | bc) 16:59 <+bridge> [ddnet] p1u=$(grep up "$1" | cut -d' ' -f2 | tr '\n' '+ ' | rev | cut -c2- | rev | bc) 16:59 <+bridge> [ddnet] 16:59 <+bridge> [ddnet] while read -r l; do 16:59 <+bridge> [ddnet] ln=$(echo "$l" | cut -d' ' -f2) 16:59 <+bridge> [ddnet] lt=$(echo "$l" | cut -d' ' -f1) 16:59 <+bridge> [ddnet] if [ "$lt" == "forward" ]; then 16:59 <+bridge> [ddnet] p2f="$(( p2f + ln ))" 16:59 <+bridge> [ddnet] p2dp="$(( p2dp + (ln * p2a) ))" 16:59 <+bridge> [ddnet] elif [ "$lt" == "up" ]; then 16:59 <+bridge> [ddnet] p2a="$(( p2a - ln ))" 16:59 <+bridge> [ddnet] elif [ "$lt" == "down" ]; then 17:00 <+bridge> [ddnet] p2a="$(( p2a + ln ))" 17:00 <+bridge> [ddnet] fi 17:00 <+bridge> [ddnet] done < "$1" 17:00 <+bridge> [ddnet] 17:00 <+bridge> [ddnet] echo "Part 1:"; echo "$p1f * ($p1d - $p1u)" | bc 17:00 <+bridge> [ddnet] echo "Part 2:"; echo "$p2f * $p2dp" | bc 17:00 <+bridge> [ddnet] ``` 17:00 <+bridge> [ddnet] bash poggers 17:00 <+bridge> [ddnet] lol nice you took basically the same approach like i did. I approve c\: 17:00 <+bridge> [ddnet] only R and bash for me, im not a coder :< 17:00 <+bridge> [ddnet] what makes you think that 17:00 <+bridge> [ddnet] real coders use bash 17:01 <+bridge> [ddnet] real linux hacker bois ))) 17:01 <+bridge> [ddnet] yas 17:02 <+bridge> [ddnet] what do you use bc for? 17:02 <+bridge> [ddnet] i was told to stay away from bc 17:14 <+bridge> [ddnet] im sry to say but R looks rly ugly to me xd 17:15 <+bridge> [ddnet] from the other day 17:15 <+bridge> [ddnet] i guess Rscript is R right? 17:15 <+bridge> [ddnet] xd 17:19 <+bridge> [ddnet] You can probably pass some code reviews as a software developer with those answers 😄 17:20 <+bridge> [ddnet] I had interviews where this kind of task was the only coding part of the interview, rest was small talk 17:28 <+bridge> [ddnet] @Index new maps when 17:29 <+bridge> [ddnet] ur barely around :( 17:33 <+bridge> [ddnet] oohh bc is a calculator 17:33 <+bridge> [ddnet] i always opened python to calculate stuff 17:34 <+bridge> [ddnet] sqrt(2) 17:34 <+bridge> [ddnet] 1 17:34 <+bridge> [ddnet] ye bc is for maffs and shit 17:34 <+bridge> [ddnet] :justatest: 17:34 <+bridge> [ddnet] bash for example cant do floating point 17:34 <+bridge> [ddnet] ah you need bc -l for it to work good 17:34 <+bridge> [ddnet] i use ruby for maffs c\: less typing than python \:p 17:34 <+bridge> [ddnet] sqrt(2) 17:34 <+bridge> [ddnet] 1.41421356237309504880 17:35 <+bridge> [ddnet] idk ruby 17:35 <+bridge> [ddnet] just use awk 17:35 <+bridge> [ddnet] ruby is literally python 17:35 <+bridge> [ddnet] without the tab annoyances \:D 17:38 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/916005294700625920/unknown.png 17:38 <+bridge> [ddnet] thats cool 17:38 <+bridge> [ddnet] (a is the arctangent) 17:47 <+bridge> [ddnet] @Ryozuki\: there is weather and BTC price missing in your shell prompt 17:48 <+bridge> [ddnet] :greenthing: 17:50 <+bridge> [ddnet] https://blog.rust-lang.org/2021/12/02/Rust-1.57.0.html 17:50 <+bridge> [ddnet] :poggers: 17:50 <+bridge> [ddnet] fallible allocation 17:50 <+bridge> [ddnet] now linux can proceed 17:51 <+bridge> [ddnet] > Add armv6k-nintendo-3ds at Tier 3*. 17:51 <+bridge> [ddnet] xd 17:51 <+bridge> [ddnet] nintendo? 17:52 <+bridge> [ddnet] yes best hardware producer 17:52 <+bridge> [ddnet] my gpu is from nintendo 17:52 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/916009034568589412/unknown.png 17:52 <+bridge> [ddnet] thanks to llvm 13 more targets are supported 17:57 <+bridge> [ddnet] image.png 17:57 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/916010102786510878/image.png 17:57 <+bridge> [ddnet] cen sorship 17:57 <+bridge> [ddnet] i use arch btw 17:57 <+bridge> [ddnet] image.png 17:57 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/916010251013222460/image.png 17:57 <+bridge> [ddnet] here u go leak 18:06 <+bridge> [ddnet] xd sure chillerbot.png is lyfe 18:06 <+bridge> [ddnet] \:ban\: 18:06 <+bridge> [ddnet] 18:45 <+bridge> [ddnet] Guess R is not really used for "standard" coding tasks, its more suited for statistical analyses, graphs etc. :p also im using it in a quite limited way, so it definitely is ugly here xdd 18:47 <+bridge> [ddnet] Glad to know, that there are options for a 180 degree profession change :> 18:47 <+bridge> [ddnet] I'll definitely fail the smalltalk then .__. 18:47 <+bridge> [ddnet] whats ur profession? 18:48 <+bridge> [ddnet] coffee 3 scheduled for 2084 :o but guess we'll both stay with that game forever, so just keep waiting)) 18:49 <+bridge> [ddnet] obv not programming :> 18:49 <+bridge> [ddnet] spill it 18:51 <+bridge> [ddnet] :bluekitty: 21:49 <+bridge> [ddnet] can someone clarify sometihng to me in java 21:49 <+bridge> [ddnet] or is this text chat only for teeworlds development 21:53 <+bridge> [ddnet] Feel free to ask, but noone can be sure that someone will answer you:monkalaugh: 21:57 <+bridge> [ddnet] ```java 21:57 <+bridge> [ddnet] while (cargoManifestOnYearResultSet.next()) { 21:57 <+bridge> [ddnet] ``` 21:57 <+bridge> [ddnet] next is a boolean method 21:57 <+bridge> [ddnet] when i run something like this 21:57 <+bridge> [ddnet] does the method iteslf run 21:57 <+bridge> [ddnet] yes 21:58 <+bridge> [ddnet] it has to run the method to get the return value (type boolean) to check 21:58 <+bridge> [ddnet] that's what i thought, thanks 21:58 <+bridge> [ddnet] have you ever used jdbc 21:59 <+bridge> [ddnet] ever yes, but I can't answer any questions better than google probably 21:59 <+bridge> [ddnet] it's a simple question that i cannot find 21:59 <+bridge> [ddnet] like whne i execute a query, it returns a result set 21:59 <+bridge> [ddnet] my cursor is on the first row of that result set 21:59 <+bridge> [ddnet] the first row is the labels or already data? 22:00 <+bridge> [ddnet] initially the cursor is before the first row of data 22:01 <+bridge> [ddnet] you could probably just write a small program to check 22:02 <+bridge> [ddnet] I'm not sure if you can get the column labels when the cursor is before the first row. It probably just throws an exceptions 22:02 <+bridge> [ddnet] oh, it is before? i didn't know that 22:02 <+bridge> [ddnet] but the first row, is it labels or data? 22:03 <+bridge> [ddnet] it's before the first row of data first 22:03 <+bridge> [ddnet] so you can do a loop while(result.next()) I guess 22:03 <+bridge> [ddnet] yes, but what i asked is 22:03 <+bridge> [ddnet] is the first row 22:03 <+bridge> [ddnet] just labels 22:03 <+bridge> [ddnet] or data already? 22:03 <+bridge> [ddnet] it should be data 22:04 <+bridge> [ddnet] but you could also check to make sure 22:04 <+bridge> [ddnet] thanks! 22:04 <+bridge> [ddnet] ye, i'll try to check 22:04 <+bridge> [ddnet] jsut wanted to know beforehand tho