[12:39:35] hi infobliss [12:39:37] how is it going [12:51:24] hi [12:51:31] it's going good. [12:51:49] I have done folder restructuring and removed unnecessary files [12:52:05] moved GenericGLAM.py to libraries folder as well [12:53:12] basvb : I wonder where will new GLAM classes be placed in the folder hierarchy. What do you think? [12:53:36] * zhuyifei1999_ thinks when can we move on to get rid of this sibu**test** [12:53:56] if they are glam classes, glams/ [12:54:09] or mappings [12:54:27] i.e., in a separate folder called 'glams'? [12:54:42] mappings is not very self-explanatory imo [12:54:48] glam_mappings [12:54:49] a dict is also a mapping [12:54:58] true [12:55:11] glam_mappings is okay but don't you find "mappings" redundant? [12:55:13] glams is an option as well, but I'd like it to explain a bit more what it is about exactly [12:55:15] basvb: in the already existing folder? [12:55:36] we don't have glam_api, glam_definition, glam_blah, glam_blah, etc. [12:55:49] glams can also work [12:56:14] currently the folder is called glam_mappings [12:56:23] that was serving this purpose [12:56:26] * zhuyifei1999_ meh [12:56:54] ok Glam_mappings needs to be renamed to glams [12:57:55] infobliss: btw, if you are using tools-login, you might want to switch to tools-dev [12:58:14] ? [12:58:23] the IO on tools-login is very high right now due to someone improperly using the host [12:58:43] ok [12:59:02] you login to tool labs by sshing to tools-login.wmflabs.org or login.tools.wmflabs.org right? [12:59:08] change login to dev [12:59:36] ok [13:00:10] working locally till now [13:00:16] k [13:01:13] how to rename sibutest in toollabs? [13:01:29] how to get the url? [13:01:38] you can't. just create a new tool [13:01:50] ok [13:02:16] even deleting a tool doesn't usually happen [13:02:34] whyso? [13:03:48] https://phabricator.wikimedia.org/T133777 [13:04:06] cuz nobody knows if they will cause issues [13:04:19] I mean tool deletion [13:04:26] k [13:05:09] sibu was also created by Kevin [13:06:57] * zhuyifei1999_ brb in ~30 mins [14:05:10] back [14:36:56] I'm off, hope to be here this evening, not 100% sure what time I can make it [14:37:24] you've started on the next tasks we discussed yesterday infobliss? As I think the 1 hour restructuring should be done by now [16:16:16] yeah I have written the generic functions [16:16:58] hope to finish other things by the time we meet at 18:00 UTC [16:58:49] hi zhuyifei1999_ [16:58:59] yes? [16:59:23] suppose 10 images are displayed as thumbnails [16:59:37] and for each image there is a checkbox [17:00:25] How am I going to handle the checkbox responses, i.e., checked or unchecked? [17:00:36] Will it be like a form? [17:00:48] you need a form unless you are doing ajax [17:01:09] * zhuyifei1999_ prefers ajax of course :) [17:01:24] ok [17:01:43] so each image will have to indexed as well [17:01:46] right? [17:02:03] what do you mean by indexed? [17:02:57] how do I associate a checkbox to a particular image? [17:03:48] please elaborate the context of "how" [17:03:59] ok [17:04:54] so is it going to be just based on the visual layout of the images? [17:05:08] i.e., which checkbox is below which image in the page [17:05:16] for the user, yes [17:05:36] that's intuition right? [17:05:40] so my checkboxes are numbered [17:05:54] so as the individual image positions in the layout [17:06:32] make the checkboxes close to the images / thumbnails [17:06:42] yeah right [17:07:01] say there are 10 images that fit at a time in the page [17:07:21] these 10 positions are going to be reused everytime [17:07:34] i.e., different images will occupy these 10 positions [17:08:01] sure [17:08:02] I have to be able to map the images to the positions [17:08:09] everytime [17:08:32] what do you mean by "map the images to the positions"? [17:08:50] suppose [17:09:04] the searchstring gave 100 result images [17:09:11] yes [17:09:15] I display 10 images [17:09:26] user checks 4 of these images [17:09:44] next he goes to the next page and I show the next 10 images [17:10:18] yeah and? [17:10:43] that time there is a change of mapping of the images to the positions [17:10:58] and that needs to be handled [17:11:25] you can store the choices in session [17:11:38] or browser if with ajax :) [17:12:17] ok [17:12:56] for each image there is a corresponding data 'IsChosen' [17:13:29] where is 'IsChosen'? [17:13:42] * zhuyifei1999_ brb for ~15 mins [17:13:47] ok [17:14:12] also, some code is worth a thousand words [17:14:23] please point me to the code if available [17:14:42] ok [17:24:41] back [17:26:00] so where is 'IsChosen'? [17:27:40] I mean every image is either chosen or not chosen [17:27:50] yeah [17:28:37] so is that info to be kept along with the image or by some indexing of images? [17:29:20] I really don't understand what you are asking. Can you show me the code? [17:29:32] lol [17:29:38] my bad [17:30:03] I am yet to decide on how the approach of saving the information will be [17:30:18] the code is not in place [17:30:27] you save the /unique identifiers/ of the images [17:31:23] a lsit? [17:31:27] *list [17:31:38] ? [17:32:00] save the /unique identifiers/ in a list? [17:32:14] sure [17:32:28] you could also use any other container [17:33:03] k [17:33:27] if you are storing it on server side, use session [17:34:16] ok [18:15:39] hi zhuyifei1999_ [18:15:51] I have been watching AJAX tutorials [18:16:34] I learnt that it is in most cases (if not all) used to load data on the fly. [18:16:42] by the browser [18:16:51] yeah [18:16:59] you saw how v2c works? [18:17:11] it's single page application [18:17:35] Ok I did not know [18:17:54] well you said you used v2c right? [18:18:02] yes I did [18:18:39] didn't you find the address bar never changes? [18:19:12] yeah of course [18:19:19] I was wondering why [18:19:28] that's what you mean by single page [18:19:40] well yeah it's (ajax and websocket)-based [18:20:13] but I imagine that will be a challenge for you [18:20:27] so I don't require it for this project [18:20:32] so in our case here, the images will be loaded on the fly [18:20:43] although it would be bonus points [18:20:56] image has to be loaded on the fly [18:21:02] it's not ajax [18:21:52] well it can be done with ajax, but that's extra cruft [18:22:13] so you are for an html form submit kind of thing [18:22:38] I don't like html form submit too much [18:23:00] but idk if you can do otherwise [18:23:14] what are the alternatives? [18:23:20] I can learn and implement [18:23:35] ajax and/or websockets [18:23:41] and tons of JS [18:24:31] Is it fine to use ajax for this part only? [18:25:04] I mean for the part when user chooses from given thumbnails [18:25:05] I don't find the benefit [18:25:40] what is the benefit in v2c? [18:25:54] I mean using ajax what is the benefit there? [18:27:08] fashion, speed, and less redundancy [18:27:55] ok [18:27:57] fashion: self-explanatory. also improves usability a bit [18:28:36] speed: the static htmls are cached by browser. the JS fills all the data [18:29:20] less redundancy: the client essentially interacts with an API that a bot may also use. [18:30:03] ok that's nice [18:30:14] I don't have to implement both an html-based api and a json-based api [18:30:48] mediawiki has both. html based is index.php, json-based is api.php [18:30:53] ^cruft [18:31:14] that's nice [18:32:01] If my options are limited to html forms only [18:32:14] the downside is: the server cannot freely pass arbitrary htmls [18:32:25] yeah? [18:32:38] Do you see major disadvantages for the tool? [18:33:14] the largest disadvantage is: not fashionable :P [18:33:37] you don't have to implement a json-based api [18:34:27] oh and another reason why I use ajax is that it's async [18:34:54] async means? [18:35:18] asynchronous [18:35:40] No I knew that [18:35:47] ? [18:36:48] got it [18:36:55] just googled [18:38:11] "Asynchronous means that the script will send a request to the server, and continue it's execution without waiting for the reply. As soon as reply is received a browser event is fired, which in turn allows the script to execute associated actions." [18:38:29] yeah [18:38:48] you can't do it with basic html forms [18:39:35] so if there are large files for upload resulting in long waiting time for the user how will AJAX deal with this scenario? [18:40:10] depends on whether the upload is async on server side [18:40:25] it should be :) [18:41:24] if it is, like v2c, when a task is submitted the ajax will return and tell the user to wait [18:41:30] uh [18:41:42] if it is, like v2c, when a task is submitted the ajax shall tell the server to start it [18:41:53] the server then starts the task and returns [18:42:08] the ajax then returns and tells the user to wait [18:42:38] graceful [18:42:40] it then poll for the status from the server until the server says the task is done [18:42:59] ok [18:43:30] (or like v2c the server can /tell/ the client that the task is done via pushing in websockets [18:43:51] https://en.wikipedia.org/wiki/Push_technology [18:44:12] like push notifications in apps [18:44:22] sort of [18:45:48] https://commons.wikimedia.org/wiki/User_talk:Prolineserver#Showing_the_status_of_conversion. is what happens when it's not properly async [18:46:08] quote "I dare not turn my browser off or refresh it now, yet the only way to see the conversion status is to do just that" [18:46:21] bad tool :P [18:47:21] Oh this is a possibility [18:47:30] that tool is submit jobs via ajax, but it neither poll nor push status [18:47:34] applies to video uploads [18:48:32] but the jobs are async on server side [18:49:27] still there is the loss of progress on refreshing [18:49:50] meh bad coding [18:50:10] the stuff is in php, full of cruft and hacks [18:50:37] and... the tool author didn't even open source... [18:51:08] :) [18:51:56] https://commons.wikimedia.org/wiki/User_talk:Prolineserver#Commons_Video_Converter [18:52:08] he's helpless [18:52:17] or she [18:53:07] yes [18:54:26] ok I will try to give you the code using html forms tomorrow [18:54:40] k [18:54:44] so that you may suggest further improvements [18:55:37] good night [18:55:51] g'night [20:02:13] hi, guess I'm a bit too late, sorry couldn't make it [20:20:58] I see you've cleaned the folders a bit, nice [20:21:15] can you please import the generic functions you wrote for genericglam [20:21:29] commit I mean where I say import [20:22:01] Also I suspect https://github.com/infobliss/sibutest2/blob/master/glams/NationaalArchiefGLAM.py#L19 is now broken [21:43:12] Just a little reminder for myself tomorrow. I found a nice way to search the values of variables in the adlib databases [21:43:12] http://amdata.adlibsoft.com/wwwopac.ashx?command=facets&database=AMcollect&search=all&facet=acquisition.method&limit=50&output=json [21:43:28] also doc-site:http://api.adlibsoft.com/site/api/functions/facets