Thursday, May 31, 2018

Make a ViewModels folder for your ViewModels.

It should probably sit at the root level beside the Views folder in an ASP.NET Core MVC application. This is one of the things touched on on pages 76 and 77 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis, the other is that if you do an Add > New Item... at the Controller folder and actually pick the MVC Controller Class option that you may be taken through a wizard which drags in other dependencies and that may be undesirable. Pages 76 and 77 have you make a ViewModel and the book's example took me back in time to my time at AMD as it both uses C# regions (complete with #endregion) and Newtonsoft which people used to use to serialize stuff to JSON before it was just a feature in ASP.NET MVC. The two uses of attributes at a ViewModel are:

  1. using System.ComponentModel; as a namespace allows for [DefaultValue(0)] above int type getsetters to provide a default value of zero at a JSON object should there be no setting at all.
  2. using Newtonsoft.Json; as a namespace is used, and slapped on the class itself is [JsonObject(MemberSerialization.OptOut)] while [JsonIgnore] on a getsetter creates an effect which will keep that getsetter from making a dancer partner for itself at the JSON object that will be made for the ViewModel.

 
 

Addendum 6/2/2018: I think the wizard kicks in when one right-clicks on the Controllers folder and picks Add > Controller... in lieu of Add > New Item...

There is a way to make photos NOT be live photos at the iPhone X!

If you go to take a picture the icons across the top of the interface from left to right are:

  1. a lightning bolt for the flash
  2. a donut inside of a circle with a thinner line inside of a circle made of a dotted line for the live photo stuff
  3. a clockesque icon for what I imagine is a timer for a delayed... (yes, I just tested it and it is for time delayed photos)
  4. three circles overlaying each other a bit in sort of a Venn diagram way for tweaking the RGB spectrum

Toggle the second icon to turn off the live photo stuff if you like.

ICO as an acronym

Alright, and .ico file, kinda like a .cur file for a cursor, is for desktop icons and the icons that lead a URL in a browser menu bar right? ICO as an acronym however stands for Initial Coin Offering which is like an IPO (Initial Public Offering) for a cryptocurrency conflagration. I am not going to set a research spike for myself to understand this stuff. I'm doing the bear minimum / bare minimum on understanding the crypto stuff like NASA (National Aeronautics and Space Administration) is in spacefaring. The Oculus Go is the cheapo lightweight version of the Oculus Rift. I digress.

Why can't I see the tool menu icons in Visual Studio 2017?

I'm lost without that little green arrow to start debugging. Whatever am I do to? To get the images to come back, close Visual Studio 2017, delete the ImageLibrary.cache file at C:\Users\Thomas\AppData\Local\Microsoft\VisualStudio\15.0_6848ab89\ImageLibrary, and then reopen Visual Studio 2017. The "Thomas" and "15.0_6848ab89" folders in your path out to ImageLibrary.cache are going to have different names in your environment obviously. Duh. While figuring this out I bumped into two other interesting things:

  1. https://developercommunity.visualstudio.com/content/problem/94502/visual-studio-2017-153-toolbar-icons-are-missing.html had the fix and upstream of the copy I needed there was some copy that suggested that I run devenv /Log at the Developer Command Prompt for VS 2017 and I found the Developer Command Prompt for VS 2017 in a "Visual Studio 2017" folder at the start menu.
  2. When the toolbars actually vanish from Visual Studio you may right-click in the top nav and pick "Standard" or "Debug" or whatever to unhide the toolbars you need.

Wednesday, May 30, 2018

memory leak in the form of redundant API calls in the Redux pattern?

Well, where I have seen this happen is in an Angular 4 application using NgRx for the store stuff though NgRx really has little to do with it. In the circumstances I have seen there will be a call to a selector in an ngOnInit, ngChanges, or constructor of an Angular component, and the fact that this lifecycle hook is being hit more than once is at first invisible and then must be troubleshot over time as it turns out something is wrong. This can come from a component being instantiated anew in, for example, the case of the constructor, and one way to keep that pain from being pervasive is to adopt a pattern that uses smart and dumb components and only have the outermost actor in the Russian doll hierarchy speak to the store. If you are breaking with as much, you may want to keep an identifier for selecting with a selector such as the unique id for a record or a string for a search term in a private field inside of the component and only call the selector if the term has changed since the last time the attempt was made. (Wall it off with some if statement logic.) Obviously, an initial attempt will have a different find-with-me key than a null value. This should not work with a constructor if the component is really getting instantiated anew I suppose. In the case of the particular application I am working on I'm not sure what gives. This has a thread on a scenario in which a constructor for a component can run twice if the component is just bootstrapped badly. That seems buggy. If you are calling out to a selector from ngOnChanges you may use SimpleChanges to filter which inputs have been updated and only react when applicable in the name of not redundantly going to the API. That makes me happy.

ViewModel

A ViewModel is a DTO that makes its way all the way up to the UI, hydrating datapoints in views. As a DTO it is something other than what Valerio De Sanctis refers to as a "model domain object" on page 75 of "ASP.NET Core 2 and Angular 5" and is instead a DTO made from the miniETL processes that we undertake to transform our core objects into more suit-to-purpose ones.

SOQL is Salesforce Object Query Language

This showed up in some spam for a PHP developer's job I got in my e-mail yesterday. The same job ad mentioned Apex, an OOP language for SalesForce. An old program I thought of by myself was Tree Alias. This was a plugin for 3D Studio MAX that made trees. You could customize what type of tree, density of branches, etc. I mean literal trees not workflow trees.

Wireless capability is turned off

https://superuser.com/questions/455171/how-can-i-turn-on-wireless-capability-in-windows-7 suggested that I type "Network Connections" in the Windows 7 start bar and then right-click on the wireless properties and pick: "Configure" ...alas I am not the administrator on my PC so I cannot solve this problem myself. The "Wireless capability is turned off " appears on Dell laptops and you need to "Turn on wireless capability" to fix it.

binary

Beyond the ones and zeros of the eight bits in a byte, the term "binary" can imply a scenario where there are strictly two options and no real wiggle room beyond that. For example a human being is either male or female. I know that statement may draw a lot of ire but I don't think there is a single example of a hermaphrodite human with two sets of working junk. Any hermaphrodite either leans male or leans female.

Tuesday, May 29, 2018

Ceremity, the consultancy, and its client: UPS

Ian Shirley, rightmost below, and I both started at Ceremity (pronounced Sir Remedy) as developers on May 17, 2017. We were never much at Ceremity's Katy office, but were instead deployed to a client, UPS (Universal Plant Services), in Deer Park on the other side of Houston. Some documentation of the adventure follows.

 
 

