Category Archives: Projects

Phil 4.10.15

8:00 – 4:00 SR

  • Possibly a good book to get? https://www.ng-book.com/
  • Working on getting regression to predict upper and lower bounds
  • Working out the structure of the dataFormat and dataProvider Objects
  • dataFormat example
    this.dataFormat = { // might add 2D/3d, dynamic/static, etc.
       goals: "area",
       obligations:"area",
       pm_actuals:"bar",
       facts:"bar",
       pm_future:"area",
       facts_future:"area"
    };
  • Matching dataProvider example. Note the _mappings array and the fact that all items have a min/max value as well as a chart-wide minmax (no Z in this case)
    this.dataProvider = {
       _type:'XY', // RAH (Radius Angle Height) RAE (Radius Azimuth Elevation), XYZ, etc.
       _min_max:{xmin:0.00, xmax:11.00, ymin:0.00, ymax:3135.30},
       _mappings:[{Jan:0, Feb:1, Mar:2, Apr:3, May:4, Jun:5, Jul:6, Aug:7, Sep:8, Oct:9, Nov:10, Dec:11}],
       goals:{Jan:{min:0, max:1000.00}, Feb:{min:0, max:1100.00}, Mar:{min:0, max:1210.00}, Apr:{min:0, max:1331.00}, May:{min:0, max:1464.10}, Jun:{min:0, max:1610.51}, Jul:{min:0, max:1771.56}, Aug:{min:0, max:1948.72}, Sep:{min:0, max:2143.59}, Oct:{min:0, max:2357.95}, Nov:{min:0, max:2593.74}, Dec:{min:0, max:2853.12}},
       obligations:{Jan:{min:0, max:500.00}, Feb:{min:0, max:600.00}, Mar:{min:0, max:720.00}, Apr:{min:0, max:864.00}, May:{min:0, max:1036.80}, Jun:{min:0, max:1244.16}, Jul:{min:0, max:1492.99}, Aug:{min:0, max:1791.59}, Sep:{min:0, max:2149.91}, Oct:{min:0, max:2579.89}, Nov:{min:0, max:3095.87}, Dec:{min:0, max:3715.04}},
       pm_actuals:{Jan:{min:0, max:250.00}, Feb:{min:0, max:341.39}, Mar:{min:0, max:495.27}, Apr:{min:0, max:618.30}, May:{min:0, max:923.08}, Jun:{min:0, max:1318.68}},
       facts:{Jan:{min:0, max:125.00}, Feb:{min:0, max:134.17}, Mar:{min:0, max:134.31}, Apr:{min:0, max:163.00}, May:{min:0, max:164.36}, Jun:{min:0, max:202.29}},
       future_pm_actuals:{Jun:{min:1318.68, max:1318.68}, Jul:{min:1257.91, max:1499.96}, Aug:{min:1342.92, max:1827.03}, Sep:{min:1427.94, max:2154.10}, Oct:{min:1512.96, max:2481.16}, Nov:{min:1597.97, max:2808.23}, Dec:{min:1682.99, max:3135.30}},
       future_facts:{Jun:{min:202.29, max:202.29}, Jul:{min:193.38, max:215.48}, Aug:{min:196.77, max:240.99}, Sep:{min:200.17, max:266.49}, Oct:{min:203.57, max:291.99}, Nov:{min:206.96, max:317.50}, Dec:{min:210.36, max:343.00}}
    };
  • In excel, the results look like the following. Now working on incorporating into the graphing system prediction
  • Setting up a method to calculate the screen positions of the data points based on the dataProvider. Got margins, datagrids and areaCharts working. BarCharts are next. I need to think about how to cluster the bars. I’ll also need to add additional DataPoints when the botom axis is not (zero? horizontal?)

Phil 4.9.15

8:00 – 4:30 SR

  • Showed Lenny the new charts. He’ll be out tomorrow, so I’ll probably deploy the test version on Monday. We then had a long talk about the best way to statistically model the data in the first chart. It really sounds like Bayes might be the way to do this. Which is awesomely cool, because my schoolwork and jobwork are perfectly aligned for the weekend. Gonna charge me some hours figuring out Bayes.
  • Building the dataFormat and dataProvider Objects. Since Lenny wants future performance, I’m pulling in the Apache commons math jar for linear regression. I think I want OLSMultipleLinearRegression
  • Added SimpleLinearRegression to JavaUtils that wraps OLSMultipleLinearRegression and hides some complexity.that is not intuitively obvious documentation. Glad I found this example. Added to Subversion. I’ll probably need to add a method that gets the error so that I can add that to the future error.
  • More JSON tomorrow, then on to Bayes. Did get this book

Phil 4.8.15

8:00 – 4:00 SR

  • Kinda promised Ronda cookies
  • Worked through Markov Chain Matrix math. I think I understand how it relates to PageRank Matrix math, and therefore, how Page Rank is a Markov Chain.
  • Working through charting bugs
    • Added font and color choice to dprint
    • Fixed canvas font application in WebGlComponentClasses
    • Updated WebGlInterfaces
    • Fixed bugs in ChartInfo
  • Newest version is live
  • Adding JSON objects for charts to read and display.

