00:18:24 cameron rogers: how do I find the information about the exams ? when I search on InfoStud there is nothing there 00:18:58 yusupha juwara: all the exams 00:19:15 Yigit Oztekin: i can link it here if it's allowed 00:19:19 yusupha juwara: i too haven't found anything on infostud 00:19:48 yusupha juwara: oh, thanks. It's not infostud then 00:20:11 ISRAT JAHAN MITU: https://docs.google.com/spreadsheets/u/0/d/1ZZc06TVVOI5ukvTJ7nCySRkTF7mq2ytewMftUtSZOhQ/htmlview# 00:20:44 Iliyas Alimzhan: finding the order is pretty hard 00:20:51 simone cargnin: secret test are the worst 00:22:47 benjamin barda: the number of pixel of that color in the image is = perimeter 00:26:46 Alessio Borgi: When a rectangle intersects more than one other rectangle, how to manage this situation? 00:28:32 benjamin barda: only for the last drawn i meant 00:28:42 Alessandro vecchi: I did the homework but without using classes, because I didn’t get how to pass from an homework like the ones we did till now to another one with classes. Maybe I still didn’t get the advantage of using them 00:29:42 Francesco Danese: i did the same as Alessandro 00:30:04 Davide Marincione: Me 00:30:09 Dario Loi: I used OOP 00:30:15 Andrea Caminiti: Same 00:30:16 benjamin barda: i tryed without classes bur did not managed 00:30:18 Davide di Trocchio: I'm using classes 00:30:19 Dario Loi: how do you even do it without it without going insane lol 00:30:20 Paolo Gigliesi: I'll try to use them 00:30:53 Dario Loi: probably by using dictionaries like c++ structs (?) 00:31:11 Davide Marincione: I find classes a bit inefficient- i prefer to use dictionaries with colours as keys and lists as their values 00:31:30 Alessandro vecchi: same 00:31:33 Gabriele Scognamiglio: same 00:31:55 simone cargnin: same 00:34:03 benjamin barda: honestly would be better to have harder tests with edge cases rather than spending time getting down milliseconds 00:34:11 Francesco Danese: i agree 00:34:15 benjamin barda: just a little feedback * 00:34:30 Dario Loi: absolutely 00:34:47 Dario Loi: the bonuses from speed distracted me from the actual purpose of building a proper solid program 00:34:53 Davide Marincione: I mean- I too find it a bit strange to give bonuses on efficiency on something like python, which is not that efficient 00:34:55 Dario Loi: so I learned a hard lesson here 00:35:02 Davide Marincione: It is normal to create monsters because of this 00:35:45 benjamin barda: evryone with those hw4 secret test learned the lesson i guess 00:36:50 Dario Loi: only 5 persons passed fully 00:36:50 simone cargnin: only five students passed 00:37:12 Francesco Danese: 7 students in total in the 2 courses 00:37:13 benjamin barda: not about that 00:37:16 Ginevra Cepparulo: Yes we dropped something like 10 points 00:37:20 Dario Loi: no, I just missed a return on the finals function, really trivial thing 00:37:35 Dario Loi: so I accept my defeat :/ 00:37:39 Davide Marincione: Tbh my program failed because I assumed that periods existed… then ONE test did not have any period 00:37:45 Dario Loi: sadly the thing is that many informations get distributed to the Informatica course 00:37:46 Davide di Trocchio: I failed on counting the final SE, but in all tests I had no problems 00:37:49 simone cargnin: eng description of problem was not complete 00:37:58 simone cargnin: also for other things 00:38:04 Dario Loi: and we are expected to also know them, cause our course is shared 00:38:07 Alessio Borgi: I failed the test 3. 00:38:21 Davide Marincione: test_3 was the problem 00:38:48 Oleksandr Prusakovskyy: i failed for just a method 00:39:02 Francesco Danese: almost no one have considered the case where the modulo was the entire prosody 00:40:08 Alessandro vecchi: Many of us failed for line with a single letter…since I saw that many of us used rindex(that returns an error if the string doesn’t exist) instead of rfind(that doesn’t returns an error). Pretty unlucky 00:40:10 Francesco Danese: cause it's not a repitition if it's only 1 ahah 00:40:32 benjamin barda: one last thing i think the way correcting error in the exercise is not very well handled, many exceptions were discussed in comments of question in the italian forum, would be nice to receive a notification on email or q2a for those corrections 00:41:02 Dario Loi: yeah thats what I was saying before 00:41:07 Ginevra Cepparulo: No not nice 00:41:10 Dario Loi: many informations get passed to Informatica but not to us 00:41:30 Francesco Danese: benjamin you can submit your account into the italian course too, like i did so i can also partecipate in the italian forum 00:41:46 Dario Loi: Yeah but many of us don't speak italian, so this isn't really inclusive to all the students 00:41:47 benjamin barda: true 00:42:04 Francesco Danese: yes that's true 00:42:25 simone cargnin: by the way i wanted to use classes in the homework but in practice i didn't know what to do 00:42:26 benjamin barda: thank you very much for the disponibility 00:42:48 Dario Loi: yes, thank you 00:43:24 Alessandro vecchi: Sure perfect 00:43:25 Francesco Danese: thank you 00:43:28 Davide di Trocchio: Thank you. 00:49:06 benjamin barda: segment can be only parrallel to the axis or also obliqui ? 00:49:14 benjamin barda: i do not know ho to say obliqui in english 00:49:33 simone cargnin: oblique 00:52:24 Alessandro vecchi: Each corner must have 2 white pixels and two black pixels on the adjacent pixels? 00:53:21 Alessandro vecchi: So if I have an image like the + I have 0 corners right? 00:54:32 Davide Marincione: Can we see the problem's text again? 00:54:50 benjamin barda: count in the rows repetition (black,white) 00:55:03 benjamin barda: count in column repetition (black,white) 00:55:07 benjamin barda: sum them 00:55:11 Viola Renzi: write a function that takes as an input an image with a black background and several white segments drawn in it and returns the number of corners made by the segments. 00:55:29 Ginevra Cepparulo: what is the definition of segment 00:55:49 Davide Marincione: Thanks Viola 00:55:52 Alessandro vecchi: What is the definition of corner made by the segments? 00:56:07 Ginevra Cepparulo: lol 01:00:30 Carlo Giuseppe Tomazzoli: Slow but could work: 01:00:32 Carlo Giuseppe Tomazzoli: def search_corners(filename): image_matrix = images.load(filename) corners = [] for y in range(image_matrix): for x in range(image_matrix[0]): if is_corner((x, y), image_matrix): corners.append((x, y)) return corners 01:00:49 Carlo Giuseppe Tomazzoli: def is_corner(matrix, *pixel_coords): directions = [south, west, north, south] whites = 0 for direction in directions: x, y = direction(pixel_coords) if matrix[y][x] == (255, 255, 255): whites += 1 return whites > 1 01:01:11 Carlo Giuseppe Tomazzoli: Directions are either lambdas or "def", such as: 01:01:15 Carlo Giuseppe Tomazzoli: def south(x, y): return x, y + 1 01:02:45 simone cargnin: same as mine 01:03:53 benjamin barda: maybe make a line object 01:04:06 benjamin barda: and ee how many lines have a vertex in common 01:04:15 benjamin barda: see * 01:05:06 Alessandro vecchi: I don’t think this may work Carlo. If the pixel above and the pixel below are both whites you don’t have a corner 01:06:18 Alessandro vecchi: But I don’t know if I understood the solution 01:06:27 Carlo Giuseppe Tomazzoli: (I think you're right, Ale. The pixel we starting from should be white.) 01:13:41 Alessandro vecchi: Row != 0, len matrix and pixel !0 0 len matrix[0] 01:17:44 Alessandro vecchi: Row != 0, len(matrix) and pixel!=0, len(matrix[0])* 01:19:13 Alessio Olivieri: i now its pretty stupid, but why 0 for north and west? 01:19:52 Alessandro Bellia: Same question for me 01:20:06 Carlo Giuseppe Tomazzoli: You're going "west", but you can't go into negative "x". So you must check that the "x" coordinate is higher than 0. 01:20:33 Carlo Giuseppe Tomazzoli: Else you'd go "west" and out of index, in the matrix. 01:20:54 Alessandro vecchi: Any or all? 01:21:00 Davide Marincione: Why don't we arrange directions like this: directions = [lambda x, y, col: x < w and matrix[y][x+1] == col, # East lambda x, y, col: y < h and matrix[y+1][x] == col, # South lambda x, y, col: x > 0 and matrix[y][x-1] == col, # West lambda x, y, col: y > 0 and matrix[y-1][x] == col, # North ] 01:21:12 Davide Marincione: And then do this? 01:21:12 Davide Marincione: comb = [] for direct in directions: comb.append(direct(j,i, color)) for numb in range(4): if comb[numb] and not comb[(numb + 2) % 4]: if comb[(numb + 1) % 4]: corners+=1 01:24:20 simone cargnin: add int 01:24:41 simone cargnin: to the return of is_corner 01:24:57 simone cargnin: a okok nevermind 01:25:02 federica bruni: Why don’t we look for white-white-black and black-white-white combinations and then just check if the one on top or the one on the bottom (to the middle white pixel ) is white 01:26:21 federica bruni: No why 01:26:31 simone cargnin: you don't check if the pixel is black 01:26:50 Alessandro vecchi: Yes but in this case all the vertical line is a corner 01:26:58 simone cargnin: two adiacent line is the edge case am i right 01:27:26 yusupha juwara: 10 minutes 01:27:29 yusupha juwara: break 01:28:48 Alessandro vecchi: I think we have problems also in situations like this___I___ 01:30:08 federica bruni: No ale, because you check for two white pixels horizontally, so vertical lines are black white black 01:31:01 federica bruni: That case has no white white and black and then on top of the middle one a white pixel( or on the bottom) so I think should be fine 01:32:39 federica bruni: But probably has some other problems anyway ahahah 01:33:47 Alessandro vecchi: Oh I got it. But what if we have two parallel vertical segments in two adjacent pixels? 01:37:57 Alessandro vecchi: Is there a way to do it without checking every pixel? 01:40:19 Alessandro vecchi: Like if row.count(black)==len(row), continue? 01:42:17 Andry R.: What if the pixel given happens to be an intersection? 01:42:46 Andry R.: Yes thank you 01:43:28 Dario Loi: sorry for the out of topic question, but is there a way to have a logical XOR in python as a condition 01:43:47 Dario Loi: without actually having to concatenate or and ands as per the XOR definition 01:44:07 Davide Marincione: Is the pixel passed as a 2-tuple or two different variables x and y? 01:50:17 simone cargnin: we check the vertical adiacent pixels if they are white we count white pixels in the colum, after we check orizzonatal adiacent pixel if they are white we count white pixels in the line 01:50:44 simone cargnin: if we have an intersection we output two segment? 01:51:08 simone cargnin: but the edge? 01:51:18 simone cargnin: yes 01:51:19 simone cargnin: corner 01:51:59 Alessandro vecchi: In order to avoid mistakes I found the first or the ending point of the segment and then start counting from there 01:53:26 Alessandro vecchi: I have to follow the line with recursion 01:53:38 simone cargnin: maybe we can make sets for all the segments with all the cordinates in it 01:53:39 Alessandro vecchi: I have the path to follow 01:55:24 Dario Loi: set counting is what I am using for the homework :/ 01:55:45 simone cargnin: and after we check if the pixel given is in which sets and output the len of sets 01:55:56 simone cargnin: *of set 01:57:07 Alessandro vecchi: Right I was doing it in this way 01:57:36 simone cargnin: what about the pixel in the other verse? 01:59:15 Dario Loi: isn't color manipulation slow? 01:59:24 Davide Marincione: I think it is 01:59:39 Davide Marincione: Also it makes the matrix unusable afterwards 01:59:48 simone cargnin: you can copy it 01:59:58 simone cargnin: and use the copy for manipulation 02:00:10 Davide Marincione: Deep-copy, which is problematic for big images 02:00:17 Davide Loriga: it's supposed to be used as the last part 02:00:32 Davide Loriga: you don't really have to copy, if you do it at the end part of the program 02:00:37 Davide Loriga: which is actually a great idea 02:02:48 Nicholas Tiveron: In the exam it won't matter how long our code takes to run, right? Since there are no tests, I assume 02:04:12 Nicholas Tiveron: So for an exercise like this one we could do something inefficient that still works and our solution would be considered correct 02:07:06 Alessandro vecchi: I don’t get how this solution can work. If I’m checking the four directions and I’m not in a terminal point I’m adding to the set 4 c elements right? 02:07:20 Alessandro vecchi: 4 elements* 02:07:54 Alessandro vecchi: Twe four coordinates of the 2 adjacent points 02:08:13 Alessandro vecchi: Oh okok 02:08:50 Alessandro vecchi: Yes yes but when I wrote the comment there wasn’t the list in the set 02:09:49 simone cargnin: wow 02:10:19 Carlo Giuseppe Tomazzoli: Thank you, bye! 02:10:24 Paolo Gigliesi: Thanks professor, bye! 02:10:26 Nicholas Tiveron: Thank you, bye! 02:10:28 Ginevra Segafredo: Thank you Professor. 02:10:30 Alessio Borgi: Thank you bye 02:10:30 Gabriele Scognamiglio: Thx 02:10:30 Davide Marincione: Thank you, bye! 02:10:32 Dario Loi: thank you! 02:10:32 Franciszek Ciecholewski: thank you bye 02:10:33 Martina Fasiello: thanks, byr 02:10:33 Andrea Caminiti: Bye! 02:10:38 Maria Emilia Russo: thank you, bye!