Posts

Rants

All times should be passed in ISO 8601 UTC format especially between APIs from different vendors. Any deviation from ISO 8601 is amateurish. I'm talking to you Microsoft, Samsara, and a whole bunch of others. Localization should only be done at the point it is needed such as displaying it to the user. Whenever I receive something on my phone from someone not in my contacts list, I think "scam" as my second thought after the "what the?" That's not cynical. It's just a sign of the times.

TWF UI and Hours Of Service

I finally got the UI to add drivers to TWF (Tandem Workflow) done. At least I got it to test. It was harder because I tried something new to me: verify unique usernames as you type. This required me to learn how to implement JS Promises because JS is Async. That means JS can return results (null, undefined or default) before the web request to the database returns our desired data. Promises wait for the web results and then continue execution from there. Next on the list, Hours Of Service (HOS). I need to implement HOS for TWF. This includes the standard BOLT HOS and GeoTab. Keep Trucking, a new data provider, will also be added even though I don't know who will write that integration. I got TWF HOS started but now I find myself waiting on Eleos to disable GeoTab in the sandbox so that I can see the HOS card. The HOS card is hidden while GeoTab is active.

A Menu and a Mess

Added a menu link for CFC's editable class-pay table. Pushed a file to the repository for Jerry. Used the wrong branch. Made a mess. had to delete my local copy and re-clone the repository. Everything is all better now. Working to get Transervice's GeoTab account added to Tandem Workflow. Waiting on Eleos to request the login creds.

Notifications and CFC

Today Yellow Cab is reporting a lot of issues receiving notifications. I am switching the affected drivers over to SMS as the reports come in. Oddly, all of the reports are Android users. I think I have finally finished CFC's driver settlement. Meanwhile, I figured out how to get the segment miles using the array of stop ids that are passed into the settlement method. It was so simple that I had to recheck it to make sure I wasn't hallucinating. Eleos sent a message that the configuration options have been copied over to production. El Paso can now start using/testing Tandem Workflow.  I need a list of their driver ids for that. I also need to create a UI or some way to automatically add drivers to TWF.

Drawing circles on maps

I translated GeoTab's JS calc circle example into ColdFusion. We start with the lat and lng of an address. Then we take 1 degree steps around the circle. We could take 15 degree steps by changing the i++ to i = i + 15. Whatever number we use should go into 360 evenly to make it a closed circle. Otherwise, we'd need to do some fancy-schmancy calculating to close the circle. function generateCircleZonePoints(lat, lng, radius) { var earthRadius = 6371000 ; var latitude = lat * ( pi()/ 180 ); // in radians var longitude = lng * ( pi()/ 180 ); var angularDistance = radius / earthRadius; // radius is the radius of the circle we are drawing in meters local .zonePoints = []; Math = createObject( "java" , "java.lang.Math" ); // usage: Math.atan2(javacast("double",firstArg),javacast("double",secondArg)); for ( var i = 0 ; i <= 360 ; i++) { var radians = i * ( pi()/ 180 ); var latitudeRadians = asin...

CFC and iPhones

I think I have CFC's settlement completed. I did not have a way to complete the daily minimum for them because our settlement system is load based not date based. There is a way but the amount of work required to implement something they will rarely use is not justified. Still having weird issues with notifications... I need to build a message Id trap to help PushBots troubleshoot it. It mostly seems to be an iPhone issue. Now back to GeoTab. I need to create geofences and rules for those geofences. Here is a JS rule example: api.call("Add", { typeName : "Rule", entity : rule }, function (ruleId) { api.call("Get", { typeName : "Rule", search : {id: ruleId} }, function (r) { console.log("Added rule: ", r); }, function (error) { alert(error); }); }, function (error) { alert(error); });

Bummed out on notifications

I think the Pushbots issue is behind us. I don't know what caused the time-out but they only occurred for about one hour and then our server auto-rebooted. Just finished a conference with GeoTab. Seems we can set-up geo-fences on the fly and use their rules and exceptions system to get the arrive-depart data we need.