IRC Logs for #cmvt Wednesday, 2013-05-15

DanielBairdhi.  nice job on the demo site00:31
DanielBairdi'm pleased i was able to get the column headings and layout neatened up.00:32
DanielBairdhad to code up a word splitting routine:00:32
DanielBaird        _split_text: (text, width)->00:32
DanielBaird            words = text.split /\s+/00:32
DanielBaird            lines = ['']00:32
DanielBaird            linenumber = 000:32
DanielBaird            while words.length > 000:32
DanielBaird                word = words.shift()00:32
DanielBaird                linelen = lines[linenumber].length00:32
DanielBaird                # nothing on this line yet? start with the word00:32
DanielBaird                if linelen == 000:32
DanielBaird                    lines[linenumber] = word00:32
DanielBaird                # will the word fit?  add the word00:32
DanielBaird                else if (linelen + word.length + 1 <= width)00:32
DanielBaird                    lines[linenumber] += ' ' + word00:32
DanielBaird                # it won't fit, add it to a new line00:32
DanielBairdsome later spec of SVG has word-wrapping powers, google can find lots of people hoping that gets adopted by browsers real soon :)00:34
DanielBairdanyway i'm working on hilighting the lines in the table now.00:34
DanielBairdah shit i forgot to draw the graph initially.  you gotta change tabs for it to draw (jquery tabs doesn't call activate for the initially active tab). oh well sam will work it out00:36
prologicwhat does this function do exactly?00:38
prologicI feel like it could have been shorter :)00:38
prologicwhat's a sample input and sample output?00:38
DanielBaird"this is a test sentence", 8 => ['this is', 'a test', 'sentence']00:39
DanielBairdi left off the comment from the top:00:40
DanielBaird        # call this to split text into lines.  Pass in a string and width (in00:40
DanielBaird        # chars); returns an array of strings.00:40
DanielBaird        # TODO: actually width in pixels would be cooler, but would need to00:40
DanielBaird        # know the render context (font / size etc)..00:40
DanielBairdwords.shift() removes the first word from the word array, and returns it00:41
prologicI feel like you could reduce the level of custom code down quite considerbly00:48
prologicif we bring in underscorejs00:49
prologicand use range() String.slice()00:49
prologicand map()00:49
prologicI don't like seeing large amounts of hand written code :)00:49
prologicIt wreaks of reinventing wheels :)00:49
prologicWanna have a go?00:49
prologicI've looked fairly thoughrougly through underscorejs's docs and it has quite a few useful functions that could save a lot of custom code00:49
prologicin the functional style of programming00:49
DanielBairdback now.00:56
DanielBairdhowever i quite like underscore, when i was working with backbone it's more-or-less mandatory.  So far I've not needed it for anything though00:59
prologicDoes this achieve the same result?01:07
DanielBaird what's the 4?  the width?01:09
prologicthat's all you seemed to be doing01:11
prologicgrouping by X chars01:11
DanielBairdhang on i'll make a jsfiddle01:11
prologicSo it does what you wanted?01:16
DanielBaird is it breaking01:16
DanielBairdi'll make one with my code01:17
prologicoh okay I see01:17
prologicso you're splitting on whitespace01:17
prologicof at most 8 chars long01:17
DanielBairdyeah spliting on whitespace means you have to walk through words and lines simultaneously, and there's three outcomes of trying to put a word into a line.01:20
prologicCan you use something like this?01:21
prologicthey look much cleaner ihmo01:22
prologicand do what you want I think01:22
prologicbasically you're word wrapping right?01:22
DanielBaird- line empty? add the word (even if it's too long)01:22
DanielBaird- line got stuff, and there's room for a space and the word?  add the word01:22
DanielBaird- otherwise, the line's got stuff, but this word doesn't fit: add a new line, add the word01:22
prologichow about one of those two functions?01:24
DanielBairdthat regex solution would work but i need an array of lines.  Also, its harder to adapt to pixel widths later01:24
DanielBairdbut really most importantly, they're way less readable01:25
DanielBairdactually they make a match array they join at the end.  so that's easy to get01:26
prologicIHMO they're more readable :)01:29
prologicless if/else and for looping01:29
prologicChoose one :)01:29
prologicless == more :)01:29
DanielBairdi choose the one that is already written and working :)01:32
prologicAlso apparently the Web UI doesn't work in FF02:30
prologicor Safari02:30
prologicvery well02:30
prologicsome problems?02:30
DanielBairdhmm really, i haven't done anything fancy02:34
DanielBairdi'll have a look02:34
DanielBairdhmm yes firefox has all the svg in a very narrow bar.02:35
DanielBairdyeah the svg element isn't adopting the width of it's parent.  i'll fix that right now02:36
DanielBairdhmm.. apparently, the d3 method that gets the _computed_ style value of "width" returns "auto" in firefox.03:04
prologicwhat's the fix?03:05
DanielBairdthey even wrote "computed" in italics in their docs.  hmmmmm03:05
DanielBairdnbd i'll use a jquery thing or something.  it's almost a bug, at least in the d3 docs.03:05
DanielBairdi kinda assumed it would always be in pixels.  anyway off to find the jquery equivalent.03:07
DanielBairdit's a shame, i've been using all d3 utilities in the graph module, this will be the first jquery thing i've neeeded.  hence it adds a dependency to the module.03:08
prologicwrite a function03:14
prologicthat wraps the jquery calls03:14
prologicso that you're dependency becomes the function03:14
prologicso if in future d3 fixes this themselves in some way03:15
prologicyou can just replace or repoint the function03:15
prologicloose coupling for the wicked03:15
DanielBairdthat's an idea.. that way jquery won't be there being accidentally used for other stuff unnecessarily03:16
DanielBairdit does mean an entire other module that exports one litle thing03:16
DanielBairdmeh it's not too much work03:18
DanielBairdi'll make a "d3fixes" module03:19
DanielBairdi'm fairly sure this will be Yet Another Reason you guys will be slandering me to each other in six months, though03:20
DanielBairdd3 uses DOM.getComputedStyle behind the scenes.  The standard says that it's okay to return "auto", so d3 is off the hook03:24
DanielBairdno wait i misread the spec.. "auto" has to be replaced with real pixel measurements.  so it's a firefox bug03:25
prologicanother issue Gerhard found03:25
prologicapparently there's some dependency issues03:25
prologicand some kind of module loading ordering issue03:25
prologicI'll have a poke at your requirejs stuff03:25
DanielBairdwhat's not working?03:26
prologicwell it's the whole FF/Safari issue03:26
prologicthe graph doesn't load on the first tab03:26
prologicor at first - sometimes03:26
prologicand there were a few js errors being thrown03:26
DanielBairdgraph doesn't draw until the tab activate event.  turns out it doesn't fire on the tab being rendered, only on change03:27
DanielBairdi'll commit the working width thing that firefox was stuck on.03:27
DanielBairdi'm halfway through the table-row-highlight thing, but i'll disable the logging for that.  that code will be there though, looking weird03:29
DanielBairdi'd be surprised if there were any real deps issues, require's shim now covers crazy shit like jquery plugins etc pretty well03:30
DanielBairdactually i'll chuck in the graph-initial-draw thing too03:31
prologickk coo03:40
prologicsounds good03:40
prologicI just tried to do a deployment of
prologicand it brought down the other instance03:40
prologichave some fixing to do myself :)03:40
prologicI want to be able to deploy a "test" version of the latest code03:40
prologicwithout affecting the other instance/environment03:40
prologicDid you see the topic change?03:40
DanielBairdah cool03:41
prologicMoved to a more semi-permanent set of urls03:41
prologicI'm gonna make my deploy function work better03:41
ircnotifier04c998df5a93 by Daniel Baird: Fixed firefox svg-width bug, halfway through table-row-highlighting03:42
ircnotifier64568a87467e by Daniel Baird: merge03:42
DanielBairdokay that version works in ff.  shit i forgot to look at safari, might be the same bug i'll check now03:42
DanielBairdyeah safari looks okay.  what was the safari problem, same bad graqph layout as ff?03:43
DanielBairdoh yeah there was a race condition with the tab-making / graph drawing / table drawing. i fixed that too03:44
DanielBairdthat's probably what looked like a deps issue03:45
DanielBairdokay i'm gonna go outside for 10 mins and see if there is still a sky03:46
prologicthat's great03:48
prologicI'll try to deploy this to shortly03:48
prologicnice job :)03:48
prologicstill improving my deploy function04:11
DanielBairdi'll finish the table row highlight.  then i kinda want to go over the layout, decide if pixel-positioning is okay or should i move to something else04:13
DanielBairdmaybe that's when we work out the "other" mode, where the map is big04:13
prologicI was wondering when we were going to get back to that :)04:14
prologicI would like us to spend some time together over the next few days04:14
prologicworking on integrating backend API04:15
prologicwith your frontend04:15
prologicand nutting that out04:15
DanielBairdyes okay.  what i rely on so far is in the module, pretty simple.  I'm calling methods like ccav_data.ibra_region_table() and that gives me back an array of data objects.  atm it makes up numbers, but that's where I'll get data from you.04:17
DanielBairdwe could load it all into data islands in the page, if we like04:17
DanielBairdanyway let's hit that tomorrow or something04:18
prologicI think underscorejs is going to help you a lot going forward04:23
prologicjust with data processing, etc04:23
prologicI'll try to accommodate as much as possible04:23
prologicbut ideally I'd like to provide a RESTful set of services04:23
DanielBairdif i get data as JSON, it's ready to shove into the graph and table.  there's not much actual fiddling with data that I need to do, i think.04:26
DanielBairdthe example did have a "download" option04:26
DanielBairdwhich i presume gets just the regions that are in the current tab (e.g. ibra), and are selected on the graph04:26
DanielBairdhow do you want to do that?04:26
DanielBairdi could send you a list of the region ids/names, and you could reply with a csv or something i guess04:27
DanielBairdideally the user would get a record of their filters i suppose, not sure how that would go into a csv neatly.04:28
prologicI could support &format=json|csv|txt04:55
prologicdefaulting to json04:55
prologicI'm going to try and find the REST spec04:55
prologicand follow it as closely as I can04:55
DanielBairdcool.. does circuits support all the http verbs?04:56
DanielBairdor just get and post04:56
DanielBairdactually i'm not sure if this app ever needs to delete or put or pay or whatever the others are04:57
DanielBairdi think there might be a "A/S/L" http verb04:58
prologicit supports them all05:05
prologicwe'll likely be using only GET05:06
DanielBairdmaybe we can add columns to the csv, so the columns go field, field_filter_max, field_filter_min for each filtered field.  the entire columns will have the same number in, for the max and min columns, but at least it's explicit what the selection criteria were05:14
prologichey DanielBaird  ping?05:16
prologicwhat's the idea behind the version_str?05:16
prologicHow can I make that work?05:16
prologicI'm tidying up your fronted task05:17
prologicand in general deployment05:17
DanielBairdfor now feel free to remove it05:19
DanielBairdbut if you were all excited by the idea :) we'd need to smoosh the js into a big file using r.js, name it including the version str (the same with the css but that's easier because of less compilation), then push the version str into the index.html as well.05:21
ircnotifier761ed1488cc1 by prologic: Fixed delete function to properly delete log/run files05:25
ircnotifier5ad33b3201be by prologic: Vastly improved deployment acorss the board with custom htdocs locaiton, version support and separate instances05:25
*** DanielBaird has joined #cmvt05:26
prologicyeah ok05:26
prologicwell I tided it all up05:26
prologicand it's vastly improved now05:26
prologichaven't fully tested it yet05:26
prologicI've kept version support for the css05:27
prologicbut it would be good to support r.js05:27
prologicand combine/minify05:27
prologicI'll do that another day05:27
DanielBairdat some point i can add the r.js stuff in, that's the best time to do version string i think05:27
prologicyeah ok05:27
prologicif you want to have a crack at it05:27
prologicbe sure to pull in my changes first05:27
prologicI've completely rewritten mostly05:27
prologicno no of course :)05:27
prologicanyway I'm going to test the new deploy code now05:28
prologichopefully it'll support both custom docroot lcoations05:28
prologicand separate instnaces05:28
prologicI'll test locally so as not to blow away the currently running instance on NECTAR (
DanielBairdi still owe you a vagrant/ansible test on my machine, too05:29
DanielBairdi'm a little behind on peripheral things coz it's kinda fun adding ui features05:29
prologicyeah no worries05:32
prologicno rush05:32
prologicmy ansible + fabric is pretty stable now05:33
prologicbut I would like a test again at some point soon05:33
prologicI'd also like to retest nectar deploy from scratch too05:34
prologicprobably on a new vm just to verify integrity05:34
ircnotifier63b5c77e63e8 by prologic: Build the backend and frontend separately06:17
ircnotifier0a5386de1886 by prologic: Don't prompt for options if they are provided on the command lien06:22
ircnotifierccadeb2fb92f by prologic: Bumped version to 0.0.306:32
ircnotifier56dec93537c1 by prologic: Added tag 0.0.3 for changeset ccadeb2fb92f06:32
ircnotifierc571e2087766 by prologic: Development version 0.0.4.dev06:32
prologicOk I'm outta here06:32
prologicdeployment seems to work06:32
prologicI'll test a 2nd instance in the morning06:32
prologicand bring online then06:32
prologiccya tomorrow06:32
DanielBairdbye.. got table row highlighting working06:36
DanielBairdnow that i know you guys are poking around my code i don't wanna commit til i take out all the debugging stuff06:36
DanielBairdi'll add table sorting, then commit that.06:41
ircnotifier5582a13c1699 by Daniel Baird: table row highlighting working; started table sorting06:54
ircnotifier6728fbb6c426 by Daniel Baird: Merge06:54
DanielBairdsorting is actually kinda shitty in slickgrid, i'll have another look tomorrow.06:54
*** DanielBaird has quit IRC08:07
*** DanielBaird has joined #cmvt08:51
*** DanielBaird has quit IRC09:00
*** DanielBaird has joined #cmvt09:26
*** DanielBaird has quit IRC09:30
*** DanielBaird has joined #cmvt09:56
*** DanielBaird has quit IRC10:01
*** DanielBaird has joined #cmvt10:27
*** DanielBaird has quit IRC10:31
*** DanielBaird has joined #cmvt10:57
*** DanielBaird has quit IRC11:02
*** DanielBaird has joined #cmvt11:28
ircnotifiere45696301e51 by prologic: Forgot to create domain docroot11:28
ircnotifier4de059f564a0 by prologic: Automated merge with
*** DanielBaird has quit IRC11:32
*** DanielBaird has joined #cmvt11:58
ircnotifierf35b9ac2c659 by prologic: Fixed passing of docroot option to task11:59
*** DanielBaird has quit IRC12:02
ircnotifier7e96662ed5ad by prologic: Fixed versioning of css by making the main index.html a template that's written out when building the frontend12:10
ircnotifierae7c4fffe6a2 by prologic: Forgot to add version parameter to compile_js function12:11
ircnotifier5db79fc1d377 by prologic: Forgot to match the template css filename format with the actual built format12:13
ircnotifierddf4c424b124 by prologic: Fixed format of app css filename in template12:15
ircnotifier65b572cbddc8 by prologic: Fixed build no. generation in get_version()12:23
*** DanielBaird has joined #cmvt12:29
ircnotifiera27948148a59 by prologic: Fixed build no. generation (forgot capture=True)12:29
ircnotifier587887e32295 by prologic: Use . to separate build no.12:30
*** DanielBaird has quit IRC12:33
ircnotifier0c5098868100 by prologic: Added version to title tag12:53
*** DanielBaird has joined #cmvt12:59
*** DanielBaird has quit IRC13:03
ircnotifier00aac9c7b93e by prologic: Fixed apache named virtualhost config13:10
*** DanielBaird has joined #cmvt13:29
*** DanielBaird has quit IRC13:34
*** DanielBaird has joined #cmvt13:58
*** DanielBaird has quit IRC14:24
*** DanielBaird has joined #cmvt14:54
*** DanielBaird has quit IRC15:03
*** DanielBaird has joined #cmvt15:29
*** DanielBaird has quit IRC15:35
*** DanielBaird has joined #cmvt16:32
*** DanielBaird has quit IRC16:37
*** DanielBaird has joined #cmvt19:11
*** DanielBaird has quit IRC19:15
*** DanielBaird has joined #cmvt20:11
*** DanielBaird has quit IRC20:16
*** DanielBaird has joined #cmvt21:33
*** DanielBaird has quit IRC21:38
*** DanielBaird has joined #cmvt22:34
*** DanielBaird has quit IRC22:38
*** DanielBaird has joined #cmvt22:42
ircnotifierfc97703abbd0 by Daniel Baird: correcting dep for jquery drag plugin, fixes #123:01
ircnotifier0618e28901aa by Daniel Baird: merge23:01
prologicMorning :)23:30
prologichaha good man23:30
prologicyes post-commit hooks bitbucket has23:30
prologicvery good works well23:30
DanielBairdi figured it'd be the same as github23:30
prologicsimilar/identical yeah :)23:31
prologicshall I redeploy to testccav?23:31
DanielBairdi saw a tshirt with yoda saying "OOYL"23:33
prologicI setup our project on ohloh.net23:35
DanielBairdi've never seen the dependency issue in FF, perhaps because I'm serving from my local machine.. do you only see #1 when you're loading from testccav?23:35
prologicBut I think it's inaccurate due to you committing query, leaflet, etc into the codebase23:37
prologicI need to tell ohloh to ignore those :)23:37
prologicI thought you fixed Issue #1?23:37
DanielBairdi've never seen the problem occur23:37
DanielBairdi found a bug (the jquery plugin our table thing wants wasn't requiring jquery) and fixed that.. so #1 is probably fixed, unless there were two reasons for throwing the error23:38
prologicwell I can easily test it23:38
DanielBairdso i mean, had you only previously seen #1 when loading from a remote server?23:38
DanielBairdif so then yes please push it to the remote test server23:39
prologicumm yeah23:39
prologicthat's all I'd been testing with so far23:39
prologicI don't have a full deploy locally on my iMac at the moment23:39
prologicI'll redeploy to testccav then23:39
DanielBairdohloh thinks our project has cost $521,581.0023:40
DanielBairdi think htat includes writing jquery, leaflet etc23:41
prologic$ fab -H deploy:name=testccav,,port=800023:41
prologicI don't like the way deploy works23:41
prologicCan you come up with some better/good ideas?23:41
prologicThe main problem(s) I have with it right now are:23:41
prologic1) You have to respecify the domain/port each time for updates23:41
prologicEven though the apache config should not change for subsequent updates23:41
prologicand If you were going to redeploy the same config from scratch/fresh23:42
prologicyou'd have to retype all the key/value pairs again23:42
prologicI'm thinking something like a "deploy" config file would be good23:42
prologicfab deploy:config=testccav.conf23:42
prologicAnyway testccav deploy updated23:44
DanielBairdhow about23:45
prologicsee I fucked up the deploy23:45
DanielBairdfab deploy.test23:45
prologicbecause I have to explicitly specify domain/port each time23:45
prologicI put in the wrong port23:45
prologicthat could work23:46
prologicand in theory could work well23:46
prologicthey would be subtasks/functions in deploy.py23:46
prologicjust with hard-coded deploy locations, domains, etc23:46
DanielBairdyeah and they all just bounce to deploy.withconfigfile:file=dir/xxxx.cfg23:46
prologictestccav back up now23:46
prologicand worked instantly in FF this time23:47
prologicbeautiful :)23:47
prologicwell I like your idea better23:47
prologickeep it simple stupid23:47
prologicI'll just write some convenience tasks23:47
prologicthat have hard coded options preconfigured23:47
prologicat least for test/prod23:47
prologicI'm not sure how I'd do a local one23:47
prologicthat works for both you and i23:47
prologicmy local server is
prologicif you ran the ansible playbooks against your vm23:48
prologicand ensured it had the same ip23:48
prologica local task could work for both you and i23:48
DanielBairdif you were doing config files in a dir, then we can mod our own configs to suit, but yeah just as easy for me to change the ip in the vagrant file to
DanielBairdif you were working up a bit of a deploy framework for re-use in your next project, it'd be worth doing the config dir thing23:49
DanielBairdbut not just to get this thing working23:49
DanielBairdoh i left in some console.log stuff to do with table sorting23:50
prologicI think that's easier :) and less work :)23:50
DanielBairdoh well it's fine, unless someone tries it in IE23:50
prologicin future I may do so23:50
prologicfor better reuse23:50
prologicbut for now the simplest thing works well :)23:50
prologicbetter remove the console.log calls then :)23:51
prologicperhaps you should give me your key23:51
DanielBairdgah, i hate it when browsers frick with the url input after displaying it23:51
prologicso you can test a deployment yourself23:51
prologicoh speaking of urls23:51
prologicwe need to ensure with the UI23:51
prologicthat everything is trackable23:51
prologicand history/forward/back are maintained23:51
prologicso that the application can be loaded in any preconfigured state23:52
prologicand bookmarkable23:52
prologiccan you have a think about how you're going to architect this on your end?23:52
prologicI'm sure there are jQuery plugins to do all this23:52
DanielBairdthe url handling?23:52
prologiceverything/most things need to modify the url in some way23:52
DanielBairdall supported already by angular.  no wait arrrrrgh23:52
prologicYou're a funny man :)23:53
DanielBairdyes it'll just be url shoving, i guess i'll append stuff after a #23:53
prologicthat's the usual way isn't it?23:53
DanielBairdincluding filters on the fields, you think?23:53
DanielBairdthere's been a bit of pushback on having app state data following the #, but it's only a conceptual argument.  it's possible to get super fancy on the server and hide the # but meh we don't have to be purists.23:55
DanielBairdi can add filters to the url, but they probably shouldn't go into the history.  if you drag a filter handle on the you probably don't expect to have to click the back button fifty times to go back through the interif drag values23:57
DanielBaird* interim23:57
DanielBaird* "on the GRAPH", missing word23:57

Generated by 2.11.0 by Marius Gedminas - find it at!