Amer Ismail (at Ian's right above) had worked at Ceremity in a similar situation for fifteen months before becoming a full time UPS employee. Ceremity was the first consultancy I had encountered that allowed its own to be hired by its clients eventually. Anyhow, June 20, 2017 was the first day Amer was a UPS employee and the photo here is from a lunch outing at Tony's Fish Gallery in Deer Park. At the head of the table is Tim Baldwin, also a Ceremity-to-UPS convert, and at Tim's right is Johnny Lopez of Ceremity. James Stacey of UPS sits leftmost in the photo above.

 
 

This photo (taken at the token Chipotle in Deer Park, Texas on 9/20/2017) shows from left to right: Amer Ismail of UPS, Brittany Stacey of UPS, Stephanie Grizzle of UPS, Paul Rice or Ceremity, and Ian Shirley of Ceremity. Brittany was both my immediate UPS-side boss and the wife of James Stacey. Stephanie and I went to college together at T.S.T.C and though I had not been in the same room with her for eighteen years when I interviewed, she was my in for this opportunity. Paul Rice was Ceremity's CTO and he and Tim Baldwin went to the same Houston area high school (Cy Falls) and for a while I assumed that they knew each other in high school. I later found out that Tim was many years ahead of Paul though they did share a common computer science teacher. There were three different girls named Brittany at work and White Brittany here was not to be confused with Black Brittany (Britni Jackson) or Latin Brittany (Brittany Diaz).

 
 

My superior at Ceremity was a guy named Jermaine Gonzalez who is at the right here. Nikol Nikonchuk, also with Ceremity, stands in the middle. On October 18th of 2017, a Wednesday, we got together at Revelry on Richmond, a random Houston sports bar deep in the city, for a happy hour (though I don't drink) to celebrate the 44th birthday of Ceremity's Kent Masden who is at the left.

 
 

The woman at the lower left is an Amy Collak who worked at Ceremity here and there doing odd tasks such as maintaining the Facebook page and procuring swag, but more interestingly she was the wife of the CEO, a Vlad Collack, and, yes, that is Vlad sitting beside her. This picture was taken on the last day of November of 2017 at the company holiday party at Batanga, a bar/restaurant in the heart of Houston. Gayle Irwin of human resources sits across from Vlad and Stephanie Dowty, who approved expense reports, is at her left in the lower right of the photo.

 
 

James Wang of Ceremity flaunts the tacky sweater here while Amer Ismail of UPS is the better-dressed party. This photo was taken on 12/16/2017 at the UPS Christmas party at Goode Company Barbeque in Houston. I'm going to say this is the best job I have had in spite of the photos growing progressively darker. Don't read too much into that. It was also good to work with Eboni Hampton, Laura Wickliff, Bhashwar Bhattarai, Shawn Strickland, Pete Webb Jr., Rob Schaffner, Shane Clarke, Cara Smith, Ian Morrison, Noe Vasquez, Chris Speight, and Lan Cui. It was NOT good to work with Brandi Wilborn.

Saturday, May 26, 2018

In IRC Chat the IRC stands for Internet Relay Chat.

IRC is a protocol for... chat.

I finally figured out how to do mocking with Moq in .NET Core!

The process:

    • In Visual Studio 2017 go to: Tools > Extensions and Updates...
    • Pick "Online" at the left.
    • Searching for "xUnit" at the upper right should find "xUnit Test Item Template"
    • Install it.
    • create a new xUnit Test Project (.NET Core) and be sure it is .NET Core and not .NET Framework
    • go to: Tools > NuGet Package Manager > Manage NuGet Packages for Solution...
    • Search for "xunit" across the top by: Browse, Installed, Updates, and Consolidate
    • I installed xunit.runner.console, xunit, and xunit.analyzers all three!
    • Search for "moq" and install Moq next!
    • add a reference to the .NET Core project you wish to test
    • write some tests!
    • run tests at: Test > Run > All Tests

 
 

Here is a class I tested.

namespace MockingBird
{
   public static class StaticMagic
   {
      public static string AddSix(int value, ICalculator calculator)
      {
         return value + " + 6 = " + calculator.Add(value,6);
      }
   }
}

 
 

Here is the interface I used in the class I tested.

namespace MockingBird
{
   public interface ICalculator
   {
      int Add(int yin, int yang);
      int Subtract(int yin, int yang);v    }
}

 
 

Here is the test I wrote.

using MockingBird;
using Xunit;
using Moq;
namespace MyTests
{
   public class UnitTest1
   {
      [Fact]
      public void Test1()
      {
         
//arrange
         Mock<ICalculator> calculator = new Mock<ICalculator>();
         calculator.Setup(c => c.Add(It.IsAny<int>(), It.IsAny<int>())).Returns(9);
         
         
//act
         string calculation = StaticMagic.AddSix(3, calculator.Object);
         
         
//assert
         Assert.Equal(calculation, "3 + 6 = 9");
      }
   }
}

 
 

I got turned around to go the right direction on this stuff after looking at a PluralSight training by a Jason Roberts on the subject. He said some interesting things along the way such as naming a variable sut and explaining that it stood for "System Under Test." He lists the four test doubles as Fakes, Dummies, Stubs, and Mocks instead of Spies, Dummies, Stubs and Mocks, and suggests that Moq can facilitate Dummies, Stubs, and Mocks. He suggests that Fakes are implementations of interfaces that are actually wired up to do things like talk to a predictable staged database such as the EF (Entity Framework) Core in-memory provider in lieu of a production database.

Friday, May 25, 2018

I saw Beth Carretto speak on Angular Elements on Wednesday night.

This meeting was one of the STL Angular Meetup meetup.com meetings out at Bullhorn and Beth Carretto is a UI Engineer at Bullhorn itself. Bullhorn doesn't really use Angular Materials itself. Ms. Carretto just goofed off with them some now that they are an official part of Angular (as of Angular 6's release) and no longer an experimental undertaking of Angular Labs. Lance Finney was at this event. I chatted with him some. He mentioned that the Ivy compiler is coming out later this year, and Beth stressed that it will reduce the size of Angular Elements and get them manageable such that they are something you might actually want to use without an unrealistic load time. The Bazel build tool system will allow you to play with Ivy. Lance also mentioned that he was going to present remotely the following night at Bonnie Brennan's ngHouston user group. Apparently, the "Tour of Heroes" app has five unit tests in it and three of them have broken over time as the version of Angular has changed and Lance's talk was on how to get them working again. I see stuff in temporary disrepair all the time in the Angular space. After Angular 6 came out the CLI wasn't immediately ready to make an Angular 6 application, etc. I'm wandering off topic, I know. Beth showed off that you may basically include in a plain Jane website that has no Angular code a script tag to reference one .js file and then, downstream of that, you are good to go to just have a selector tag for your Angular Element as if it were a component. Whatever page crawling magic there must be to make sense of the tag is just part of what is packaged up in the token .js file. You may have a module, a component, and the template for a component as three separate files when you work and they all will become a smorgasbord of code in the .js file you will make. Nice. When you find yourself getting underway ng add @angular/elements as an Angular CLI command will loop in Angular Elements and ng g component -v Native sets ViewEncapsulation.Native which is needed for some Shadow DOM magic. Polymer Elements and Angular Elements are rival ways to do web components and Joshua Godi who runs this meetup (with Elizabeth Carretto as she is stepping up as of this meeting) mentioned that a company called Vaughton has done some work in getting Polymer stuff to run in Angular apps. I think there might be some videos online. I'm not sure how Josh Godi spells Vaughton as I can't find them in Googling.

 
 

Addendum 5/26/2018: There is a Slack channel for STL techies and I see someone mentioning MAMP on there right now (well, in yesterday's stuff) which Wikipedia says is like LAMP only with macOS in lieu of Linux. I had to look it up so I learned something. I forgot to mention yesterday that Beth invited me into this group on Wednesday night. It reminds me of the los techies Slack channel of Austintexasland. Los Techies was named for the Dos Equis beer whose name means "two X" in Spanish and that has nothing to do with anything.

I thought of flip phones in the night.

Jitterbug is some sort of flip phone that has a target demographic of old people. It has big buttons for the old people which is kinda condescending. Think of that stereotypical comic old man's voice saying "I like big buttons. They make me feel safe." and you'll understand the marketing. I think you can still get these. Everyone remember Alltel and their TV commercials from ten years ago that said "Come and get your love!"? Flip phones were legit ten years back. The iPhone hasn't been around for ten years yet.

Cricket Wireless

... is an LLC (limited liability company) owned by AT&T (American Telephone & Telegraph). Yes, this is yet another wireless service provider.

Thursday, May 24, 2018

Bandcamp

...might be the way for bands to promote themselves now that no one uses Myspace anymore. It sounds like you may make a little microsite for your band and share some songs. There was a thread from Best Fwends about uploading unpublished songs to Bandcamp this morning so I wondered what Bandcamp was.

Salt and SaltStack

Wikipedia suggests: "Salt (sometimes referred to as the SaltStack Platform) is a Python-based open-source configuration management software and remote execution engine."

TimeFlip is a dodecahedron that updates an app on your phone whenever it changes sides.

Basically your phone is keeping track on how long you are on a particular side and thus if you are updating the twelve-sided Dungeons & Dragons die with pentagon faces every time you change one of the twelve things you could be doing in a day you will have a breakdown of how you spend your time in a given day. I'm not making this up. See: this

You may use the async pipe to translate an Observable of Foo into just a Foo in handing things down from one component to another in an Angular 4 application.

<my-thing [yin]='yang | async'></my-thing>

Console.Beep();

This is legit C#. It makes a beeping noise. This is real! A way to beep in the JS space might be with: https://www.npmjs.com/package/beeper

Wednesday, May 23, 2018

Paymetric was alright.

I worked there for two and a half years and it was basically a great place to work all the way up to the bad ending. Naturally, the bad ending ruins a lot of the good memories. Whenever I think of Paymetric (every day) it's like I am taking a sip from a glass of milk and then wondering if I've let the milk sit out too long.

 
 

This is from a Cinco de Mayo of 2014 event which was also to celebrate the fifteenth anniversary of Paymetric even though that anniversary happened over half a year earlier. From left to right are James Osborn, Eric Carpenter, Bridget Richards, Sabrina Mahmood-Fulzele, Rick Cymbalist, Jamie Blaser, and Travis Barrs.

 
 

This is also from the same outing at a Mexican restaurant called Gloria's on Austin's 6th Street. The faces from left to right are those of Albert Muniz, Ian Flanagan, Dip Manandhar, and Michael Dozier. Chris Brown has his back to us at far right.

 
 

Just two days later there was another outing. This one was a happy hour in celebration of Eric Carpenter (left) getting married, but the day was also the birthday of Dustin McCoy (right).

 
 

The festivities for the Eric-gets-married thing were at a bar called Rattle Inn. From left to right are Helen Ledbetter, J.D. Gonzales, Joey Fadem, Steve Dinan, Dustin McCoy, Eric Carpenter, and Joey Robinson.

 
 

Steve Dinan is pictured here. Again, this at the same event as the last two pictures.

 
 

This photo was taken a week after the last set of photos and nine days after the first set of photos. We had a team builder outing to Topgolf which is a driving range. Munnawar Hussain is pictured.

 
 

This is also at the Topgolf event. From left to right are Eric Carpenter, David Nguyen, and Rachel Chesmore. This was taken the day after Eric got married. Rachel and David were visiting from Houston and Munnawar was visiting from Atlanta.

 
 

David Nguyen is closest to the camera in this picture. Munnawar Hussain is second farthest away and J.D. Gonzales is the third farthest away. This is also at Topgolf. That group of three guys in the back are, from left to right, Albert Muniz, Dustin McCoy, and Geary Voots.

 
 

The second to last photo I will offer comes two days after the last set of photos, nine days after the set of photos before that, and eleven days after the very first set of photos. Joey Robinson (left), J.D. Gonzales (right), Ian Flanagan (black shirt), and I went to la BARBECUE over lunch.

 
 

Alright, I know this picture is a landscape instead of a portrait like the others, but that is fitting because it is different in other ways too. The first nine pictures were taken during the beginning of my time at Paymetric, but this one comes near the end. This photo was taken at a lunch outing at a Chi'Lantro for Rick Cymbalist's thirty-ninth birthday eight hundred twenty-two days after the first two photos, eight hundred twenty days after the third, fourth, and fifth photos, eight hundred thirteen days after the sixth, seventh, and eighth photos, and eight hundred eleven days after the photo immediately above. If you can figure out when that is, you'll know Rick's birthday! Remember that leap years have three hundred sixty-six days in them in doing the math. Going around the table clockwise from where I am sitting are Rick Cymbalist, Nick Powell, Sabrina Mahmood-Fulzele, Manogna Velagapudi, Dakotah Hicock, Deepika Nim, Bridget Richards, and J.D. Gonzales. I miss you fools. It was also good to work with Yelena Green, Kristen Teter, Angela Garza, Asif Ramji, Adrienne Rogers, Vlad Karpov, Graeme Jones, Clayton Walter, Tom Craig, Angela Holcomb, Rie Irish, Eric Bushman, Scott Braunhardt, David Streeter, Sergio Valdez, John Reese, Lauren Allen, Rohan Nigam, Jimmy Cox, Parisse "PJ" Spelios, Sudha Dabbir, Max Belousov, Bill Wied, Jeff Burkett, Lisa Gschwind, Taofeek Lawal, Brian Nguyen, and Mike Rivers. I'm kinda sorry I never got to work with Robert Newell after all of the stories I heard. Hey, I bet they are telling some stories about me back at Paymetric!

too many unreachable loose objects

This is a git error and the git prune command line command may or may not help. I don't have the problem myself. I am hearing of the problem secondhand. Here are some links I found:

iOmega

Now a Lenovo company, these guys are the guys who made Zip drives and Zip disks. I remember they just put want ads in the newspaper for CEOs.

The existing whois registry system for domain names is not compatible with GDPR.

The whois stuff is going to have to go away.

Tuesday, May 22, 2018

What if I want to do something like the spread operator of TypeScript in JavaScript?

Well, you are in for some pain! The TypeScript Playground translated this TypeScript...

let whatever = {
   foo: true,
   bar: 42,
   baz: "Belgium",
   qux: {
      yin: new Date(1974, 8, 24, 6, 0, 0, 0),
      yang: function(input) {
         alert(input);
      }
   }
};
let somethingMore = {
   ...whatever,
   bar: 13
};

 
 

...into this JavaScript:

var __assign = (this && this.__assign) || Object.assign || function(t) {
   for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];
      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
         t[p] = s[p];
   }
   return t;
};
var whatever = {
   foo: true,
   bar: 42,
   baz: "Belgium",
   qux: {
      yin: new Date(1974, 8, 24, 6, 0, 0, 0),
      yang: function (input) {
         alert(input);
      }
   }
};
var somethingMore = __assign({}, whatever, { bar: 13 });

 
 

