8:00 – 5:00 SR
- DB Backups
- Dong discussed Reqonciler with Lenny
- Spent some time chasing down what to do about heartbleed. Since I admin only the VMs, and it appears that the landlord is doing regular updates, I’m trying to determine if I have to do anything in addition to what I’m already doing. Once more, it would really help if we had a real sysadm on the team.
- Today’s big JavaScript breakthrough.The following have the same results, though the Internet says that bind() has more overhead and takes longer.
// Typical way to handle callbacks
var self = this;
setTimeout(function() {self.callbackFn()}, this.delay);// More clear?
setTimeout(this.callbackFn.bind(this), this.delay);Interestingly, you can move the inner function out of the callback and into the “Constrictor” (e.g. combination inheritance) so that the function only gets created once:
function MyClass(){
var self = this;
this.boundFunc = function(){self.callbackFn()};
}This allows for a nicer looking call:
setTimeout(this.boundFunc, this.delay);On the whole, I think I like the last pattern the best.
