Read and annotated one of the JAEH articles, and also Skyped with JSR to prep for the interviews tomorrow; created a diagram to support one of the questions.
Attestation paper has a field that asks for apparent age in years and months. Using the example '30 years 4 months' as an example, we'll ask editors to enter it thusly 30:4
Here's some javascript that will take 30:4 and turn it in to 364. We'll store that in the database as an integer.
// incoming
var ageFromInput = "30:4"; // this needs to be a string
var ageArr = ageFromInput.split(':');
var ageSubYears = parseInt(ageArr[0]); // this needs to be an integer
var ageSubMonths = parseInt(ageArr[1]); // this needs to be an integer
var ageInMonthsYears = ageSubYears*12;
var ageInMonthsTotal = ageInMonthsYears+ageSubMonths; // should be 364
console.log(ageInMonthsTotal);
When we display the data, we'll reverse things, taking the 364 from the DB and turning it in to the correct display format
// outgoing var ageInMonths = 364; // int value from DB var ageDecimal = ageInMonths/12; // should give us 30.333333333333332 var ageYears = Math.floor(ageDecimal); // should give us 30 // to handle the months display, we need to get the decimal // value (0.333333333333332) with modulus (%), multiply by 12 and round var ageMonthsRemainder = Math.round((ageDecimal % 1)*12); //should give us 4 var ageDisplay = ageYears + ":" + ageDecimalRemainder; // should give us 30:4 console.log(ageDisplay);
I'll be leaving a little early.
With SB, preparing ticket work to discuss with the Stylesheets group next week.
CC pointed out a number of flaws in the way both primary source and normalized versions are being rendered. The previous site had an assumption that title page contents were centred; we want to make that explicit in texts, but then handle it, so I've added a handler for the titlePage element. Where possible, flow content in paras in normalized texts should be justified, so I've made that happen by adding a class on the root div which enables us to apply override styles for normalization display. I fixed some encoding errors in a couple of texts, and I've also tweaked a bunch of the CSS. We're getting closer to a publishable version now.
Worked a lot on the search today, constraining it to published documents only, and tweaking how it returns results. I've also added VNU validation of the HTML to the build process, and fixed some problems arising out of that; I've turned popup notes into <aside> elements so that their inline text can be ignored by the indexer, while the footnote rendering at the bottom of the document will be indexed; and I've refined the indexing after using the monex profiler. I also tweaked the P5 output so that it validates with the correct schema links. I think we're more or less there now; what we have is already much better than what's on the site, and I see no problem issues at all.
JL called asking for a list of the Canadian cities from which teachers have registered. I pulled the XML version of the tg_users table from the server and ran this:
let $tables := for $t in //table[column[@name='mailingCountry'][normalize-space(upper-case(.)) = 'CANADA']] return $t let $addresses := for $t in $tables return normalize-space(upper-case(concat($t/column[@name='mailingCity'], ', ', $t/column[@name='mailingState']))) let $uniqueAddresses := distinct-values($addresses) let $orderedAddresses := for $u in $uniqueAddresses order by $u return $u return string-join($orderedAddresses, ' ')
to get a quick-and-dirty list of city, province. I had to search-and-replace some ugly character encoding issues -- the db thinks it has UTF-8 but the data coming in has obviously been 8859-1. Sent the results to JL.
Continued working on Pausanias , worked till 1.17.1. time spent 8:26 am to 11:27 pm ~ 3 hours .
Using the code I rewrote yesterday, I've now integrated the treaty spreadsheet into the main personography. I had to resolve a few duplicate ids, so I've now written an additional output page for the web site which lists all existing ids (except for purely local ones) so that assignment is easier.