, { bar: 13 } disappears from the JavaScript when bar: 13 is removed from the TypeScript.

JQL is the query language for Jira searches

project = "Make Money" AND (assignee = currentUser() OR assignee = U618777)

...is an example of JIRA Query Language I suppose. This has a cheatsheet of things you may filter against when searching tickets. To do something like the example above, have your pairing partner click on his avatar at the upper right and then pick "Profile" to get at the "Username" for the end of the search and look at any one JIRA ticket for your project to get the magic string for the project name which will appear above the largest text on the page offering the ticket's name as a hyperlink. Clicking the hyperlink takes one to a URL and therein projectKey= appears as a URL line variable and the setting at the right of the equals sign is going to be an encoding that leads all of the ticket numbers for the project. If you try to put it in the search bar some intellisense will find the magic string for the project name for you, but really you can just paste the magic string from the hyperlink in and skip that step. See this for how to get at statuses.

It may not be good UX to have every table be 100% wide.

What if you have a table with just a few columns and it so spread out that a column holding one digit numbers is spread out one hundred pixels wide? Not cool. You may want to use the max-width CSS setting and set a maximum width in lieu of having the less imaginative width: 100%

decorators in TypeScript

This touches on them some. I made the following in playing with a decorator that throws first 13 and then 42 in alerts.

function tusk(constructor: Function) {
   constructor(13);
   alert(this.fatness);
}
 
@tusk
class Walrus{
   fatness: number;
   constructor(_fatness:number) {
      this.fatness = _fatness;
   }
}
 
let walrus = new Walrus(42);
alert(walrus.fatness);

 
 

The walrus example doesn't make any sense, does it?

hugohd.com

Is an in browser editor! You can hand in a URL from elsewhere and it will make an image that you may mess with with crummy photoshopesque tools and then save off to another URL.

I've noticed that when I play a YouTube video on my iPhone X (via the default web browser) that at the end I see an icon of a circular arrow pointing counterclockwise back on itself to replay the video.

That solves this problem for my phone.

the Performance tab at Google Chrome Developer Tools

Click F12 to open Google Chrome Developer Tools in Google Chrome and then go to the Performance tab. Click the record button at the upper left and you will be able to record a snapshot of the web traffic and JavaScript interactions and memory leaks until you stop recording. The span of time you recorded will present itself to you in a timeline once you've stopped recording and there are all sorts of esoteric things to drill into on the timeline in the name of understanding lag.

SimpleChanges is not simple.

Following up on this and this, something like this at an Angular 4 component...

