*** tpb has joined #melange | 00:00 | |
-lindbohm.freenode.net- [freenode-info] if you're at a conference and other people are having trouble connecting, please mention it to staff: http://freenode.net/faq.shtml#gettinghelp | 00:00 | |
*** tansell-laptop has joined #melange | 01:49 | |
*** sttwister has quit IRC | 03:07 | |
*** lresende has joined #melange | 03:40 | |
*** mithro has joined #melange | 04:35 | |
*** ChanServ sets mode: +v mithro | 04:35 | |
*** mithro has quit IRC | 04:40 | |
*** mithro has joined #melange | 04:54 | |
*** ChanServ sets mode: +v mithro | 04:54 | |
*** sttwister has joined #melange | 07:41 | |
*** madrazr has joined #melange | 08:13 | |
*** ChanServ sets mode: +v madrazr | 08:13 | |
*** MatthewWilkes has joined #melange | 09:04 | |
*** sttwister has quit IRC | 09:10 | |
*** madrazr has quit IRC | 09:55 | |
*** sttwister has joined #melange | 09:57 | |
*** arun_ has joined #melange | 10:11 | |
*** Leo___ has joined #melange | 11:46 | |
*** Merio has joined #melange | 12:21 | |
*** ChanServ sets mode: +v Merio | 12:21 | |
*** Merio has quit IRC | 13:27 | |
*** Leo___ has quit IRC | 13:29 | |
*** Merio has joined #melange | 13:29 | |
*** ChanServ sets mode: +v Merio | 13:29 | |
*** Leo___ has joined #melange | 14:22 | |
*** Leo___ has quit IRC | 14:45 | |
*** madrazr has joined #melange | 15:37 | |
*** ChanServ sets mode: +v madrazr | 15:37 | |
*** lresende has quit IRC | 15:43 | |
*** madrazr has quit IRC | 15:43 | |
*** Merio has quit IRC | 16:16 | |
*** sttwister has quit IRC | 16:33 | |
*** Leo___ has joined #melange | 16:46 | |
*** sttwister has joined #melange | 17:14 | |
*** Merio has joined #melange | 17:33 | |
*** ChanServ sets mode: +v Merio | 17:33 | |
*** sttwister has quit IRC | 17:47 | |
*** sttwister has joined #melange | 17:59 | |
*** dhaun has joined #melange | 18:06 | |
*** sttwister has quit IRC | 19:24 | |
*** sttwister has joined #melange | 19:26 | |
Merio | sttwister: ping :) | 19:39 |
---|---|---|
sttwister | Merio: pong | 19:40 |
sttwister | Merio: so, what first ? | 19:41 |
Merio | So, I'm sorry but I remembered that there was some view without a model connected in the statistics module repository :) | 19:42 |
Merio | Seems like it's not the case | 19:42 |
sttwister | I didn't seem to find if that's the case | 19:42 |
Merio | Maybe I found a workaround during GSoC as it's not probable that I've done something hackish with python at all | 19:43 |
sttwister | Well, there should be proper support for this in Melange in the future | 19:44 |
sttwister | So some refactoring can't hurt | 19:44 |
Merio | Yes I'm all for it | 19:44 |
Merio | So, what about your JSON? | 19:45 |
sttwister | well, in the current form it might seem a bit big | 19:46 |
sttwister | 272K | 19:46 |
Merio | I'm asking you some info because I really had no time (for obvious reasons) this week to review anything | 19:46 |
sttwister | do you think it's big or is it acceptable ? | 19:46 |
Merio | I think it could be acceptable, as it's something loaded only once during the startup | 19:47 |
Merio | going to open it to review it in depth | 19:48 |
sttwister | ok | 19:48 |
sttwister | I just commited a change to do some pretty indented output | 19:48 |
sttwister | I'm going to deploy it to appspot now | 19:48 |
Merio | oh that's good :D | 19:49 |
Merio | waiting for it then ^_^ | 19:49 |
*** Leo___ has quit IRC | 19:49 | |
sttwister | in progress... | 19:50 |
sttwister | ready | 19:51 |
sttwister | view-source:http://sttwister-melange.appspot.com/seeder/get_data | 19:51 |
tpb | <http://ln-s.net/79hg> (at sttwister-melange.appspot.com) | 19:51 |
Merio | great | 19:51 |
sttwister | 15k lines, heh :) | 19:53 |
Merio | wow huge :) | 19:53 |
Merio | 16K here :) | 19:53 |
sttwister | oh yea, 16k, my bad :) | 19:53 |
Merio | multiple country list is a pain ^_^ | 19:54 |
sttwister | one other solution is to remove the choices option | 19:54 |
sttwister | and add a new country data provider | 19:55 |
Merio | If it makes sense to make special distributions about countries than it could be good | 19:55 |
Merio | But doing it only for the JSON dimension no :) | 19:55 |
Merio | Maybe some special distribution like "only one continent" or something like this | 19:56 |
Merio | I don't want to overengineer though | 19:56 |
sttwister | Well, this is somehow achievable by using a random string provider and passing a list of countries as parameters | 19:57 |
sttwister | You see, this is very flexible, it's just takes a bit of configuring by the user | 19:57 |
Merio | Good good | 19:58 |
sttwister | so... reducing the JSON size would add more complexity to the client-side | 19:59 |
sttwister | do you think it's worth the effort ? | 19:59 |
Merio | (I'm reading here and there this is the reason why I'm slow to write :)) | 19:59 |
sttwister | ok :) | 20:00 |
Merio | nope doesn't worth it | 20:00 |
sttwister | just a sec, I'm doing a quick prototype to see how much it would reduce the size | 20:01 |
Merio | ok | 20:01 |
Merio | However I like it | 20:01 |
sttwister | so, it's 4.8k lines without including redundant properties | 20:02 |
Merio | what do you mean by "redundant properties"? | 20:03 |
sttwister | I mean those already declared in base models | 20:03 |
sttwister | country list still appears 14 times in this version also | 20:04 |
sttwister | vs 34 times in the first version | 20:04 |
Merio | well, given that you have to handle inheritance anyway | 20:04 |
Merio | This is waaaay better :) | 20:05 |
Merio | Once you know which is the parent object it's easy to join them in Javascript | 20:05 |
sttwister | yes, perhaps | 20:05 |
sttwister | also, it might be nice to indicate in the web interface which model the property actually belongs to | 20:06 |
Merio | what do you mean? | 20:08 |
sttwister | like if I want to seed students, it would be nice to point out which properties are inherited from Role for example, and which properties are student-specific | 20:09 |
Merio | yup agree | 20:09 |
sttwister | ok then, anything else regarding the JSON ? | 20:11 |
Merio | About the web interface I would like to have more infos | 20:11 |
Merio | about the JSON I think excluding inherited properties it's fine | 20:12 |
Merio | Complicates a bit the Javascript side but still you've to deal with that complication anyway :) | 20:12 |
sttwister | yep, well problem no. 1... I'm a JS noob :) | 20:13 |
sttwister | so I'd like you to point out firstly what libraries should I use | 20:13 |
sttwister | (like using jQuery for the AJAX ? ) | 20:13 |
sttwister | and maybe the JS Linq thingy | 20:14 |
Merio | Well, we're using jQuery pretty much for everything | 20:15 |
Merio | JSLinq is easy once you try some stuff in the website | 20:15 |
sttwister | ok... anything else you think I might find useful ? | 20:16 |
Merio | it's something to query a JSON using a sort of query language instead of iterating on it | 20:16 |
Merio | The best source to learn about the "advanced basics" of Javascript | 20:17 |
Merio | just a moment need to find the link :) | 20:17 |
sttwister | ok, I see jLinq is already included in Melange | 20:19 |
Merio | http://jsninja.com/Overview | 20:19 |
tpb | Title: Overview - Secrets of the JavaScript Ninja (at jsninja.com) | 20:19 |
Merio | yes it is | 20:19 |
sttwister | cool, thanks | 20:19 |
Merio | You can find many stuff about basic javascript in the web | 20:20 |
Merio | But no other source I've found explains really how Javascript works :) | 20:20 |
sttwister | nice, I'll have a look at it right away | 20:20 |
sttwister | which brings me to my second questions.. what's the right way to inform Melange which JS libraries should be included for a given template | 20:20 |
Merio | (praise to John Resig ;)) | 20:21 |
Merio | Actually this is not something that really works right now | 20:22 |
Merio | I've found some libraries but need to find some time for JS refactoring | 20:22 |
Merio | However | 20:22 |
Merio | if you need something "global" | 20:24 |
Merio | you can add an if switch in the base template | 20:24 |
Merio | like | 20:24 |
Merio | http://code.google.com/p/soc/source/browse/app/soc/templates/soc/base.html#109 | 20:24 |
tpb | <http://ln-s.net/79il> (at code.google.com) | 20:24 |
Merio | adding a new param here | 20:25 |
Merio | http://code.google.com/p/soc/source/browse/app/soc/views/helper/params.py#54 | 20:25 |
tpb | <http://ln-s.net/79in> (at code.google.com) | 20:25 |
*** Leo___ has joined #melange | 20:25 | |
sttwister | so I should add an entry like melangeseeder | 20:26 |
sttwister | and a coresponding .js file for it | 20:26 |
Merio | This is something that needs to be refined. I would prefer something handled by JS instead of something hardcoded in Python, unless we find some way to deal with dependencies between scripts in a nice way | 20:26 |
Merio | well not quite, maybe it's better if you create a new "package" for it, following something I've built last year | 20:26 |
Merio | Let me explain | 20:26 |
Merio | you can see in soc/content/js that there are some JS files in the form of melange.* | 20:27 |
sttwister | yep | 20:28 |
Merio | Ok so this is some kind of attempt to rationalize our javascript files, still work in progress :) | 20:28 |
Merio | The main problem with javascript is namespace pollution | 20:29 |
Merio | So if a script declares something like "var one = 1" | 20:29 |
Merio | and another declares "var one = 2" | 20:30 |
Merio | and they're included in the same page | 20:30 |
Merio | then they're writing on the same variable, which is "window.one" | 20:30 |
sttwister | so you'd need to create a new namespace for each "package", right ? | 20:32 |
sttwister | via function(), is that correct ? | 20:32 |
Merio | give or take, yes. | 20:34 |
Merio | So it's sensible that everything needed by melange is something like melange.something | 20:34 |
Merio | And that everything you need for the data seeder is in something like melange.seeder or whatever you want | 20:34 |
Merio | the construct is (function(){}()) | 20:35 |
sttwister | ok, so I'd create a new melange.seeder-????.js | 20:35 |
Merio | which is something that you can find explained in depth in jsninja wiki pages | 20:35 |
Merio | http://jsninja.com/Closures#.28function.28.29.7B.7D.29.28.29 | 20:35 |
tpb | <http://ln-s.net/79j7> (at jsninja.com) | 20:35 |
sttwister | and define a new melange.seeder namespace ? | 20:36 |
Merio | basically yes | 20:36 |
Merio | But since | 20:36 |
Merio | melange.js is loaded in the base view | 20:36 |
Merio | than you've already some facilities and you don't have to think about it too much | 20:36 |
Merio | At least if you're using the base template | 20:37 |
Merio | Don't know if you're going to use it or not | 20:37 |
sttwister | is there any reason not to use it ? | 20:37 |
Merio | don't know, the old data seeder didn't use it, nor the html page that you can find in content/seed_db.html | 20:38 |
sttwister | I guess I'll use it | 20:39 |
Merio | However this is not a problem | 20:40 |
sttwister | just for blending in with the rest of the interface | 20:40 |
Merio | As you can include the javascript files anyway :) | 20:40 |
Merio | so, for the skeleton of your javascript file | 20:40 |
Merio | you can see | 20:41 |
Merio | http://code.google.com/p/soc/source/browse/app/soc/content/js/melange.tooltip-100204.js | 20:41 |
tpb | <http://ln-s.net/79jG> (at code.google.com) | 20:41 |
Merio | just use lines 1-43 and 102 | 20:41 |
Merio | (using for example seeder instead of tooltip) | 20:42 |
sttwister | aha | 20:42 |
sttwister | and $m would be my namespace | 20:42 |
Merio | every function that you create using $m.functionname will be available from the outside as (e.g.) melange.seeder.functionname | 20:42 |
sttwister | ? | 20:42 |
sttwister | ah | 20:42 |
sttwister | great :) | 20:42 |
Merio | yes, basically you create the namespace in lines 32-34 | 20:43 |
Merio | and then a shortcut on line 39 | 20:43 |
sttwister | awesome | 20:43 |
Merio | that line also give a debug decorator (which I've written but not yet used opppsss :P) | 20:43 |
sttwister | heh :P | 20:43 |
sttwister | so the first step would be to make an AJAX request to get the JSON date on document load, right ? | 20:45 |
Merio | there is something more about it though | 20:46 |
Merio | because melange.seeder theoretically should be something of "general use" | 20:46 |
Merio | That means that, for example, all the javascript that actually deals with the GUI should be in another place | 20:47 |
Merio | Nothing more complicated than what I've already explained | 20:47 |
sttwister | ohhh yes, sounds right | 20:47 |
sttwister | that would also be in soc/content/js right ? | 20:47 |
Merio | Just to let you know, then we will do it step by step | 20:47 |
Merio | yes, in the templates directory | 20:47 |
Merio | if you see in the "basic package" => http://code.google.com/p/soc/source/browse/app/soc/content/js/melange-091015.js | 20:48 |
tpb | <http://ln-s.net/79jb> (at code.google.com) | 20:48 |
Merio | line 267 and followers define a basetemplate | 20:49 |
Merio | this is the thing I would like to change as soon as possible | 20:49 |
Merio | Because inheriting that (I'll let you know how in some minutes) will automagically get all startup variables from python automagically at load time | 20:50 |
sttwister | that sounds cool | 20:51 |
Merio | let me look for an example one moment | 20:52 |
sttwister | ok, brb just 2-3 mins, I have to go to the bathroom :) | 20:52 |
Merio | ok ^_^ | 20:53 |
Merio | (writing in the meantime :)) | 20:53 |
Merio | http://code.google.com/p/soc/source/browse/app/soc/templates/soc/organization/home.html#20 | 20:53 |
tpb | <http://ln-s.net/79jt> (at code.google.com) | 20:53 |
Merio | here you can find that django prints a python variable (which is actually a JSON) into a melangeContext attribute in the script tag | 20:54 |
Merio | the basetemplate takes that attribute content and creates an internal variable of it | 20:54 |
Merio | in javascript | 20:54 |
Merio | This is awesome (it's the dojo way to be precise) | 20:54 |
Merio | but has a limitation... you can include only one script that uses it, otherwise there is no way to find which attribute is for which script unless you hardcode the name of the script in the javascript itself or something like that | 20:55 |
Merio | but then if you include the script with the same name two times than you have no way to find which configuration is for which instance of the script :) | 20:56 |
Merio | and then here | 20:58 |
Merio | http://code.google.com/p/soc/source/browse/app/soc/content/js/templates/soc/organization/home-091027.js | 20:58 |
tpb | <http://ln-s.net/79k1> (at code.google.com) | 20:58 |
Merio | you can see the actual javascript file connected to that template | 20:59 |
Merio | Basically this has been done to externalize all javascript code from the html templates, for clarity and maintanability | 20:59 |
Merio | (still is a WIP :P) | 20:59 |
Merio | To use the basetemplate defined in the base melange script | 21:00 |
Merio | you should use lines 1-25 and 187 | 21:00 |
sttwister | ok, well this looks really good, it sure makes it all easier to understand and integrate | 21:00 |
Merio | Don't know if I'm forgetting something useful to begin working on it | 21:01 |
sttwister | one quick question, how does versioning work ? | 21:02 |
sttwister | e.g. melange-09015 ? | 21:02 |
sttwister | what's with the number ? | 21:02 |
Merio | heh that's a pain :) | 21:03 |
Merio | Problem is that some browsers handle caching of javascript files in weird ways | 21:03 |
Merio | At least last time that this has been tested | 21:03 |
Merio | So you update a JS file and the browser uses the cached file instead of the new one | 21:04 |
Merio | So only way is to change the name of the file :) | 21:04 |
Merio | I know that there should be a way to handle that in a better way | 21:04 |
Merio | I knew how to deal with it sometime ago with php | 21:05 |
sttwister | aha I see | 21:05 |
sttwister | oh, that's actually a date, right ? | 21:05 |
Merio | but still it seems that's not easy and no one really cares at the moment :P | 21:05 |
Merio | If you use hg rename you keep the history of the file | 21:05 |
Merio | yes it is | 21:05 |
sttwister | ok got it | 21:06 |
Merio | same problem is for things retrieved using ajax | 21:07 |
Merio | probably we're not using it everytime | 21:08 |
Merio | But it's a good thing to append ?=_"+(new Date().getTime()) | 21:09 |
Merio | when using ajax calls | 21:09 |
sttwister | you mean things retrieved using AJAX get cached ? | 21:09 |
Merio | I can't remember if this is something done by jquery by now | 21:09 |
Merio | Yes | 21:09 |
sttwister | well, the information retrieved shouldn't change unless there's a change in the code | 21:10 |
Merio | if you' | 21:10 |
sttwister | so getting a cached copy should still be fine in most of the cases | 21:10 |
Merio | yes but still it's easy to avoid it appending a timestamp to the query string | 21:11 |
sttwister | sure, that can't hurt :) | 21:11 |
Merio | another little problem is about minimization | 21:12 |
Merio | (one minute I've to be afk, bbs) | 21:12 |
sttwister | ok | 21:12 |
Merio | ok so | 21:13 |
Merio | you should check in your app.yaml whether you're using the unminimized js files | 21:15 |
Merio | or the minimized one (which are in the js.min directory) | 21:15 |
sttwister | it's using the minimized ones | 21:17 |
Merio | ok so you should point to the unminimized ones when working on them | 21:17 |
Merio | and then minimize them and change the app.yaml when deploying | 21:18 |
sttwister | yes, that makes sense | 21:18 |
Merio | But I would suggest to talk with Sverre about it | 21:19 |
sttwister | why, is there anything fishy about this ? | 21:19 |
Merio | Because this is something changed on April | 21:19 |
Merio | and then I had little time to change code and commit so I can't remember all the details | 21:19 |
Merio | Well just that IIRC minimized files should be ready in the js.min directory when deploying | 21:20 |
Merio | Because Sverre was (understandably) bothered by the fact that he had to compile the javascript on each deploy | 21:20 |
Merio | compile => minimize | 21:20 |
sttwister | and what script does the actual minimization ? | 21:21 |
Merio | it's in scripts/closure.sh | 21:22 |
Merio | You need to define the source and dest directory | 21:22 |
Merio | but still I remember that Sverre did some switches to the build script | 21:23 |
Merio | just give me some minutes to find it | 21:23 |
sttwister | oh yes, I think those changes were updated on the GettingStarted wiki page | 21:24 |
Merio | yep but I don't know if all switches are documented :P | 21:25 |
*** dhaun has quit IRC | 21:25 | |
sttwister | aha | 21:25 |
Merio | (running out of battery here! :P) | 21:26 |
sttwister | ok well, anything else left to discuss ? | 21:26 |
Merio | well, I think it's better to ping Sverre on it TBH ^_^ | 21:26 |
sttwister | ok sure, will do | 21:27 |
Merio | I think not, we just have to talk about the web interface, but we can do it next time | 21:27 |
Merio | It's better that you begin setting up javascript and do some studies on jQuery and/or the current Javascript code in Melange | 21:28 |
sttwister | yep, you've provided me with a lot of information in order to properly get started on the client-side, thanks a lot ;) | 21:29 |
Merio | yw :) pls don't hesitate to contact me for any other info you may need :) | 21:29 |
sttwister | ok then | 21:30 |
sttwister | nice talking to you | 21:30 |
sttwister | I guess I'll see you later than :) | 21:30 |
Merio | Ok ^_^ | 21:30 |
Merio | Just put some notes on the meeting | 21:31 |
Merio | Start/end and basically what we talked about, obviously no need for details :) | 21:31 |
sttwister | I took notes on-the-fly | 21:32 |
sttwister | :) | 21:32 |
Merio | I knew that ;) | 21:32 |
Merio | so... need for a sleep... good night ^_^ | 21:34 |
*** Merio has quit IRC | 21:37 | |
*** Leo___ has quit IRC | 22:50 | |
*** r0bby has joined #melange | 23:27 | |
*** SRabbelier has quit IRC | 23:29 | |
*** robbyoconnor has quit IRC | 23:29 | |
*** SRabbelier has joined #melange | 23:34 | |
*** ChanServ sets mode: +o SRabbelier | 23:35 | |
*** r0bby is now known as robbyoconnor | 23:40 |
Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!