Dong Shin 04.08.2015

  • working on Reqonciler
    • got Spring File Uploader working
      • requires multipartResolver bean, commons-fileupload-1.3.1.jar, commons-io-2.4.jar
    • ported ContractsParser from FinancialAssistant to ReqoncilerService

Phil 4.7.15

8:00 – 4:00 SR

  • Committed to bringing in a test version of the charting. I probably need a WGLChart2D so that there’s no DB complications initially. Need to verify that the JSON servlet still works though.
  • Added legends back in. Had to fix a bad string test
  • The CanvasRenderer moved. Had to fix that. Verified it still works
  • Removing chart classes from the controller and putting them in the classes folder
  • Added WebGlCharts to classes directory and to the makefile. Had problems until I realized that I had created “WegGlCharts”. Stupid fingers.
  • Starrting WGLChart2D
  • My new dev box is here!
  • 2D is mostly ported and running. A few more things to clean up before packaging to deploy. Visible here.

Phil 4.2.15

8:00 – 5:00 SR

  • Had to bounce the server
  • Status reports! Done.
  • Going to revisit the dynamic creation of callback functions to see if I can get it to work with Angular. If that fails I’m giving up and going back to interfaces. I expect Angular 2.0 to fix this problem anyway.
  • This works:
    export class ATSBase {
       constructor() {
          /****/
          this["timeoutFunction"] = () => {
             var proto:Object = this["__proto__"];
             proto["timeoutFunction"].apply(this, arguments);
          };
    
          this["myFunction"] = () => {
             var proto:Object = this["__proto__"];
             proto["myFunction"].apply(this, arguments);
          };
          console.log("done");
          /****/
       }
    }
  • This does not:
    class Base {
       constructor() {
          for (var p in this)
             if (!Object.prototype.hasOwnProperty.call(this, p) && typeof this[p] == 'function') {
                var method = this[p];
                this[p] = () => { method.apply(this, arguments); };
                // (make a prototype method bound to the instance)
             }
       }
    }
  • If I figure out that, I think I’ve got it…

Dong Shin 04.01.2015

  • working on StoredQueryService
    • RowMapper for StoredQuery class
    • copied User class and associated classes – moved to Spring Utils?
    • modified ServiceResponse to return status and message
    • got CRUD working in Service
    • got JSON service working….

Dong Shin 03.31.2015

  • found that POC could not be added to the list
    • put old code back in place that refreshes the data on save
    • had to explicitly set the self.gridOptions.data = self.pointOfContacts when the data returns
  • changed so that server returns empty list instead of error when nothing found
  • modified funding_request_pocs table to cascade changes to point_of_contacts table

Phil 3.31.15

8:00 – 4:30 SR

  • Working on debugging POC name issue. Fixed? Had to roll back some things to make the data binding work?
  • Migrating NovettaUtils to the lib directory, then using that for inheriting in the charts module. Which was going to be migrated before discovering the fat arrow inherit feature (FAIF). So yeah. migrate that too.
  • Nope, realized that there was no way to maintain state using the approach that I tried. Looking into using the actual prototype chaining pattern instead.
  • Ok, kinda hit a wall here. Note that the breakpoint and the console.log disagree:

wtf

Phil 3.30.15

8:00 – 3:00 SR

  • Mark, who is standing in for Lenny, found this and I verified. Entering a POC in a new FR doesn’t show up in the list.
  • Testing the new callback scheme in typescript testbed.
  • Tried it, and was quite hopeful, but the scheme failed with the timeoutService callback. Bad, because that’s a basic Angular component and messing with that just isn’t in the cards. But the fatPrototype/fatSuper scheme works. Now I just need to be able to make prototype chaining work right. Done! Here’s the entire class:
    export class FatSuperBase {
       public functionMap:any[];
       constructor() {
          this.functionMap = [];
       }
       public setFatPrototype(fn:Function, n:string){
          // TODO: look for earlier prototypes that we might need to call
          if(!this.functionMap.hasOwnProperty(n)){
             this.functionMap[n] = [];
          }
          this.functionMap[n].push(fn);
       }
       public fatSuper(fnName:string, childArgs:IArguments){
          // TODO: look for earlier prototypes that we might need to call
          var fn:Function;
          var farray:Function[];
          if(this.functionMap.hasOwnProperty(fnName)){
             farray = this.functionMap[fnName];
             fn = farray[farray.length-1];
             fn.apply(fn, childArgs);
          }else{
             console.log("fatSuper(): function '"+fnName+"'does not exist on the prototype chain");
          }
       }
    }

Dong Shin 03.30.2015

  • working on Stored Query Service – runs stored queries and publishes as json
    • creating database table, model, controller, service……
  • created separate Java Lib for logging – LoggingUtils
    • moved Spring Service libraries to User Library – SpringLibs
  • POC problem on-site… need to look at the debug information tomorrow.