ngOnChanges(changes: SimpleChanges) {
   console.log(changes.myInput);
}

 
 

...is going to log what is in an input like so...

@Input() myInput: any;

 
 

...when it changes and otherwise log undefined to the console. The undefined will show up even if the Input is hydrated, but not hydrated at that particular moment, that is: set earlier but not of concern RIGHT NOW! Just today I saw some head exploding magic wherein this.myInput (not changes.myInput but this.myInput) would survive a truthy check (and allow for code in an if statement to be run) inside of ngOnChanges twice without the SimpleChanges at the method signature and yet only once with it there! This was with ChangeDetectionStrategy.OnPush in the mix too. This would suggest that SimpleChanges can warp the nature/performance for ngOnChanges beyond merely providing metadata! Shocking shit!

Monday, May 21, 2018

Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.

You are trying to iterate through a collection of things that isn't a collection at all. That is what this error means. Instead of a dentist looking at all the teeth in someone's mouth, it's like a dentist looking at all of the teeth in someone's tooth. It doesn't make sense. Get it?

FPS stands for first person shooter.

It's a genre of game. RTS is real-time strategy.

Saturday, May 19, 2018

DPSers

Damage Per Second is what the acronym DSP stands for, though the meaning of DSPer strays from that a hint. In a gaming context a DPSer is someone who can deal a lot of damage. This is a different stereotype than a tank who is someone who can hit hard and be hit hard. Instead a DPSer can hit harder than the tank but can't really take a beating. It's more lopsided. Think of the frail old man wizard who is throwing a fireball. Healer is another stereotype alongside DPSer and tank in this vein of things. When I actually used to play Dungeons and Dragons there was, from the beginning, the concept of classes such a fighter (tank), a cleric (healer), and a magic-user (DPSer), but the broader containers in which I suppose both fighter and barbarian fall under the broad use of the "tank" term are newer things I've only brushed up against since 2009. These are some geek speak generalities.

light-emitting diode is what LED stands for

These are the modern lights and not the old tungsten-based lights which brighten a wire made from a spiral of a spiral of maybe a third spiral yet (are there three?) that can only be made of tungsten. There isn't lead in pencils anymore either. We use graphite these days. Honestly I never use pencils. I wander, I know. dictionary.com's definition for a diode is: a device, as a two-element electron tube or a semiconductor (substance, as silicon or germanium, with electrical conductivity intermediate between that of an insulator and a conductor), through which current can pass freely in only one direction

Siri

Wikipedia says: "Siri is a virtual assistant part of Apple Inc.'s iOS, watchOS, macOS, and tvOS operating systems." This appeared with the release of the iPhone 4S.

I saw Levi Joseph speak at the St. Louis .NET User Group on being a data scientist on Monday night.

Levi, is specifically a data scientist at Sense Corp at its Austin locale (well Rollingwood, Texas) not it's St. Louis locale and was quick to mention that being a data scientist in terms of a title may be something that comes and goes like "webmaster" as things evolve over time. Right now data science is in its infancy and is as wishy-washy in terms of definition as being a "webmaster" was. Levi offered a few definitions that he liked for being a data scientist and amongst them where: Data science is the generalized extraction of knowledge from data. One of his slides had a Venn diagram with three circles labeled Domain Expertise, Computing Skills, and Math & Statistical Knowledge and in the middle, where all three circles overlapped a little bit, was Data Science. The field of data science where Levi spends most of his time is in preventive maintenance. If you've collected a bunch of data on when airplane parts fail, you can predict when airplane parts fail and also predict RUL (remaining useful life) for parts in quantity of hours and also full life, which is a different metric, along the same lines and be flagged if a part is so error-prone that you should abandon it and use a different part from a different vendor, etc. This creates a cost savings in the big picture. If you are doing this and your competitors are not, you have a leg up. Levi spends a lot of his time doing the ETL work to get existing collected data into shape for his customers such that numbers fall into a decimal range between zero and one and the like. Time of failure is the reciprocal of RUL. SSDT (SQL Server Data Tools) which allow you to model data and play nicely with Azure beyond just SSMS (SQL Server Management Studio) and also, yes, SSMS were name dropped and recommend. Bespoke was name dropped too. A glance at their website makes them look like consultants in their space to me. I don't know if they offer tools too. Azure IoT is the best for managing IoT data right now. RStudio is the IDE for R which is the language Levi uses the most. DataRobot is the best tool for machine learning, a subfield of artificial intelligence for, over time, recursion for better performance. Microsoft Azure Machine Learning Studio is also legit as is ML.NET from Microsoft for machine learning. Beyond the name dropping of tools, there was some name dropping of statistics terms:

  • True Positive — We predicted it. It happened.
  • True Negative — We predicted it would not happened and it didn't.
  • False Positive — We predicted it, but it didn't happen.
  • False Negative — We predicted it would not happen, yet it happened nonetheless.

Classification has to do with separating a dataset into two categories and regression has to do with finding a direction things are trending. Overfitting and underfitting are important terms in regression logistics. In charting how an airplane part may decay over time in reaching the end of RUL and complete life beyond that there may be some checkpoints along the way. I dunno, maybe warranty expiration comes before end of RUL typically. Anyhow, in writing an algorithm that perfectly hits all of the points in time predictively, one is guilty of overfitting. You are going to be writing some silly rules to be turning some tight corners and you'll introduce noise to the algorithm that isn't very good at palm reading the future. You need to come near some of the plot points not hit them. Loosen up your rules to where they make sense. If you loosen up too much though you are guilty of underfitting, the act making an algorithm too vague to be predictive and helpful. Underfitting has high bias and overfitting has high variance. Somewhere in the middle is the "just right" Goldilocks porridge. A distinction was made between Weak AI and Strong AI in the artificial intelligence arena. Weak AI can make a narrow set of decisions like a chatbot. Strong AI is the Skynet from Terminator stuff and while there are plenty of examples of Weak AI actively a part of the tech sphere today there is no Skynet and Levi expressed pessimism about humanity ever getting there. The most impressive work being done in AI has a team of PhDs at Google putting the "um" pause in computer generated speech to make it seem more lifelike. We are a long way from falling in love with Scarjo's voice in that "Her" movie I never saw. IBM and Bell Labs chips have been doing the "computing skills" part of the Venn diagram for years, but now the laptop of Average Joe is starting to be able to compete. IBM is kinda in decay in the data science space as there is just constant firefighting with Watson. Microsoft is doing better and better in the space. The SAS (Statistical Analysis System) company that makes the SAS language is a major player too, but SAS the language is losing market share to Python and R and going the way of FORTRAN (name means Formula Translation). R is doing better than Python presently, but Python looks poised to overtake it. A Matthew Bowers, a dBase III (an early database for personal computers or microcomputers if you will) programmer, gave the opening lighting talk before Levi Joseph spoke. He spoke to the Uber Effect in which small businesses disrupt established ones such as Uber killing taxicabs or Amazon killing Barnes and Noble (or at least Borders Group) or Netflix killing Blockbuster and posed the question "Are you going to be a disruptor or the disrupted?" (I'm paraphrasing a hint.) Good CX (customer experience) depends on understanding your customers and by 2020 there should be fifty billion devices cross talking with the internet, so if you don't understand what is behind your revenue stream as a business owner, well...

Friday, May 18, 2018

You don't have to push one thing at a time to an array in JavaScript.

Here is an example of pushing in three objects at once which is perfectly legit.

var foo = [];
var bar = {
   yin: 13,
   yang: 23
};
var baz = {
   yin: 27,
   yang: 42
};
var qux = {
   yin: 69,
   yang: 86
};
foo.push(bar, baz, qux);
console.log(foo);

loop in things from the node_modules folder into your Express application

var _ = require('lodash');

 
 

...at the top of app.js (or another file looped in) is going to loop in lodash assuming there is a folder in the node_modules folder titled "lodash" to be found. You may then do all of the lodashy things with a dot off of the underscore downstream in code like this:

_.groupBy(['one', 'two', 'three'], 'length');

 
 

Per the documentation the line of code above gives us:

{ '3': ['one', 'two'], '5': ['three'] }

 
 

