Thursday, November 7, 2019

I think I've talked myself out of a return trip to North Carolina.

The trip I took this year was kinda weak. Hurricane Dorian loomed and I ended up getting out of there early. The last night I was there I was in a Cary hotel room and there were several individuals fleeing the storm further inland from the coast. Also, I picked the week of Labor Day to go by accident and that meant fewer meetups with tech talks. Lame! Anyhow, I did get to see the Tech Triangle and while I have been telling myself I need to go back a second time, just today I have talked myself back out of that. A better visit does not have to be a bucket list to-do. Just so that everyone knows I have been to Charlotte once before. I was there on 8/28/2016 and I took this photo of a weird IHOP. The chicken sandwich or hamburger or what have you that I ordered had sour cream on it and it was inedible. I dug up the photo from Facebook just now.

 
 

Addendum 11/8/2019: Is that a tumor on the side of the head of the guy in the black shirt by the ear? Is that what the girl in the red shirt is gawking at?

How do I copy and paste some complicated JSON object logged to the console in Google Chrome Developer Tools to Notepad?

  • Right-click on the object and pick "Store as global variable"
  • The console will give you a name for the global variable you just made. It will be something like: temp1
  • Punch in copy(JSON.stringify(temp1)); at the console.
  • If you paste into Notepad everything will be jammed into one line, so paste into the left side of https://jsonformatter.org/json-pretty-print instead.
  • Copy everything from the right side to Notepad to have good JSON formatting.
  • Gson

    It is an open source library for serializing and deserializing JSON objects. It has prettier capabilities baked into it. The G is for Google. It was spun up at Google, get it?

    Filter out all of the matches on a single property within the objects in an object array based upon a second comparable array of blacklisted items in JavaScript.

    var good = [];
    var bad = [{id:27,alt:'h'},{id:69,alt:'i'},{id:42,alt:'j'},{id:23,alt:'k'}];
    var ugly = [{id:69,alt:'l'},{id:13,alt:'m'},{id:86,alt:'n'},{id:42,alt:'o'},{id:23,alt:'p'}];
    bad = bad.sort((yin, yang) => {
       if (yin.id > yang.id) {
          return 1;
       }
       if (yin.id < yang.id) {
          return -1;
       }
       return 0;
    });
    ugly = ugly.sort((yin, yang) => {
       if (yin.id > yang.id) {
          return 1;
       }
       if (yin.id < yang.id) {
          return -1;
       }
       return 0;
    });
    var spot = 0;
    ugly.forEach(function(value) {
       if(value.id != bad[spot].id) {
          if (value.id > bad[spot].id) {
             while (value.id > bad[spot].id && spot < bad.length-1) {
                spot++;
             }
          }
          if (value.id != bad[spot].id) {
             good.push(value);
          }
       }
    });
    console.log(good);

     
     

    Supposedly _.merge is the way to do this stuff with Lodash.

    Wednesday, November 6, 2019

    _.differenceWith in lodash

    This has a little cheatsheet on lodash and this might honestly be a play place with lodash and TypeScript. _.differenceWith will take three properties, first the array to keep stuff from, second the array to match against for throw aways, and third _.isEqual as a comparer to deep compare.

    PoE stands for Power over Ethernet

    This is a cable that passes power with data in one cable, or more specifically the system around as much.

    Tuesday, November 5, 2019

    How to do a merge for a hotfix in TFS within Visual Studio 2017.

    1. Pull down to a different folder the folder to merge to from the SAME workspace. Do not change workspaces.
    2. In the "Source Code Explorer" right-click on the folder containing the stuff you want to merge in and pick "Branching and Merging" and then "Merge..."
    3. Walk through the little wizard. Click the "Selected changesets" radio button. The "Source branch:" setting should be mapped to the stuff you want to merge in and the "Target branch:" should be mapped to where you want to merge to.
    4. The next page of the wizard will let you cherry pick what you want to merge.