Phil 3.27.17

7:00 – 3:30 SR

  • Timesheets
  • Wow – upgraded to Windows 7! Of course, that means that I don’t have PuTTY and can’t get to the servers. Put in a ticket…
  • Need to see how super() works in JavaScript. I’m thinking it should be possible to write a Utils.FatSuper(this.myFnPtr) static method that will do the same.
  • TypeScript parent class (Parts stripped out for clarity):
    export class TestController implements ITestController {
       // standard TypeScript constructor
       constructor() {
       }
    
       public extendableFunction():void{
          alert("It's extendableFunction()");
       }
    
       public fatArrowFunction = ():void => {
          alert("It's fatArrowFunction()");
       }
    }
  • Compiled JavaScript of above:
    var TestController = (function () {
        // standard TypeScript constructor
        function TestController() {
            var _this = this;
            
            this.fatArrowFunction = function () {
                alert("It's fatArrowFunction()");
            };
        }
        TestController.prototype.extendableFunction = function () {
            alert("It's extendableFunction()");
        };
        return TestController;
    })();
    InheritApp.TestController = TestController;
  • TypeScript child class:
    export class TestController2 extends TestController implements ITestController2 {
       myInheritedString:string;
    
       // standard inheriting constructor pattern. Note that 'super' must be on the first line and
       // that the arguments from angular get passed through
       constructor(){
          super();
       }
    
       public extendableFunction():void{
          super.extendableFunction();
       }
    }
  • Compiled JavaScript of above:
    var TestController2 = (function (_super) {
        __extends(TestController2, _super);
        
        function TestController2() {
            _super.call(this);
        }
        TestController2.prototype.extendableFunction = function () {
            _super.prototype.extendableFunction.call(this);
        };
        return TestController2;
    })(TestController);
    InheritApp.TestController2 = TestController2;
  • JavaScript of above with all the contents commented out:
    var TestController2 = (function (_super) {
        __extends(TestController2, _super);
        function TestController2() {
            _super.apply(this, arguments);
        }
        return TestController2;
    })(TestController);
    InheritApp.TestController2 = TestController2;
  • As an aside, __extends is just parasitic inheritance:
    var __extends = this.__extends || function (d, b) {
        for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
        function __() { this.constructor = d; }
        __.prototype = b.prototype;
        d.prototype = new __();
    };
  • So we know a few things now:
    • extending in TypeScript means that the child class is called with the parent class passed in as an argument called ‘_super’
    • Fat arrow functions are defined in the constructor as variables pointing to functions and are attached to ‘this’, not ‘_this’
  • I tried looking for the properties in the debugger, but couldn’t really see what was going on in the JavaScript. So I added a loop over the properties in the TestController2 constructor. FatArrowFunction is listed and extendableFunction is not. To me this makes sense, as extendableFunction is on the prototype:
    this[fatArrowFunction] = function () {
            alert("It's fatArrowFunction()");
        }
  • Building on the above, we can make what boils down to our own prototype for fat functions. The other option is to turn everything into fat functions as per this nifty piece of work, discussed on this page. I have a concern about adding all this wrapping to functions, so until I run some tests and see what’s faster, here’s a way of doing it semi-manually. Here’s the parent code:
    export class TestController implements ITestController {
       public functionMap:Function[];
    
       // standard TypeScript constructor
       constructor() {
          this.functionMap = [];
          this.setFatPrototype(this.fatArrowFunction, "fatArrowFunction");
       }
    
       public fatArrowFunction = (arg:string):void => {
          alert("It's fatArrowFunction("+arg+")");
       };
    
       public extendableFunction():void{
          alert("It's extendableFunction()");
       }
       public setFatPrototype(fn:Function, n:string){
          // TODO: look for earlier prototypes that we might need to call
          fn["name"] = n;
          this.functionMap[n] = fn;
       }
       public fatSuper(fnName:string, childArgs:IArguments){
          // TODO: look for earlier prototypes that we might need to call
          var fn;Function;
          if(this.functionMap.hasOwnProperty(fnName)){
             fn = this.functionMap[fnName];
             fn.apply(fn, childArgs);
          }else{
             console.log("fatSuper(): function '"+fnName+"'does not exist on the prototype chain");
          }
       }
    }
  • And here’s the child class:
    export class TestController2 extends TestController implements ITestController2 {
    
       public extendableFunction():void{
          super.extendableFunction();
       }
    
       public fatArrowFunction = (arg:string):void => {
          this.fatSuper("fatArrowFunction", arguments);
          alert("It's fatArrowFunction2("+arg+")");
       };
    }
  • As the comments say, I do not recurse up the ‘prototyp’ tree yet, though that wouldn’t be hard. Before I do that, I need to implement both versions and see if the version that converts all functions to function pointers works with Angular and if it does, to run some tests to see which is faster. Stuff for Monday.