It looks like you can do some fat arrow stuff like x => x.length for the second argument too but I digress.

Ctrl-K followed by Ctrl-+ might be the way to delete whitespace from a file in Visual Studio 2017.

I read about it here which advertises a plugin called Trailing Whitespace Visualizer by Mads Kristensen which colors the whitespace pink apparently.

Bootstrap 3 is going to have a print.less file.

It's going to start out like this...

@media print {
   *,
   *:before,
   *:after {
      background: transparent !important;
      color: #000 !important;
      box-shadow: none !important;
      text-shadow: none !important;
   }

 
 

...and you have to mess with it to get it not to print your web site to a PDF in black and white. I don't really understand it yet. A coworker puts color hex code in for the color and the background and somehow that works for him. Crazy! I do not see how that even compiles.

Thursday, May 17, 2018

Don't expect foo++ or foo-- to actually change foo as a number in an assignment when making a JSON object.

In JavaScript, you must explictly use +1 and -1 in these scenarios. The ++ and the -- are legit ways to alter variables in other circumstances however. This is bad:

var foo = 6;
var yin = {
   yang: foo++
}
console.log(yin);

 
 

But, this will work...

var foo = 6;
var yin = {
   yang: foo + 1
}
console.log(yin);

 
 

...and this work too:

var foo = 6;
foo++;
var yin = {
   yang: foo
}
console.log(yin);

Nethammer

A pitfall of DRAM (dynamic RAM) is row hammer (or rowhammer) which may be used to screw up slots of memory and have that effect bleed into other places and problems as suggested here. Wikipedia says: "The LPDDR4 mobile memory standard published by JEDEC includes optional hardware support for the so-called target row refresh (TRR) that prevents the row hammer effect without negatively impacting performance or power consumption." and "Mobile DDR (also known as mDDR, Low Power DDR, LPDDR, or LP-DDR) is a type of double data rate synchronous DRAM for mobile computers." and "The JEDEC Solid State Technology Association is an independent semiconductor engineering trade organization and standardization body." where JEDEC stands for Joint Electron Device Engineering Council. JEDEC is a joint collaboration between EIA (Electronic Industries Alliance, formerly RMA or Radio Manufacturers Association) and NEMA (National Electrical Manufacturers Association). Anyhow, Nethammer is nonetheless a way to hammer rows via network requests.

It's bad UX to bring up a modal or a dialog box or even a pop up and simultaneous have a bunch of changes occurring on the page beneath.

The backdrop should not yell for attention and compete with the overlay in these scenarios.

Rockford Lhotka made a code generation tool that generates canned classes in C#.

It is called CSLA.NET. It works with Xamarin for example and also UWP (Universal Windows Platform) stuff (a standard for compatibility). It works with most .NET use cases at a glance.

Truecaller

...by True Software Scandinavia AB of Sweden is an app that finds contact details and other metadata for phone numbers. AB stands for Aktiebolag which translates "stock company" and is like LP or LLC or Inc. following a company name in the United States.

Wednesday, May 16, 2018

How may I turn off the caching of static files in a .NET Core Angular 5 application?

Per "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis is you change this line of Startup.cs...

app.UseStaticFiles();

 
 

...to...

app.UseStaticFiles(new StaticFileOptions()
{
   OnPrepareResponse = (context) =>
   {
      context.Context.Response.Headers["Cache-Control"] = "no-cache, no-store";
      context.Context.Response.Headers["Pragma"] = "no-cache";
      context.Context.Response.Headers["Expires"] = "-1";
   }
});

 
 

...supposedly that does the trick. It really didn't do anything for me. "Pragma" implies use of pragmatic or implementation-dependent features I bet.

 
 

Addendum 5/17/2018: "max-age=3600", "cache", and null would be some alterative settings for the three settings above that would empower caching instead of turning it off.

Aniemoji

This is a feature at the iPhone X. If you go to text someone you will probably see the monkey as an option and if you don't you can probably click on that icon that looks like a picnic table (to me) at the right of the camera icon to unlock this and other icons. When you click on the monkey icon you will have access to Aniemojis which are animals which mimic what your own face is doing. (The camera on your phone is looking at you.) You can record an audio message of an animal talking and making faces and then send it as a text message out to others.

how to suck files into other files in an Express app

At the last line of mySecondaryFile.js you could have something like...

module.exports = { foo, bar, baz, qux };

 
 

...or...

module.exports = foo;

 
 

...and then towards towards the top of app.js you could have:

const secondaryStuff = require('./somewhere/mySecondaryFile');

 
 

You could then use the foo like so...

var whatever = secondaryStuff.foo(13);

 
 

...assuming that foo is a function that takes a number and then returns something and also assuming that foo was one of many things enclosed in curly braces as shown in the first line of code above. If foo alone is the assignment value in the last line of code at mySecondaryFile.js as shown in the second line of code above then you need to do something like this:

var whatever = secondaryStuff(13);

 
 

Why can't we have an ASP.NET Web API application for the server? It's all so ghetto. It's like I'm in a bad horror movie expecting Lance Henriksen to show up.

Tuesday, May 15, 2018

two different points of entry into a .NET Core Angular 5 application

At a .NET Angular 5 application, as set up in Visual Studio 2017 with .NET Core 2, boot.browser.ts in the root of the ClientApp folder finds AppModule at components/app.module.browser.ts for the outermost module of an Angular 5 application while boot.server.ts in the root of the ClientApp folder finds a different AppModule at components/app.module.server.ts for the outermost module of an Angular 5 app. Both loop in as an import AppModuleShared at components/app.module.shared.ts and this file contains everything that is in common for the AppModule approaches and there is more in common than not in common. This is really an example of how to do pseudoinheritance with modules. From here both AppModule approaches find AppComponent at components/app/app.component.ts for a first component and from there one drills down to other components. The boot.broswer.ts file is for client-side loading and the boot.server.ts file for SSR for SEO. Page 56 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis touches on this.

another place to try to turn off autoformatting in Visual Studio Code

There may be a ".vscode" folder in the root of your source code with a settings.json file in it containing:

{
   "editor.formatOnSave": true,
   "workbench.editor.enablePreview": false
}

 
 

You will want to set the true above to false. Also, in case the file contains a different setting for the size of tabs, you will want to take that setting out of the JSON object altogether. Specifically "editor.tabSize": 2 should go away.

Just Walk Out Technology

...empowers Amazon Go which is both an app and a grocery store. You swipe your smartphone at a check in point (using the app) to enter the brick and mortar store and then you take whatever you want from the store without checking out at a register and when you leave your Amazon account is billed. There is only one store so far, in Seattle.

Monday, May 14, 2018

Stripe Atlas

...as a service will help you incorporate a business, do the paperwork, set up a bank account for it all, set up a merchant account, and bundle all that into a nice package.

Sunday, May 13, 2018

the ClientApp folder setup in a .NET Core Angular 5 application

Page 53 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis touches upon it. There are three folders immediately inside:

  1. app holds the application files
  2. dist holds the files that compile for deployment
  3. test holds the unit tests

There are also two files immediately inside of the ClientApp folder not inside of these three folders. boot.browser.ts finds the outermost module in the Angular 5 application and does similar critical wire up to get things running. boot.server.ts helps build the dist folder utilizing Angular Universal's Server-Side Rendering (SSR) as implemented in Microsoft ASP.NET Core JavaScript Services.

 
 

Addendum 5/26/2018: I think Angular Universal just implies the SSR stuff. There is no Angular Universal beyond it.

Saturday, May 12, 2018

another reminder that JavaScript is not C#

When you hydrate an object from an Observable in an Angular application, do not expect values landing at the set half of a TypeScript getsetter to run the setter logic and hydrate a private field while perhaps doing something else and something more. Instead you are merely monkey patching over the getsetter with a new field and destroying any robust functionality for the get that might be to boot too. The constructor at your TypeScript class ain't gonna go off neither, I reckon. We're kinda slummin' it, huh?

Friday, May 11, 2018

Did you know there is audio with every live photo on the iPhone X?

Obviously, every picture is a little movie, but if you press your finger against a live photo and wait you will get audio with the movie and the movie will turn out to be a little longer than you thought.

A pattern for abstract classes?

I had a conversation with a coworker today in which he described his answer to a "When should you use abstract classes instead of interfaces?" interview question. I would have just answered "never" but his answer gave an example in which a Manager (class) inherited from Employee (abstract class) and I suppose if there is a use case for the nasty abstract classes in C# that might be it. In this paradigm there are many types of employees but each employee has to have a distinct role. There are no generic employee employees. An employee would have some generic employee machinery however perhaps creating the need to keep some common methods in one place.

Android P is the ninth major version of the Android operating system.

There is a Wikipedia write up of it here.

vevo

Is another site like YouTube for looking at video clips. Go to vevo.com to see it.

robocalls

Wikipedia says: "A robocall is a phone call that uses a computerized autodialer to deliver a pre-recorded message, as if from a robot."

frames

Just as you may have an iFrame, you may have frames splitting a page into two or three frames. In these scenarios, the HTML page has nothing in it other than orchestration for the frames and then the guts of any one frame itself is kept in another file. The page you are actually landing at per the URL line is thus sparse in content and this approach is bad for SEO. This fell out of vogue back in the 1990s.

Deleting the dist folder and the default Error action.

Page 50 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis touches on these two things. If you destroy the dist folder in the wwwroot folder in a .NET Core Angular project and then rerun the app, the folder will get recreated taking into account changes made to package.json, webpack.config.js, and webpack.config.vendor.js files as if you had run this command, but you don't have to run the command. Page 50 also points out that in the HomeController one will see:

public IActionResult Error()
{
   ViewData["RequestId"] = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
   return View();
}

 
 

Here Activity.Current?.Id is a goofy id for the .NET context's immediate scope and HttpContext.TraceIdentifier is going to be a comparable id for the HTTP act itself should the first id be unavailable. The setting gets stuffed in ViewData FTW!

MediatR is the other project by Jimmy Bogard.

AutoMapper is the fillet as Jeff Daniels' Bernard Berkman would say in "The Squid and the Whale" while MediatR is "The Grapes of Wrath" if not "Of Mice and Men" and is some fashion of event management tool. (I've not used this other tool myself.)

