[11:44:04] hi zhuyifei1999_ [11:44:49] yes? [11:45:24] I am a little bit stuck [11:45:28] https://gist.github.com/infobliss/e476d38f3e71647496bbff5c9c31e9ba [11:45:37] the commented part works fine [11:45:50] but once using js the image is not getting displayed [11:46:28] document.getElementById("gallery") => nothing [11:46:53] and I must complain about your JS: I can XSS this piece [11:47:46] but why do you want to do it in js? [11:48:09] var list = {{image_list}}; don't assume flask can serialize into json [11:48:18] I have a list of image urls [11:48:53] jinja can help you [11:49:03] which will be generated based on the given searchstring [11:49:16] yeah, use jinja [11:49:24] python data => jinja [11:50:01] ok [11:50:13] why document.getElementById("gallery").innerHTML not working? [11:50:29] do you find any element with ID gallery? [11:50:47] uh [11:50:56] oops I didn't see that one one [11:52:03] now I bet the var list = {{image_list}}; failed [11:52:31] python data != js data unless you serialize into json [11:52:43] then how do I get the list in js which was sent by flask? [11:52:54] why do you have to? [11:52:58] bad practice [11:53:26] if you must, serialize into json as I already said [11:53:43] but if you want to do it better use python's template engine, jinja [11:53:55] or I will be able to XSS you [11:54:26] considering you don't escape html in the attrs [11:54:44] ok [11:56:21] i.e. don't reinvent the wheel [11:56:56] meaning? [11:57:19] https://en.wikipedia.org/wiki/Reinventing_the_wheel [12:00:18] Ok [12:00:27] Using jinja how exactly can I get the image url list in my html for displaying? [12:01:00] http://jinja.pocoo.org/docs/dev/templates/ [14:40:49] jinja templating worked for me thanks :) [14:41:00] :P [14:41:17] In your opinion, is this ok to not have pagination? [14:41:40] hmm [14:41:43] depends [14:42:19] I had done pagination before using php [14:42:37] * zhuyifei1999_ hates php [14:42:48] like for a different project [14:44:52] https://github.com/infobliss/sibutest2/blob/master/templates/index.html#L164 [14:45:34] I added another textbox 'searchstring' [14:46:00] Here now I want to make this field "uuid" required only if searchstring is empty [14:46:38] what's the best way to do that? [14:46:48] in python or js [14:47:50] i.e., do the check only after form is submitted? [14:48:27] ok nice got it [14:48:48] well, if you want to do it in js you should have a better client mvc setup [14:49:10] ok [14:50:09] sort of like v2c [14:50:19] btw, I just took over quarry [14:50:30] https://quarry.wmflabs.org/ [14:52:04] another tool :) [14:52:51] How to know what are the databases and tables? [14:53:23] show databases; duh [14:53:31] show tables; [14:53:55] https://www.mediawiki.org/wiki/Manual:Database_layout [14:54:37] this is what I was looking for :) [14:57:16] this is a very nice tool [14:57:24] I like it a lot [14:57:45] it is. but it is on the edge of being unmaintained [14:57:54] check the commit history [14:58:08] https://github.com/wikimedia/analytics-quarry-web/ [14:58:25] https://github.com/wikimedia/analytics-quarry-web/commits/master [15:11:39] yeah [17:07:06] hi zhuyifei1999_ [17:07:19] yeah? [17:07:52] just a min [17:08:46] https://gist.github.com/infobliss/9e4df5718e08541118adc8cd8bef8068 [17:08:58] https://gist.github.com/infobliss/9e4df5718e08541118adc8cd8bef8068#file-gallery-html-L50 [17:09:10] in this line count is incremented [17:09:24] ? [17:09:35] but I think this increment is not retained in the next iteration of the loop [17:09:52] everytime the checkbox is name selected0 [17:10:02] *named [17:10:20] I can't seem to load https://gist.github.com/infobliss/9e4df5718e08541118adc8cd8bef8068#file-gallery-html-L50 [17:10:27] getting the unicorn [17:10:52] :( [17:10:53] https://usercontent.irccloud-cdn.com/file/dyxn2oey/Screenshot%20from%202017-08-01%2001-10-34.png [17:11:05] I got it a few time [17:11:16] wait [17:12:26] https://codeshare.io/am8X4X [17:12:30] line 50 [17:15:23] yeah? [17:16:33] I think this increment is not retained in the next iteration of the loop. Why so? [17:16:57] all the checkbox are named selected0 [17:17:33] hi [17:17:40] hello basvb [17:17:51] how are you? [17:18:11] good [17:18:23] how is it going? [17:19:15] http://jinja.pocoo.org/docs/dev/templates/#for [17:19:17] so far I can display all the images with checkboxes based on search result [17:19:21] loop.index [17:19:35] you are reinventing the wheel :P [17:19:57] Oh yeah I overlooked :P [17:20:07] thanks a lot [17:20:55] [14:46:00] Here now I want to make this field "uuid" required only if searchstring is empty -> uuid is glam specific [17:20:59] identifier is general [17:21:17] ok [17:21:17] I honestly don't know why your method didn't work. I don't place much logic in templates [17:21:27] so no set [17:21:48] [14:50:19] btw, I just took over quarry -> you are now the one maintaining it zhuyifei1999_ ? [17:22:07] basvb: yuvi gave up months ago [17:22:20] I don't know these things behind the scenes [17:22:25] I've made some good use of that tool [17:22:42] he gave me gerrit +2 and sudo on the hosts yesterday [17:23:06] I know half what that means ;) [17:23:16] well maybe three quarters [17:23:34] what's the last quarter? [17:24:14] I know sudo means you're admin and +2 is accepting commits I think, the last quarter is the implications of that [17:24:39] yeah kind of [17:25:21] few will actually commit or review, so yuvi said just self-+2 [17:27:15] brb ~10 mins [17:28:17] but it mainly entails the front-end + communication between front-end and database api? [17:28:25] or also maintaining databases? [17:28:49] not the replica [17:29:08] I mean those databases like enwiki_p [17:30:04] but there's a quarry-local mariadb database that stores all the queries, users, stars, etc. and many sqlites that stores all the query results [17:31:48] feel free to look into the code and/or contribute :) https://github.com/wikimedia/analytics-quarry-web/ [17:32:28] I'm more a data user than a data base maintainer :) [17:33:02] it's okay, we don't maintain the replicas [17:33:20] they are for people like jynus, volans [17:33:32] don't know them [17:34:10] https://phabricator.wikimedia.org/project/profile/1060/ [17:37:00] ok let me see if I can finish the AM mapping [17:37:29] have you completed and committed the generalGLAM skeleton functions? [17:38:30] (as I'll have to change my code a bit to fit into the new structure) [17:38:54] zhuyifei1999_: I'm doubting a bit on what to do with licenses [17:39:13] the GLAM just released everything with a public domain license [17:39:26] they don't separate between photo and art work license [17:40:06] pd-old vs pd-author vs cc-0 [17:40:08] and I know that they sometimes simply can't have the rights over the art work (and thus release it) [17:40:24] so no pd-author [17:40:27] yep I can check for art-license the death date of the author [17:40:38] for photo-license it will be cc-0 [17:41:01] have to check whether they explictly mention that, and maybe send some emails with their legal department [17:41:09] and back [17:41:29] "Alle objectbeschrijvingen (metadata) worden onder CC0 beschikbaar gesteld en de afbeeldingen (content) zijn Publiek Domein." [17:41:33] all metadata is cc0 [17:41:38] all content is public domain [17:41:41] that's what they say [17:42:07] so then for the photo's it's pd-author I guess [17:42:24] if they don [17:43:03] if they aren't the copyright holder they can't say it's PD because "released by copyright holder" [17:43:24] they are likely the copyright holder on the photographic reproduction (if a 3d work) [17:43:25] it's like you buy a book and say it's PD [17:43:39] the art work licenses are the real issue [17:44:01] that's why just uploading everything is not an option and users need to check whether the work is truly free [17:44:15] photographic reproductions of 3d objects are DW of the original objects' [17:44:23] not in the netherlands [17:44:27] they are copyrighted [17:44:36] huh? [17:44:54] if I take a picture of a 3d object then I can claim copyright over the picture [17:45:02] if I take a picture of a 2d object then I can not claim it [17:45:21] argh I hate country-local weird laws [17:45:35] I think this is pretty common in the EU at least [17:47:05] maybe I'm misinterpreting you (or other way around) [17:47:34] dw has new copyright, so where I said not DW I was incorrect [17:47:40] they are dw, but copyrighted [17:48:05] unless it is a painting and it is a pure reproduction, without creative decision, then it is not copyrighted [17:48:31] but no issue here, since the museum (very likely) holds the dw (picture) copyrights [17:49:08] I mean you can't say a thing is PD unless both the original object and "creativity" of the DW is PD [17:50:26] there are two licenses in the art photo template [17:51:16] the photo license = (likely) ok as pd-author or cc0 [17:51:26] pd-author fits best [17:51:44] the artwork license = could be an issue [17:52:00] for some cases it's clearly pd-old (we know the maker date of death) [17:52:19] for some cases it's clearly not ok -> anonymous recent work [17:52:33] and for some cases it needs some thinking [17:53:17] I give up. I'm not Revent [17:53:25] he knows everything [17:53:55] I know a bit of the (EU) copyright myself, but always good to discuss [17:54:35] Did a course on european cyber law (privacy and copyright as focus) [17:56:04] has EU the same laws in across countries? [17:56:30] they have EU law which the countries have to adopt [17:56:35] on this they look a lot alike [17:56:43] but in general the answer is no [17:56:55] hmm [17:59:18] aah looks like it isn't as bad as I thought [17:59:23] http://am.adlibhosting.com/amonline/Details/collect/54639 [17:59:38] http://am.adlibhosting.com/amonline/details/collect/5782 [17:59:54] they say: "alle rechten voorbehouden" which basicly means: all rights reserved [18:00:55] For NA glam https://ibb.co/fRLvpk is how it is looking like right now. [18:01:35] maybe go for a max height [18:01:45] in the thumbs you grab [18:01:59] +1 [18:02:14] you can also ask the thumb creator to create borders for you [18:02:15] forgot how that is called [18:02:16] too much whitespace [18:02:35] but for the rest pretty good start [18:02:47] maybe show the title of the work as well [18:03:03] I still think there are too many colors [18:03:10] like I said ages ago [18:04:13] Yep we discussed that, good thing to fix when you;re stuck on something and there is nothing to do. not a priority in my opinion [18:04:28] I did use only 2 shades of blue [18:04:42] previously there were >3 [18:05:20] I see at least 3 [18:05:43] inter-image white space is due to the various shapes of the images [18:05:59] then make it square [18:06:02] I can force them to be of the same width and height [18:06:11] I'm pretty sure there's a CSS for this [18:06:20] but that severely changes the visual [18:06:28] ... [18:06:45] since the original images have different aspect ratio [18:06:55] the api can return square images [18:07:07] sec [18:07:14] at least the amsteradm museum api can [18:07:19] I worked on CSS a year ago [18:07:29] some are square, portrait, landscape [18:07:35] how are you retrieving these images infobliss? [18:07:51] yes but we've to use 1 size [18:08:21] [18:08:25] we discussed this a week ago the thumbnail api from amsterdam museum, how do you do it for nationaal archive [18:08:31] where file is the image url [18:08:42] that's how you show them, not how you retrieve them [18:09:21] wait a min [18:10:03] http://neon.pictura-hosting.nl/naa/naa_mrx_bld/thumbs/188x188/sfa/00/SFA_076/SFA001018838.jpg [18:10:04] https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit [18:10:08] infobliss: ^ [18:10:11] they get them from there at the nationaal archief [18:10:20] maybe you can reuse that, then thumbing is done for you [18:10:32] also, href={{file}} <= quote it [18:10:40] https://codeshare.io/axenKP [18:10:45] although that service is not as good as the api from amsterdam museum [18:10:48] ok [18:11:15] without quote works fine though [18:11:24] * zhuyifei1999_ don't like the new MDN design [18:12:00] ok [18:12:28] we discussed the 10000x10000 this weekend [18:12:43] if they change their default size to 12000x12000 everything will fail [18:13:02] why? [18:14:25] In the code If 10000x10000 is not found then we are taking the first available thumb [18:15:54] do you have a link to the source/json for me? [18:15:59] so I can check something in it [18:16:06] of a random file [18:16:17] basvb, zhuyifei1999_ : do you suggest making all images square? [18:16:22] yes [18:16:30] but don't stretch them [18:18:13] http://www.gahetna.nl/beeldbank-api/opensearch/?q=nederlandse%20kampioenschappen%20dammen [18:18:40] the first is often not the largest [18:18:47] it's easy to write code to find the largest [18:18:52] should be doable in 30 minutes [18:19:07] close to square [18:19:48] ok [18:19:52] regex: "firstparturl/(\d+)x\d+/image.jpg [18:20:18] that catches the numbers in the first group (between brackets ()) [18:20:28] and then you can check which of them is the largest [18:20:49] ok thanks [18:21:01] I am not good with python regex [18:21:08] this helps [18:21:15] it's the same as perl-regex [18:21:23] use https://regex101.com/#python [18:21:44] I am perl-0 [18:22:00] if you can do regex in one language it looks almost the same in another [18:22:16] it's more about the logic behind it than the exact syntax, that's easy to look up [18:22:44] regex is awesome [18:23:10] simplifies many lines into one or two lines [18:23:25] indeed [18:23:25] most of my edits on commons are regex search and replaces [18:23:38] I cleaned up thousands of files that way [18:24:41] basvb: how exactly do you do regex search? [18:25:02] in python? [18:25:22] https://docs.python.org/2/library/re.html [18:25:42] ost of my edits on commons are regex search and replaces [18:25:46] sorry [18:26:06] re.match or re.search [18:26:21] most of my edits on commons are regex search and replaces <= how do you regex search in commons? [18:26:33] VFC? [18:27:02] yep [18:27:05] with a tool [18:27:08] visualfilechange [18:27:15] I hacked the tool a bit [18:27:21] to show me thousands of images [18:27:23] not optimal [18:27:42] rillke's tool [18:27:54] very complex [18:28:09] I still miss rillke [18:28:09] easy to use and very powerful [18:28:20] yeah [18:28:32] but difficult to code [18:28:39] ow I didn;'t know rillke was gone (although I never really look who does what on commons) [18:28:55] I don't try to remember names, to stay out of conflicts [18:29:26] took me a few hours to implement the page list from search query in vfc [18:29:27] makes it easier to treat every interaction without any prejudice based on earlier interactions [18:29:46] that's difficult [18:30:11] I remember a lot of names, unintentionally [18:30:26] (and I get biased :P) [18:30:34] Yep, well on nlwiki I have the same, a lot of unintentional prejudice [18:30:48] I looked to much at some persons and their actions and conflicts [18:30:57] on commons I tried not to do that and it worked really well [18:31:22] well, one thing: ignore an/u [18:31:40] I ignore almost everything ;) [18:31:40] Any of you went to Wikimania ever? [18:31:43] yes me [18:31:45] last year [18:31:47] not me [18:32:01] wow nice :) [18:32:07] I was a month too late for wikimania 2013 [18:32:17] was that local? [18:32:23] other times, too far away [18:32:35] wikimania 2013 is in hong kong [18:32:42] well you could ask for a scholarship zhuyifei [18:32:45] I went there for a trip in august [18:32:52] and weren't you going to US this year? [18:33:02] *aren't [18:33:04] yeah later in august [18:33:12] this year is Canada right? [18:33:14] ok because canada/us a bit close [18:33:18] yep [18:33:31] well last year I went because it was Italy, I'm not so much a world traveler [18:33:36] especially not for 1 week only [18:34:06] It was very nice to meet all the people [18:34:24] but I felt a lot of people already know each other very well, and my international network is not that large [18:35:17] there is also people who aren't regular contributors, it's an interesting mix [18:35:18] Are you a member of Wikimedia Netherlands? [18:35:35] yes, but I don't do a lot with that [18:35:58] what is the criteria to get funding for travel? [18:36:12] depends, there are a lot of people who want to go [18:36:41] they select from that pool [18:36:49] last year I got a scholarship from wikimedia foundation [18:36:59] I think they had 50-100 scholarships [18:37:08] for all of the world [18:37:36] you have been contributing for so long [18:37:45] thousands of people have [18:38:22] great job [18:38:42] but long doesn't say everything [18:38:50] I'm not that active as in 2008-2010 [18:38:58] back then I edited hours a day [18:39:09] I think like zhuyifei1999_ does now :) [18:39:21] now I'm often not around for a month [18:39:30] and then am active for a few days again [18:40:00] I see [18:40:28] I go on and off [18:40:43] you seem pretty on right now :P [18:40:48] yeah [18:40:57] but not a year ago [18:41:11] but two years ago I was pretty on [18:41:18] but on the Dutch wiki I've done a lot in the past, now I moved a bit more to commons [18:41:29] I also try to do projects I learn something from [18:41:42] so am no longer simply editing articles that much [18:41:57] but prefer to do something like building a tool or trying to do some machine learning [18:42:15] basvb : Do you also know machine learning stuff? [18:42:36] Yes I got my masters of science in machine learning/data scien [18:42:37] ce [18:43:03] and work with that in my day job [18:43:14] great thing [18:43:20] fraud prediction, chatbot, speech analytics, image recognition [18:43:23] people here are crazy about ML [18:43:30] lol [18:43:50] here as well, but not sure whether all of that is always waranted [18:44:13] literally if you say there is a talk on ML, the auditorium will be overcrowded [18:44:31] do you solve problems in kaggle? [18:44:42] I've done in the past [18:44:50] but it's not the best place to learn [18:45:01] because you only look at optimizing models [18:45:16] while it is much more important to understand the problem, clean the data and sell the solution [18:45:32] optimizing models is less than 10% of the data science work [18:45:57] often it is more important to build a working system then optimizing the model for a slightly better performance [18:46:29] + explainability of the models is important, and kaggle has mostly very complicated models [18:46:50] Do you suggest learning from Andrew Ng's course? [18:47:00] yes, it's a good course [18:47:11] I suggest to learn by doing your own projects [18:47:30] if you really want to know something [18:47:38] for example if you want to do image classification [18:47:57] it would be far more interesting to build something to classify images on commons than to do a kaggle competition [18:48:10] because then you get all issues like in a normal project [18:48:54] That's very rightly said [18:49:04] Ok, I have to think a bit on what to do for the licenses exactly [18:49:11] so the AM won't be finished today [18:49:11] ok [18:49:15] see you [18:49:20] we can't use the script without good licenses [18:49:28] ow I'll be here, but will continue the coding later [18:49:40] oh ok my bad [18:50:26] I thought you wish to not talk off topic now [18:50:46] no problem [18:51:00] I'll do the thinking tomorrow, sleep a night on it [18:51:25] done with coding/working, going to watch some movie last 2 hours of the day ;) [18:51:57] are you in the final year of your studies infobliss ? [18:52:11] I have another year to go [18:52:24] for completion of my MS [18:52:54] what do you plan to do after completing ms?/ [18:53:08] I will do some job probably [18:53:17] We have a big IT industry [18:53:42] so as a developer likely? [18:53:48] most likely [18:53:56] I like teaching as well [18:54:42] but for sure I don't like getting up early ;) [18:55:37] well if you work with europe you can get up late [18:55:58] you mean work remotely? [18:56:14] like I am doing in GSoC [18:56:24] yeah that's right [19:54:45] good night