- got the client/server working for Funding Request – open and save
- tricky date parsing – java.sql.Date instead of java.util.Date
- server returns dates as string, but parses date object?
- moving Funding Request app to Financial Assistant app
Monthly Archives: January 2015
Phil 1.6.15
8:00 – 4:00 SR
- Snow!
- ITK timesheet
- Status report
- Made FY charts for all FY2015. It looks like the new query is using the wrong values for the Name column – e.g., it should be ‘PM Actuals’ but it’s coming back as ‘PM Actuals (Invoiced) Outlay $’
- Angular
- Was looking at the scatterplot app and it’s entirely broken. I’m thinking that I didn’t update all of the code to subversion when I was working on it back on the 24th. Setting that aside for the day. I think I’m going to try to understand how to do inheritance in Angular. And a darn good thing too. I found all my missing code, fixed a few things, committed it, and put it up here.
- Rediscovered that ‘this’ is not part of a javascript function. Which makes the whole var self = this part of a controller now very confusing. Ah, in looking at the debugger, controllers get a special ‘this’ – ‘$get.Constructor’
- There doesn’t seem to be much discussion about this – mostly this bit on stackoverflow.
- Making slow progress. I can declare a function outside of the controller, inherit from it and use that as the controller’s function, but so far I can’t pass arguments. Since that’s only needed to inject other angular objects, I put together a tiny service that provides a string. We’ll see if I can make that pass in correctly tomorrow.
Phil 1.5.15
8:00 – 5:30 SR
- Fix ITK timesheet for 12/21?
- DB Backups
- Status report
- Angular
- Spent most of the day trying to figure out how to get server information such as referrer. Wound up with a php hack:
<?php
// this is the only way that I know to get the referring page. We will then send this to the db.
function getReferrer(){
$referrer = "No Referrer";
if(isset($_SERVER['HTTP_REFERER'])) {
$referrer = htmlentities($_SERVER['HTTP_REFERER']);
if($referrer == ""){
$referrer = "No Referrer";
}
}
return $referrer;
}
echo '<div id="phpReferer" hidden>'.getReferrer().'</div>';
?>
- This uses php to compile a page with a div named ‘phpReferer’. Since the page exists before Angular has a chance to process it, the hidden div is available in the document. It’s then a matter of getting the $document (passed into the controller) and looking through it. Note that the jQueryLite that angular has doesn’t allow finding divs by ID, so we have to loop over the results for <div> until we find what we’re looking for:
self.phpReferer = null;
var divArray = $document.find('div');
var i;
for(i = 0; i < divArray.length; i++){
if(divArray[i].id === 'phpReferer'){
self.phpReferer = divArray[i].innerText;
}
}
- I’m not hugely happy with this, but it does work…
- Also looked at how to do polymorphism in Angular. I found this example, which is somewhat confusing and bares further examination. The guy who described it, Miško Hevery, is one of the authors of Angular, so I give him the benifit of the doubt. And here’s a talk by him on OO and JavaScript. Currently 46 minutes in.
Phil 1.2.14
8:00 – 5:00 SR
- DB backups
- Angular
- Starting db-backed ‘wizard’ directive. We’ll probably use this mechanism for the Funding Request webapp.
CREATE TABLE IF NOT EXISTS `wizard_table` ( `uid` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `step` int(11) NOT NULL, `question` varchar(255) NOT NULL, `info` varchar(255) NOT NULL, `response_type` varchar(255) NOT NULL, `responses` int(11) NOT NULL, PRIMARY KEY (`uid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
- Populating table with famous quotes
- Starting the main directive code. Since this isn’t an ng-repeat, I need to load the data and set the first panel with an ng-init call.
- Got everything working. Need to clean up a bit.


You must be logged in to post a comment.