the audio HTML tag!

https://earldouglas.com/posts/sad-trombone.html will not load for me outside of my workplace so it may not load for you either, but it has this example when it does load:

<audio id="audio" src="https://earldouglas.com/posts/sad-trombone/sad-trombone.mp3"
      preload="auto">

 
 

Whoever made this content, an Earl Douglas I suppose, interacts with the .mp3 file from JavaScript like so:

<script>
   function play() {
      var audio = document.getElementById('audio');
      audio.currentTime = 0;
      audio.play();
   }
</script>

 
 

If you clicked upon these monsters, what noise should you hear?

 
 

Maybe your imagination is better than sound on the web. Sound is kind of tacky like blinking text, eh? Very 1990s like under construction "We're working on it" signs. Grow up.

Thursday, May 10, 2018

metacafe

Kinda like YouTube and kinda like Vimeo, metacafe is yet another site to search for video clips.

Willow

...is an app for watching cricket matches.

Make manual changes to webpack.config.js and webpack.config.vendor.js at a .NET Core Angular application stick!

You have to kick off another process after you make your doctor-ups. Per "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis navigate to the folder holding the node_modules folder at the command prompt and run this command:

node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js

Wednesday, May 9, 2018

object.property versus object['property']

Per this "Dot notation" and "Bracket notation" are the formal names for the two approaches to drilling into a JSON object in JavaScript.

Get all from a REST endpoint.

A GET with an id should return a specific object. Should a GET without an id return an array of everything for that type? Maybe so. That was suggested today at work. We are also using numeric ids and experimenting with having an id of zero try to find the latest, most relevant single match by another means. Fun stuff.

donut charts versus pie charts

This suggests a donut could wrap a pie providing two charts on top of each other. Otherwise there is really no difference between the two. Is it six one way and a half dozen the other?

How do we make the fonts bigger in Visual Studio Code 1.17.2?

Add this at: File > Preferences > Settings

,"editor.fontSize": 32

 
 

...or hold the Ctrl key and press + and -

MaaS360

Wikipedia says "MaaS360 is a SaaS product offered by IBM that allows for the management of BYOD and enterprise-issued devices, including smartphones, tablets, and laptops." and BYOD is bring your own device. It's allows "the man" to impose himself on the phones peeps bring to work with them. MaaS must be "mobile as a service" in the name and 360 implies in all directions.

Get the name of a month from a JavaScript date with the default date pipe built into Angular 2 and up.

For all of the Fail Whale and Flappy Bird inanities in tech, what is worse than rolling your own means for getting the friendly name for a month in JavaScript? Enough! MMMM will give the name of the month like December while MMM gives an abbreviation like Dec.

{{date_expression | date:'MMMM'}}

Page 48 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis suggests a manual correction to webpack.config.vendor.js at an ASP.NET Core Angular application.

It turns out that webpack.config.js is not the lastmost file in the Solution Explorer. If you click it, it will expand to reveal webpack.config.vendor.js which has:

plugins: [
   new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }),
// Maps these identifiers to
         the jQuery package (because Bootstrap expects it to be a global variable)

   new webpack.ContextReplacementPlugin(/\@angular\b.*\b(bundles|linker)/,
        path.join(__dirname, './ClientApp')),
// Workaround for
        https://github.com/angular/angular/issues/11580

   new webpack.ContextReplacementPlugin(/angular(\\|\/)core(\\|\/)@angular/,
        path.join(__dirname, './ClientApp')),
// Workaround for
        https://github.com/angular/angular/issues/14898

   new webpack.IgnorePlugin(/^vertx$/)
// Workaround for
        https://github.com/stefanpenner/es6-promise/issues/100

]

 
 

...which needs five items instead of four. It needs to look like this:

plugins: [
   new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }),
// Maps these identifiers to
         the jQuery package (because Bootstrap expects it to be a global variable)

   new webpack.ContextReplacementPlugin(/\@angular\b.*\b(bundles|linker)/,
         path.join(__dirname, './ClientApp')),
// Workaround for
         https://github.com/angular/angular/issues/11580

   new webpack.ContextReplacementPlugin(/angular(\\|\/)core(\\|\/)@angular/,
        path.join(__dirname, './ClientApp')),
// Workaround for
        https://github.com/angular/angular/issues/14898

   new webpack.ContextReplacementPlugin(/angular(\\|\/)core(\\|\/)esm5/,
        path.join(__dirname, './ClientApp')),
// Workaround for
        https://github.com/angular/angular/issues/20357

   new webpack.IgnorePlugin(/^vertx$/)
// Workaround for
        https://github.com/stefanpenner/es6-promise/issues/100

]

 
 

This is to fix https://github.com/angular/angular/issues/20357 which seems to have to do with errors which say:

Critical dependency: the request of a dependency is an expression

One way to escape the need of the ::ng-deep hack in an Angular 4 application is to just put styles that need to "go there" in the gobal stylesheet.

Yuck! What's worse?

TypeScript getters behave a little differently than other methods at an Angular 4 template.

You may just call out to whatever instead of whatever() as if whatever were a field. Obviously, no variables are ever handed into a getter so who needs a method signature?

screen reader

This is a tool to read off the copy on a web site to a blind person.

VSTS is Visual Studio Team Services and TFVC is Team Foundation Version Control.

This is more source control stuff.

Tuesday, May 8, 2018

Make a change to webpack.config.js in a .NET Core Angular application to get the AoT compliation working.

webpack.config.js is the last file in the file tree. At line 4 it has:

const AotPlugin = require('@ngtools/webpack').AotPlugin;

 
 

Per page 47 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis this needs to be manually changed to:

const AotPlugin = require('@ngtools/webpack').AngularCompilerPlugin;

 
 

...in order to get the AoT stuff working in Angular 5 instead of Angular 4. No wonder I couldn't get this to work for me. Another change needs to happen here in the same file:

