Config
Log for #openttdcoop.devzone on 26th April 2015:
Times are UTC Toggle Colours
05:31:13  *** Alberth has joined #openttdcoop.devzone
06:49:28  *** LSky` has joined #openttdcoop.devzone
07:16:56  <DevZone> Project eints build #21-push: SUCCESS in 18 sec: https://jenkins.openttdcoop.org/job/eints/21/
07:55:53  *** LSky` has quit IRC
08:25:55  *** frosch123 has joined #openttdcoop.devzone
09:02:58  *** oskari89 has joined #openttdcoop.devzone
09:04:37  <Alberth> I wonder whether we should update bottle in eints to 0.12.8 (latest stable) https://devs.openttd.org/~alberth/1_update_bottle.patch
09:05:30  <Alberth> frosch123: ^
09:06:08  <Alberth> also, I am wandering into getting languages more loosely loadable
09:06:19  <Alberth> did you do anything there already?
09:06:42  <frosch123> nope, all my changes are push
09:06:50  <frosch123> ed
09:07:23  <Alberth> my current idea is to get a deep copy of a language from Project, which you can return later
09:07:33  <Alberth> with the changes automagically checked
09:07:47  <Alberth> when you return the language
09:08:22  <Alberth> once that is running, the step towards actual loading/saving languages can be made
09:08:25  <frosch123> hmm, the bottle update touched the part which i always need to patch to make it work
09:09:24  <Alberth> alternatively, the code could say whether it changed the language when it returns is
09:09:36  <Alberth> which would be cheaper in not copying and not checking
09:09:53  <Alberth> s/is$/it/
09:11:23  <frosch123> does it need to be a copy?
09:11:42  <frosch123> couldn't it also be something that holds the last 5 used languages
09:12:02  <frosch123> and which you tell when you changed something and it needs saving
09:12:19  <Alberth> you're too far
09:12:33  <frosch123> ok :)
09:12:46  <Alberth> a page callback needs a language to make changes, or check things or so
09:13:17  <Alberth> so now it just bluntly pulls pdata.languages[lng]
09:13:41  <Alberth> instead it should do  pdata.get_language(lng)
09:14:03  <Alberth> and afterwards give it back   pdata.give_language(lng)
09:14:17  <Alberth> possibly with a flag 'i modified it'
09:14:54  <Alberth> once that is running, we can see how to not keep languages that we haven't given away :)
09:15:39  <Alberth> obviously, the 'get_language' can give the language object that we have already
09:15:58  <Alberth> but we'd rely on the page callback code to properly tell us changes
09:16:13  <frosch123> so, it's not a new copy, but rather a locking mechanism for accessing it
09:16:23  <frosch123> that makes sure it is present and not freed while used
09:16:52  <Alberth> that's get/give indeed
09:17:07  <Alberth> but I am worried about modification notifications too
09:17:17  <Alberth> so if we give out a deepclone
09:17:34  <Alberth> and check out afterwards, we can verify claims about being modified
09:17:44  <frosch123> well, do you want to make it thread-safe or something? :p
09:18:10  <frosch123> i see the need for an exclusive write-lock, but not for a read lock
09:18:15  <Alberth> or, instead of computing the claim, derive that change in give_language
09:18:58  <Alberth> it's a single process serving pages, isn't it?
09:19:07  <frosch123> yes
09:19:13  <Alberth> or single thread, rather
09:19:26  <frosch123> thus i wonder why you need modification notifications
09:19:39  <Alberth> to know when to save the language
09:19:54  <Alberth> or just save always?
09:20:05  <frosch123> imho just add a flag somewhere
09:20:14  <frosch123> make the edit-strings an upload-string set it
09:20:30  <frosch123> then we can either directly write the file when the flag is set
09:20:39  <frosch123> or somehow delay it
09:20:58  <frosch123> like, only write 5 minutes after the last change, or when it is unloaded
09:21:19  <frosch123> just a GetLanguage, and SetModifed method
09:21:25  <Alberth> don't know if you have timeout things like that
09:22:02  <frosch123> if you want to read something, you only call GetLanguage
09:22:22  <frosch123> if you want to write something, call GetLanguage, modify it in the instance returned, and then call SetModified
09:22:28  <Alberth> indeed
09:22:31  <frosch123> all in one call, so no interruptions
09:23:03  <frosch123> i don't think you need to verify whether something really changed
09:23:22  <Alberth> ah, we can do multiple CallModified, that should make life easier
09:23:25  <frosch123> displaying stuff happens more often that saving an unmodified string again :)
09:23:45  <Alberth> you'd hope so :)
09:23:54  <frosch123> so, we can assume that string-editing and string-upload always modify stuff
09:24:08  <frosch123> no need to compare the data after displaying :p
09:24:45  <Alberth> fair enough
09:25:19  <frosch123> SetModified can save immediately for now, or later we can add some write-delay
09:27:20  <Alberth> I haven't yet figured out how to actually save and load languages, first not bluntly pulling  pdata.languages[name] is required :)
09:28:12  <frosch123> :)
09:29:36  <Alberth> hmm, likely there is some 'project has been modified' code as well, need to find that too
10:47:55  *** oskari89 has quit IRC
11:32:41  *** Supercheese is now known as Guest3222
11:32:45  *** Supercheese has joined #openttdcoop.devzone
11:38:01  *** Guest3222 has quit IRC
11:40:33  *** gelignite has joined #openttdcoop.devzone
13:10:40  <Alberth> frosch123:  https://paste.openttdcoop.org/pdgujgttq   loads all languages, looks like it'd need a 'free' too, right?
13:35:56  <frosch123> that doesn't look like it should really load the languages :p
13:40:30  <Alberth> true, but it does currently
13:42:27  <frosch123> anyway, i would only add a free for write access
13:42:35  <frosch123> otherwise you end up with reference counting
13:42:52  <frosch123> if you do reference counting you do not need to two loops, but would increment/decrement in both cases
13:44:15  <Alberth> the alternative is that the page may give a language back as 'modified' at the time a project has decided to drop that language out of the language cache
13:44:17  <frosch123> i guess using reference counters would mean that languages are only accesses with 'with' and context managers
13:44:42  <frosch123> how long does your 'modifies' state exist?
13:45:04  <frosch123> i kind of assumed it only exists atomically without any other languages being accessed
13:45:54  <Alberth> everything gets written out after each httpd request, afaik (if changed)
13:46:38  <frosch123> like only addnig a bool to get_language, that means that the returned data will be modified immediately, and should be written somewhen
13:46:50  <frosch123> then later some flush() call or so, to really write stuff
13:48:06  <Alberth> sounds like an option
13:48:31  <Alberth> hmm, so what if I add a base language string?
13:49:05  <frosch123> that might need a more special flush :p
13:49:42  <Alberth> well, technically you could delay updating any not available language until first load
13:50:19  <frosch123> so, more like a invalidate_all_translations + flush ?
13:50:36  <frosch123> which marks all languages as needing checked on next load
13:50:44  <frosch123> somewhere in the project data
13:50:47  <Alberth> simply always check on load
13:51:11  <frosch123> ok, but you still need to force-unload all loaded ones :)
13:51:13  <Alberth> (I prefer not having state :) )
13:51:39  <Alberth> or force-update :)
13:56:02  <Alberth> not sure that we have this code, perhaps in the 'upload base language' page somewhere
13:57:09  <frosch123> yes, upload_language_py:127: if is_base:
13:57:51  <frosch123> there is does the outdated for changed, and deletetion of removed
14:01:36  <Alberth> hmm, what if you can only modify the last queried language?
14:02:28  <frosch123> i think that is fine
14:03:06  <frosch123> after calling get_language you have to use the data immediately
14:03:22  <frosch123> it would not be guaranteed to stay valid beyond the next call to get_language
14:03:29  <Alberth> let's try that, no reference counting, no way to make big heaps of languages that needs to stay in cache
14:03:39  <Alberth> much simpler :)
16:48:21  <DevZone> Project 2cc Bus Set build #30-push: STILL FAILING in 7.6 sec: https://jenkins.openttdcoop.org/job/cc-bus-set/30/
16:49:05  <DevZone> Project OpenGFX+ Airports build #69-push: SUCCESS in 1 min 2 sec: https://jenkins.openttdcoop.org/job/airportsplus/69/
16:51:12  <DevZone> Project 2ccts build #452-push: SUCCESS in 2 min 30 sec: https://jenkins.openttdcoop.org/job/2ccts/452/
17:26:47  *** oskari89 has joined #openttdcoop.devzone
18:46:43  <DevZone> Project opengfx-mars build #223-push: SUCCESS in 3 min 40 sec: https://jenkins.openttdcoop.org/job/opengfx-mars/223/
18:46:53  <DevZone> Project Townnames - German build #136-push: SUCCESS in 9.9 sec: https://jenkins.openttdcoop.org/job/german-townnames/136/
18:46:54  <DevZone> Project NML - NewGRF Meta Language build #404-push: SUCCESS in 5 min 32 sec: https://jenkins.openttdcoop.org/job/nml/404/
19:18:44  *** LSky` has joined #openttdcoop.devzone
20:13:57  *** Alberth has left #openttdcoop.devzone
20:26:21  *** gelignite has quit IRC
20:47:27  *** frosch123 has quit IRC
21:06:42  *** oskari89 has quit IRC
21:25:15  *** LSky` has quit IRC
21:32:37  *** tneo has quit IRC
21:32:39  *** tneo has joined #openttdcoop.devzone
22:40:41  *** Taede has quit IRC
22:42:16  *** Taede has joined #openttdcoop.devzone
23:03:18  *** Supercheese has quit IRC
23:25:19  *** Supercheese has joined #openttdcoop.devzone

Powered by YARRSTE version: svn-trunk