module: {
   rules: [
      { test: /\.ts$/, include: /ClientApp/, use: isDevBuild ?
            ['awesome-typescript-loader?silent=true', 'angular2-template-loader'] :
            '@ngtools/webpack' },
      { test: /\.html$/, use: 'html-loader?minimize=false' },
      { test: /\.css$/, use: [ 'to-string-loader', isDevBuild ? 'css-loader' :
            'css-loader?minimize' ] },
      { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' }
   ]
},

 
 

The first item in the array changes like so:

module: {
   rules: [
      { test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/, include: /ClientApp/, use: isDevBuild ?
            ['awesome-typescript-loader?silent=true', 'angular2-template-loader'] :
            '@ngtools/webpack' },
      { test: /\.html$/, use: 'html-loader?minimize=false' },
      { test: /\.css$/, use: [ 'to-string-loader', isDevBuild ? 'css-loader' :
            'css-loader?minimize' ] },
      { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' }
   ]
},

 
 

Addendum 5/9/2018: It turns out that webpack.config.js is not the lastmost file in the solution after all. See: this

I remember John Locke at FramesDirect telling me not to put everything inside of one div inside of the body tag in an HTML document.

Apparently six divs sequentially following each other just inside of the body tag, for example, could load progressively.

Search for three greater than signs or three less than signs in a code base to make sure that you've found all of the spots that need to be cleaned up on the other side of a merge.

I think you can see what that would find.

Monday, May 7, 2018

AMPs are Accelerated Mobile Pages!

They have a very lean shim of JavaScript mechanics to load fast. This is a Google thing. An AMP is an alternative to a PWA per this.

Microsoft DreamSpark

It's "dev tools for students" per https://imagine.microsoft.com/en-us/content/details/4

I had a coworker who struggled to make a modal in a secondary router-outlet appear.

The Angular routing problem he bumped into acted as if the route for the secondary router-outlet could not be found. This turned out to be due to the fact that it was a child of a route that had an empty string for a path. It turns out you can't do that. You primary route must have a segment of the route as a path in order for the secondary router-outlet stuff to behave itself.

Broken Windows?

I learned today that one of the analogies in The Pragmatic Programmer compares a code base full of code smells to a rundown neighborhood. If there are broken windows everywhere it kinda says that broken windows are normal. If developers see bad code sprinkled all over a code base they are apt to think it is OK to write bad code themselves.

AppleWorks was originally called ClarisWorks.

It is the Apple version of Microsoft Office. There was division of Apple called Claris.

flippa.com

Is an exchange for buying and selling domain names. godaddy.com now has an auction site/subsite too and godaddy will appraise the worth of your domain name as well.

attenuation

In 3D Studio MAX back around the turn of the millennium this term as a setting denoted how far light would emulate from a light before decaying and eventually leaving mere blackness out at the horizon line. I thought of this overnight. I remembered John Drury at DECA, Inc. yelling at me when I couldn't figure this out one day. Good times! I wonder what happened to Dotty Talmadge and Heather Sledge. I think Heather Sledge is now a Heather McCusker. She always said that she'd keep the name Sledge if she got married because it was so awesome. I guess she couldn't see the future. I guess Robert Messer and David Black had a falling out and aren't friends anymore. I get the impression that Sabrina Winchell just went back to being Sabrina Garcia and living with her family in San Antonio. I wonder if Bob Sloan (formerly of Well-Flow) is still trying to dodge people trying to collect from him. What became of Doctor Heidi Drury? What became of Alex Drury? Did she ever rebel against her dad? Mark Lange, my T.S.T.C. cellmate, you just disappeared. Where did you go? Xref is a way in AutoCAD to include a blueprint inside of another blueprint. This came up at work with John Drury too. He thought it was a 3D Studio Max thing. Autodesk made both tools.

Sunday, May 6, 2018

When you make a new Angular application with the Angular CLI today it's not an Angular 6 application?

And yet Angular 6 came out Thursday. Come on guys! Why wouldn't you update the CLI at the same time? Even if you try to just manually upgrade what is in the package.json file and install a version 6 install you will hit an error about an invalid package name "@angular-devkit/core"

no test-driven development and moreover no testers, but, hey, at least we're pair programming on everything!

Is this the best allocation of funds? What could go wrong? I miss some of the testers I've worked with (Amulya Grandhi, Gina Bendel, etc.).

tsconfig.json

Page 44 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis recommends a doctor-up of the default ASP.NET Core 2 Angular project's tsconfig.json file which looks like so:

{
   "compilerOptions": {
      "module": "es2015",
      "moduleResolution": "node",
      "target": "es5",
      "sourceMap": true,
      "experimentalDecorators": true,
      "emitDecoratorMetadata": true,
      "skipDefaultLibCheck": true,
      "skipLibCheck": true,
      "strict": true,
      "lib": [ "es6", "dom" ],
      "types": [ "webpack-env" ]
   },
   "exclude": [ "bin", "node_modules" ],
   "atom": { "rewriteTsconfig": false }
}

 
 

...like this!

{
   "compilerOptions": {
      "module": "es2015",
      "moduleResolution": "node",
      "target": "es5",
      "sourceMap": true,
      "experimentalDecorators": true,
      "emitDecoratorMetadata": true,
      "skipDefaultLibCheck": true,
      "skipLibCheck": true,
      "strict": true,
      "lib": [ "es6", "dom" ],
      "types": [ "webpack-env" ]
   },
   "exclude": [ "bin", "node_modules" ],
   "atom": { "rewriteTsconfig": false }
,
   "angularCompilerOptions": {
      "strictMetadataEmit": true
   }
}

 
 

With this change the Angular AoT (ahead of time) compiler, not to be confused with TSC (the TypeScript Compiler), will let you know about markup errors before you navigate to the component where the problem is. Without this turned on, the errors are just logged somewhere. I messed around with this some today and could not see a difference between having the setting and not having it honestly.

Saturday, May 5, 2018

Navigate to a named router-outlet from the TypeScript side of a component in an Angular 4 application?

I am having some trouble getting this to work. Maybe navigate to a router-outlet named myOutlet with syntax not unlike the relativeTo trick like so:

this.router.navigate(['../', qux], {
   outlet: {myOutlet: 13}
});

 
 

The last bit of information above, the thirteen, is the endmost route chunk, the id.

The distinction between the bootstrapped component in your outermost module and the component specified at the default home route...

...in an Angular 4 application is that bootstrapped component is in effect your "Master Page" driving overall layout and the component specified at the route is what will first appear in the router-outlet tag inside of the "Master Page" as page content.

Use a Singleton as a cache to determine if something has been put to the store or not in the Redux pattern inside of an Angular 4 application.

Here loadedWidgets, the array, is going to contain zero or one id, right? If it's zero then we are going to go out to an API endpoint to load data. Otherwise we will just let things be. This approach does not hand back data in either case. Instead we will let stuff in the store bleed up to the UI. All we are trying to do is determine if we need something new in the store.

@Injectable()
export class WidgetsEffect {
   constructor(private action: Actions, private service: WidgetsService) { }
   private loadedWidgets = [];
   
   @Effect()
   relationshipsHh$ = this.action.ofType("WidgetsRequest").switchMap((action:
         WidgetsRequestAction) => {
      return this.loadedWidgets.indexOf(action.uniqueId) > -1 ? from([]) :
            this.execute(action);
   });
   
   execute(action: WidgetsRequestAction) {
         const url = `/whatever/whatever/whatever/${action.uniqueId}`;
         const endpointConfiguration = new EndpointConfig(url, HTTP_VERBS.GET);
         return this.service.request<Array<Widget>>(endpointConfiguration).then(result => {
            this.loadedWidgets.push(action.uniqueId);
            return new WidgetsResponseAction(result.data);
         });
   }
}

 
 

One of the more confusing things about code like this the first time I saw it was the bit that reads from([]) which returns an empty Observable of sorts in order to conditionally sidestep the execute function.

Friday, May 4, 2018

Hamster Plus

...is some sort of fingerprint scanner. These are yet another kind of input device like a joystick and I don't mean that in a Richard Gere way. ROTFOL (rolling on the floor laughing)

I'm enjoying my immediate circumstance in the immediacy.

You know, the times I've been ready to put a gun to my head have always really had more to do with my professional shortcomings more so than anything else of secondary concern in life like my failed marriage or any of the other optional endeavors you might think of. I have to work a job though and even as my late-to-the-game talent is marginal and mediocre, I seem to be upwardly mobile and doing better and better. There sure have been a lot of painful experiences along the way. Clearly I am a fighter as I keep coming back for more and more. I guess I need it. It is a relief that my move to St. Louis landed me on a team that has an extremely high level of camaraderie, more so than any of the others that I have been a part of. The photo here is from today's lunch outing and the lunch outing yesterday to Corner 17 (6623 Delmar Boulevard, St. Louis, MO 63130) unearthed the best Chinese food I have yet had. Yay! Now everything could just fall apart. I could screw something up and all the good memories could turn into anger when it all ends badly. For the moment though, I am pretty happy.

Thursday, May 3, 2018

When interfacing the Git list files you wish to ignore in the file .gitignore file.

Just list the relative paths out to the file you do not want to think about here. Just edit the file in Notepad. .gitignore will be in the root of your source control.

experimentalDecorators errors in TypeScript

This is a silly TypeScript error that may appear in Visual Studio Code 1.17.2. As suggested here, make it go away from an Angular 4 application by opening the tsconfig.json file in the root of folder structure and adding this inside compilerOptions:

"experimentalDecorators": true

When you have a polygon tag inside of an svg tag, beware of setting a vertex at 0,0 or up against the edge of the svg container in some similar manner.

Pain can arise with the stroke effect for your shape. It may end up looking skinny in places when being cut off by the bounds of the svg container. If the stoke is 2 pixels wide, well that entails 1 pixel of width both inside and outside of the polygon to make that effect and if 0,0 is a vertex then the 1px of the outer half of the stroke is going to disappear out of sight some at that point.

What has been released from the Angular team?

Below the "Join GitHub today" banner at https://github.com/angular/angular/ where it says commits, branches, releases, contributors, and MIT, go to: releases

When you want to update your GitHub billing information from an iPad...

Download Google Chrome from the App Store. The GitHub web site will throw a temper tantrum if you try to use Safari as the browser when you go to: Settings > Billing

Pentagonal Donut

The final version of Angular 5 has been released (while we await Angular 6). It is codenamed Pentagonal Donut. Page 40 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis touches on as much.

 
 

Addendum 5/4/2018: Angular 6 came out the day I wrote this blog posting. Ha!

For a second time, I saw Captain SpaceTime perform at The Crack Fox.

This guy is really named Nick Buttons (or maybe that is a second stage name) and is also one fifth of a band called Turbo Club.

 
 

This was the first of the First Wednesdays. That in turn is the reboot of the open mic night tradition at Crack Fox which will now take place every first Wednesday of every month I guess. I technically saw Captain SpaceTime on Thursday, today, and not Wednesday as it was after midnight.

 
 

Just as St. Louis has a lot of once beautiful red brick buildings that have turned brown over the course of a hundred years of time as I elude to here, it also has a lot of seating in venues made from what once were church pews. You see the pews a lot in restaurants and bars downtown. I don't know the backstory. It is almost as if there had nonsensically been a surplus of churches and the leftovers had to go somewhere. I guess America is growing more secular, eh? I don't think I can explain the pew phenomenon with that societal trend however. When I saw Dee Dee Watson get married and become Delores Ann Gonzales on 420 or 4:20 or 4/20 (Four Twenty) two years ago it was in some funny little church that now sat on some private property rented for the venue. The tiny chapel had not had a congregation in a long time and at some point an abandoned building became swallowed up as part of a resort of sorts to get married at. Whatever. I was sitting on this particular pew when I started the two video clips seen above.

 
 

Addendum 5/4/2018: Honestly his name might be Nick Button instead of Nick Buttons. I looked at the Facebook page and now I'm not sure. The MC (master of ceremonies) said Buttons last night.

Wednesday, May 2, 2018

how to REALLY get rid of auto formatting of HTML in Visual Studio Code 1.17.2

Per this if...

"html.format.enable": false

 
 

...does not seem to turn off the auto formatting try...

"beautify.language": { "html": [] }

date my face!

The Match Group which owns PlentyOfFish for example faced a heavy dip in its stock this week upon news of Facebook unleashing a dating feature.

the npm folder under the Dependencies folder in an ASP.NET Core Angular project

...has what you would expect to see in a node_modules folder. The node_modules folder is hidden from you by Visual Studio 2017 itself. Page 39 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis goes into this.

Tuesday, May 1, 2018

pulling things out of appsettings.json in an ASP.NET Core application

Page 38 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis touches on appsettings.json and the one in the ASP.NET Core application we are building looks like this:

{
   "Logging": {
      "IncludeScopes": false,
      "Debug": {
         "LogLevel": {
            "Default": "Warning"
         }
      },
      "Console": {
         "LogLevel": {
            "Default": "Warning"
         }
      }
   }
}

 
 

WebHost.CreateDefaultBuilder (an ASP.NET Core version 2 thing) back in Program.cs will automatically make appsettings.Development.json as seen below overpower appsettings.json when applicable in development environments only. It is the new Web.Debug.config where as appsettings.json is the new Web.config.

{
   "Logging": {
      "IncludeScopes": false,
      "Debug": {
         "LogLevel": {
            "Default": "Debug",
            "System": "Information",
            "Microsoft": "Information"
         }
      },
      "Console": {
         "LogLevel": {
            "Default": "Debug",
            "System": "Information",
            "Microsoft": "Information"
         }
      }
   }
}

 
 

If you make a constructor for a controller like so, ASP.NET Core 2 will hydrate IConfiguration for you.

public HomeController(IConfiguration configuration)
{
   var myValue = configuration["Logging:IncludeScopes"];
   var whatever = "breakpoint";
}

 
 

If we set a breakpoint at var whatever = "breakpoint"; above we would be able to inspect the myValue variable and see that it was "False" as expected. It is easy to mix your own settings in with the settings that mean something to the canned code I surmise.

 
 

Addendum 5/17/2018: configuration["Logging:IncludeScopes"]; here should probably be Configuration["Logging:IncludeScopes"]; with a capital C.

 
 

Addendum 4/8/2020: Note the use of the colon above to drill into nested stuff at appsettings.json.

Did you know that you may grab ahold of a template as an ViewChild in an Angular 4 application?

If a template inside of the template for a component looks like so:

<ng-template #myRef let-item>
   <span class="whatever">{{item?.cockroachPower}}</span>
</ng-template>

 
 

Back on the TypeScript side of a component you just need something like this:

@ViewChild('myRef') myRef: TemplateRef<any>;

Lodash _.range

This has a list of all of the things you can do to manipulate collections with Lodash and this in particular shows off how to use _.range like so:

_.range(4);

 
 

This command above returns an array with a zero, a one, a two, and a three in it in that order.

.find in TypeScript/JavaScript is kinda like .filter only it will only return the first match and not any array of things.

In this case 18 is returned. ...In TypeScript:

var ages = [3, 10, 18, 20];
let whatever = ages.find(x => x > 17);
alert(whatever);

 
 

In JavaScript:

var ages = [3, 10, 18, 20];
var whatever = ages.find(function (x) { return x > 17; });
alert(whatever);

Unravel variables from a type as their own variables in TypeScript.

Here will will hand in a Baz and then pluck just the foo property and the baz property off of the Baz into two new variables called foo and bar respectively.

function updateAnswers({ foo, bar }: Baz): Array<Qux> {
   const fubar = foo + bar;

.reduce in TypeScript

This has this TypeScript example (complete with the missing let or const leading keyword) of making a mess based on all of the things in an array which gives us a six.

total = [0, 1, 2, 3].reduce((a, b) => a + b);
alert(total);

 
 

In JavaScript:

total = [0, 1, 2, 3].reduce(function (a, b) { return a + b; });
alert(total);

 
 

Addendum 6/21/2018: The a here is the counter that progressively goes up and the b is the item at hand at each pass.