Wednesday, July 31, 2019

Octopus is single-threaded.

One job can't kick off if another one is running. Lame.

Libra

It is a blockchain cryptocurrency‎ like Bitcoin. It is proposed by Facebook.

Tuesday, July 30, 2019

throughput

...is the amount of stuff, bytes, packets, etc. passing through a process.

BlueCielo

It is document management stuff. Headhunters could keep all of their word doucments for résumés in here and the like.

fast follow

This is a release to production hot on the heels of a release to production.

One or more errors occurred. (Cannot create a DbSet for 'AppleSauce' because this type is not included in the model for the context.)'

At your implementation of Microsoft.EntityFrameworkCore.DbContext in your C# you will need to add your type to the OnModelCreating method as shown here to beat this "because this type is not included in the model for the context." problem when working with .NET Core's Database First Entity Framework approach.

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
   modelBuilder.Entity<AppleSauce>().ToTable("AppleSauce");
}

 
 

Note that the "AppleSauce" magic string does not have to correspond to the name of a database table. As best as I can tell it can be anything you like. It should not be the same across two line items in the OnModelCreating method however.

DAST is dynamic application security testing while SAST is static application security testing.

DAST tests from the outside. Think pen testing, etc. SAST is inside testing, stuff like HP Fortify scans and that ilk. DAST is also referred to as black box and SAST white box. See: this

update-database : You cannot call a method on a null-valued expression.

Alright, when I got this error I just reran the command and it worked a second time. Don't ask me man.

Talend

...has products for big data, ETL, and machine learning. Talend Open Studio for ESB (Enterprise Service Bus) is sort of like an SOA IDE.

Monday, July 29, 2019

Sort with an IComparer in C#!

using System.Collections.Generic;
namespace Trifecta.Core.Objects
{
   public class NumberSorter : IComparer<int>
   {
      public int Compare(int x, int y)
      {
         return x.CompareTo(y);
      }
   }
}

 
 

Use your implementation like this:

List<int> foo = new List<int>() { 42, 13, 86, 69 };
NumberSorter numberSorter = new NumberSorter();
foo.Sort(numberSorter);
List<int> bar = foo;

 
 

It does what you think it does. It puts the numbers in order. Note that when you do this with a string, there is still an int being returned at the IComparer implemenation not a string. That part is not customized to the generic. It is always an int.

using System.Collections.Generic;
namespace Trifecta.Core.Objects
{
   public class StringSorter : IComparer<string>
   {
      public int Compare(string x, string y)
      {
         return x.CompareTo(y);
      }
   }
}

Sunday, July 28, 2019

CSS preprocessors

LESS is a CSS preprocessor and so is Sass.

Use the proper annotations for objects in .NET Core's Code First Entity Framework stuff.

Consider these objects:

  1. using System;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    namespace FluffyNothing.Core.Objects
    {
       public class Game
       {
          [Key]
          [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
          public long GameId { get; set; }
          public long Player1 { get; set; }
          [Required]
          public string Player1Hand { get; set; }
          public DateTime Player1Time { get; set; }
          public long? Player2 { get; set; }
          public string Player2Hand { get; set; }
          public DateTime? Player2Time { get; set; }
       }
    }
     
  2. using System;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    namespace FluffyNothing.Core.Objects
    {
       public class Message
       {
          [Key]
          [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
          public long MessageId { get; set; }
          [Required]
          [ForeignKey("PlayerId")]
          public Player Player { get; set; }
          [Required]
          public string Copy { get; set; }
          public DateTime Time { get; set; }
       }
    }
     
  3. using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    namespace FluffyNothing.Core.Objects
    {
       public class Player
       {
          [Key]
          [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
          public long PlayerId { get; set; }
          [Required]
          [MaxLength(15)]
          public string PlayerIp { get; set; }
          public virtual ICollection<Message> Messages { get; set; }
       }
    }
     

It makes this at the database:

Things to note here include how to make a parent/child relationship, how to make a varchar be a specific width, and how making a varchar not nullable takes a different shape than that of other types. In the case of long and DateTime we just either have a nullable type at the C# side or we don't, right? In the case of string we have to use the Required attribute. I guess this much will change in C# 8 with the introduction of nullable strings.

Comic Book College

Located at 4632 Nicollet Ave, Minneapolis, MN 55419 (Nicollet being what people refer to as "Eat Street" because of all of the restaurants along it though I've yet to eat in one myself) Comic Book College is the oldest comic book shop in the Twin Cities. It seems legit to me. I was there today and took these pictures. I endorse it.

Readers, I owe you an apology for pointing to Matt Wagner's Mage's third run as something awesome because it turned out that it really wasn't, but to make up for it I would suggest that the "Saga" series is pretty swell. I haven't read all of it. I'm not caught up, but a coworker gave me the first few collected-to-books printings of the early stories and I am impressed with the writing. The Wizard of Oz level of silliness took me a little bit to get used to, but eventually it all felt like home. Pardon the pun.

The magicesque language the Wreathers speak is Esperanto. You can Google Translate it. I assumed it was nonsense at first and by the time I realized it wasn't I no longer held in my temporary possession some of the collections of first issues so I couldn't go back and reverse engineer everything said. Eventually Marko's dad died and there was an extended sequence flashback of a memory of his dad from his childhood and the whole thing just had too much gibberish for me to think it was just gibberish anymore. The issue shown here is the one in which Marko himself dies.

Weeb

This is a term that means a white person who wishes they were Japanese and in particular there is the subtext of an Anime fanatic. There are a lot of them in the Mall of America and I ran into this one today:

Monokuma from Danganronpa is who this person is supposed to be. He is a villain who makes a bunch of high school kids participate in the sort of elimination competition one associates with reality television of a dozen years ago (I Love New York) and the eliminated are killed in that setting. I recognized him because I bought a stuffed animal toy of this character in an Addison, Texas shop called "Anime Pop" for a friend's young son on a whim in maybe 2014 without realizing the adult nature of the cartoon at the time.

Friday, July 26, 2019

double hashing

It is to hash a hash. This makes things more safe in password protection.

How do I see what stories I need to move forward to the next sprint at Azure DevOps?

  1. Go into "Backlogs" under "Boards" and click the filter icon at the upper right to unlock the filter controls. At the filter controls change "Assigned to" to yourself and yourself only, and change "Iteration" to the sprint you are leaving. If these two items are not in the filter, click "Column Options" above the filter controls to get them there.
  2. Go into "Queries" under "Boards" and click "All" at the upper left. Click "Assigned to me" and then the "Iteration Path" column to sort by that detail.

Thursday, July 25, 2019

As a tester, how do I know what has been rolled out to the test server at any one deployment?

Well, if the developers have been associating stories or tasks for stories with pull requests in Azure DevOps you should be able to reverse engineer what has been put forth. If you lead the name/note of a commit in git with the story number it will, by default, be the name of the pull request to be in Azure DevOps. This could help.

MicroStrategy Reporting

It's more business intelligence stuff. I hear it is more expensive than most.

Wednesday, July 24, 2019

rather than a non-generic DbContextOptions parameter

Consider this error:

The DbContextOptions passed to the PlayerContext constructor must be a DbContextOptions<PlayerContext>. When registering multiple DbContext types make sure that the constructor for each context type has a DbContextOptions<TContext> parameter rather than a non-generic DbContextOptions parameter.

 
 

To get around this error, I changed this...

using Microsoft.EntityFrameworkCore;
using FluffyNothing.Core.Objects;
namespace FluffyNothing.Infrastructure.ExternalDependencies.Repositories
{
   public class PlayerContext : DbContext
   {
      public PlayerContext(DbContextOptions options) : base(options)
      {

 
 

...to this:

using Microsoft.EntityFrameworkCore;
using FluffyNothing.Core.Objects;
namespace FluffyNothing.Infrastructure.ExternalDependencies.Repositories
{
   public class PlayerContext : DbContext
   {
      public PlayerContext(DbContextOptions<PlayerContext> options) : base(options)
      {

Cards in UX

You see the digital equivalent of Post-it notes at a dashboard. Angular Material has a solution. These tend to wrap under each other in a flexboard-flavored layout.

When wouldn't you want to remove an unused column from a database table?

This came up in conversation yesterday when columns that existed in production got the axe in lower environments demanding a triage to update production. I think this was the right thing to do in spite of the pain point of the drama. Back when I was at FramesDirect I went to one of those goofy Agile events that Java people in Austin went to because there wasn't really a Java meetup group and we all sat at a large table and told horror stories and some of the guys with AT&T had a database that everyone interacted with over one common connection string with the same username and password for everyone (no records of who used what) that had existed untouched for years. They were afraid of their database because they didn't know what all (forgive the Texas) was using it. In that scenario I might not remove a column that seemed unused. I can't think of another circumstance.

When you want to test a sproc but not edit a database...

Well, let's say your sproc is to be added to the database via a script in source control or via a Visual Studio database project. How can you experiment with the sproc in the end environment if you're not actually supposed to hand change things there? It was suggested to me yesterday that you may just run a select statement with the guts of the sproc against the database. That probably is a pretty good test.

computed columns in T-SQL

These are a thing. In SSMS, you may expand a table under "Tables" under your database and look at the "Columns" beneath the table. It will list "Computed" as a column's type in the case of a computed column. If you right-click on it and pick "Modify" and then expand "Computed Column Specification" under "Column Properties" you will see the "(Formula)" setting although I do not think there is much to change here. This sort of suggests you have to drop a computed column and readd it to make changes like so:

  1. ALTER TABLE MyTestTable
       DROP COLUMN MycomputedColumn
  2. ALTER TABLE MyTestTable
       ADD MyComputedColumn AS ( A + '-' + B + '-' + C )

Make the canActivate method in a CanActivate guard in an Angular 7 application return an Observable of boolean instead of just a boolean.

canActivate(route: ActivatedRouteSnapshot): Observable<boolean> {
   let userObservable:Observable<User> = this.store.select(getUserInfo);
   let booleanObservable:Observable<boolean> = userObservable.pipe(map((user) => {
      return (user.Functions.indexOf('Business Units - Update') > -1);
   }));
   return booleanObservable;
}

 
 

Here is the same thing a bit more fleshed out:

canActivate(route: ActivatedRouteSnapshot): Observable<boolean> {
   let userObservable:Observable<User> = this.store.select(getUserInfo);
   let booleanObservable:Observable<boolean> = userObservable.pipe(map((user) => {
      if (user.Functions.indexOf('Business Units - Update') == -1) {
         this.router.navigate(['/audit-attestations','unauthorized']);
      }
      return true;
   }));
   return booleanObservable;
}

 
 

Some of the imports:

import { Store } from '@ngrx/store';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';

how the email alerts work in Azure DevOps

At the left navigation for a project where is says Overview, Boards, Repos, Pipelines, Test Plans, and Artifacts, there will be, hidden down at the lower left corner, a button for "Project settings" and you should click this button and then click the "Notifications" button under the "General" subsection of the secondary menu that appears. Here you will see a list of things which demand an email alert, things like "Build completes" and the like. I found out today that there is no way to take someone on the team out of the email list for these short of creating a new team with a different set of notifications.

How do I send an email to everyone on a calendar invite I didn't make myself at the Outlook in Windows 10?

In Outlook, open the calendar invite, go to the "Meeting Series" of "Meeting Occurrence" or merely "Meeting" tab as the case may be and click "Respond" followed by "Reply All" to make a new email-to-be addressed to everyone.

hover tips and hover text

These are other names for the alt/title tooltip stuff.

Tuesday, July 23, 2019

Monday, July 22, 2019

Changes not staged for commit:

When you get this command line error in Git Bash it will be followed with something like so in red listing the files not included in your attempt to commit:

modified: ../../../package.json

 
 

I do not yet know what is really going on with this, but the way to fix it is to try to add files again. However, do not just do this the next time:

git add .

 
 

Instead add the specific file as denoted in the red text like so:

git add ../../../package.json

 
 

Then you will be able to commit.

 
 

Addendum 1/24/2020: The problem stems from opening the shell where you are running GIT commands in a folder that does not include the change you need to loop in, a nested folder.

Sunday, July 21, 2019

Some of the pseudo HTML tags in modern Razor views are intriguing.

Assuming .NET Core 2.2.6, and perhaps in other versions, if you make a "ASP.NET Core Web Application" and specifically a "Web Application (Model-View-Controller)" in Visual Studio 2019 you will see in _Layout.cshtml stuff like this for looping in a partial and showing or hiding stuff based on the environment set in launchSettings.json beneath Properties in the token project made with the new solution.

  1. <partial name="_CookieConsentPartial" />
     
  2. <environment include="Development">
       <p>Hello World</p>
    </environment>

     
  3. <environment exclude="Development">
       <p>Hello Reality</p>
    </environment>
     

Saturday, July 20, 2019

Read and write with the .NET Core Entity Framework Code First stuff.

using Microsoft.EntityFrameworkCore;
using FluffyNothing.Core.Objects;
using FluffyNothing.Core.Interfaces.Repositories;
using System.Collections.Generic;
using System.Linq;
using System;
namespace FluffyNothing.Infrastructure.ExternalDependencies.Repositories
{
   public class PlayerRepository : IPlayerRepository
   {
      public Player FindPlayerWhileCreatingPlayerIfPlayerDoesNotExist(string ipAddress)
      {
         var optionsBuilder = new DbContextOptionsBuilder<PlayerContext>();
         using (var context = new PlayerContext(optionsBuilder.Options))
         {
            using (var transaction = context.Database.BeginTransaction())
            {
               List<Player> players = context.Players.Where(p => p.PlayerIp ==
                     ipAddress).ToList();
               switch (players.Count)
               {
                  case 0:
                     Player player = new Player();
                     player.PlayerIp = ipAddress;
                     context.Players.Add(player);
                     context.SaveChanges();
                     transaction.Commit();
                     return player;
                  case 1:
                     return players[0];
                  default:
                     throw new Exception("duplicate database entries exist for " + ipAddress);
               }
            }
         }
      }
   }
}

Friday, July 19, 2019

I am trying to get started with some onion architecture with some Code First Entity Framework for .NET Core.

Following this, I made this stuff today:

  1. using Microsoft.EntityFrameworkCore;
    using FluffyNothing.Core.Objects;
    namespace FluffyNothing.Infrastructure.ExternalDependencies.Repositories
    {
       public class PlayerContext : DbContext
       {
          public PlayerContext(DbContextOptions options) : base(options)
          {
             
          }
          
          protected override void OnConfiguring(DbContextOptionsBuilder dbCob)
          {
             dbCob.UseSqlServer(ConnectionString.Use());
          }
          
          public DbSet<Player> Players { get; set; }
       }
    }
     
  2. using System.ComponentModel.DataAnnotations.Schema;
    namespace FluffyNothing.Core.Objects
    {
       public class Player
       {
          [Key]
          [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
          public long PlayerId { get; set; }
          public string PlayerIp { get; set; }
       }
    }
     
  3. using Microsoft.EntityFrameworkCore;
    using FluffyNothing.Core.Interfaces.Repositories;
    using FluffyNothing.Core.Objects;
    namespace FluffyNothing.Infrastructure.ExternalDependencies.Repositories
    {
       public class PlayerRepository : IPlayerRepository
       {
          public void AddPlayer(Player player)
          {
             var optionsBuilder = new DbContextOptionsBuilder<PlayerContext>();
             using (var context = new PlayerContext(optionsBuilder.Options))
             {
                
    //coming soon
             }
          }
       }
    }

 
 

At the NuGet console in Visual Studio 2019 I changed the "Default project:" to the infrastructure project and then I ran these two commands to make the database:

  1. Add-Migration EFCoreCodeFirstSample.Models.PaymentContext
  2. update-database

 
 

This sets up the database and storage for the migrations in a table at the database and a folder in the infrastructure project! When you cannot use .UseSqlServer with Microsoft.EntityFrameworkCore try this command:

Install-Package Microsoft.EntityFrameworkCore.SqlServer YourProjectNameHere

 
 

Addendum 7/20/2019: Add-Migration EFCoreCodeFirstSample.Models.PaymentContext above should really be Add-Migration EFCoreCodeFirstSample.Models.PlayerContext to tell the truth, you know? Another thing I should mention is that I had to have services.AddDbContext<PlayerContext>(); just inside ConfigureServices method in Startup.cs back in the UI project. Otherwise, the command I just mentioned won't run.

install .Net Core 2.2.301 and upgrade your app on the earlier version

Get it here. It will give you: .NET Core Runtime 2.2.6 (right-click on your projects in Visual Studio 2019, pick "Properties" and then at the "Application" tab flip the "Target framework:" setting to ".NET Core 2.2") You may see an error like so in your UI project:

Detected package downgrade: Microsoft.AspNetCore.Razor.Design from 2.2.0 to 2.1.2. Reference the package directly from the project to select a different version.

 
 

To fix this, you could try to open the .csproj file in Notepad and splice this just inside the closing PropertyGroup tag:

<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>

 
 

But, honestly, that didn't work for me. I instead ran these NuGet commands back to back:

  1. uninstall-package Microsoft.AspNetCore.Razor.Design
  2. install-package Microsoft.AspNetCore.Razor.Design

STRING_SPLIT in T-SQL

SELECT tooth INTO #teeth FROM STRING_SPLIT(@cavities, ',')

 
 

@cavities above would be perhaps an nvarchar(max) variable handed into a stored procedure. The above will break a string of ids separated by commas (without spaces) into an on-the-fly table that has one column named "tooth" that may then be queried like so:

SELECT * FROM Molars yin
WHERE yin.ToothId in (SELECT yang.tooth FROM #teeth yang)

 
 

Addendum 10/16/2019: The tooth column name here probably won't cut it. I think the nameless column has to be named "value" instead like so:

SELECT [value] INTO #attesters
      FROM STRING_SPLIT((SELECT TOP 1 AttestedBy FROM
      @ReportingUnitsHalfwayFlattened WHERE AppSecurityRUKey =
      @AppSecurityRUKey), ',')
SELECT COUNT(*) From #attesters WHERE [value] = @AppSecurityRUKey

Thursday, July 18, 2019

fragmentation

As data altered in T-SQL, its indexes become fragmented, perhaps spread across separate files. This is fragmentation and this has some notes on it.

When rolling from dev to test at Octopus, how can I rerollout a prior version when something goes wrong?

At the "Overview" for the project, find the version you want and click on its bright blue number. You should see options for the redeployment.

As a tester, to get a version number for the application as associated to that particular story in Azure DevOps...

  1. Go to the story.
  2. At the left under "Related Work" drill into the task the developer completed.
  3. At the left under the task will be "Development" where "Related Work" used to be, drill into the individual commits here.
  4. At the Overview, Files, Updates, Commits, Conflicts tabs pick "Files" and look for the file where the version number changed.

Wednesday, July 17, 2019

Sketch only works on a Mac.

It needs macOS to do its thing.

SailPoint and Proofpoint

Instead of emailing someone a file, these solutions allow you to put it on a secure share where in may be picked up for a limited amount of time. Paymetric had a solution called XiTransfer for this sort of thing when I was there. The Xi encoding before all product names, like XiPay, originally meant nothing and the term "Cross Interface" was retrofitted to it.

Make a file folder in C#!

string directory = "C:\\Logs\\";
if (!Directory.Exists(directory))
{
   DirectoryInfo directionInfo = Directory.CreateDirectory(directory);
}

Tuesday, July 16, 2019

How may I go to the API and back to check something in a CanActivate guard in an Angular 7 application?

You may make the canActivate method in a CanActivate guard return Promise<Boolean> instead of Boolean for handling the asynchronous stuff. Honestly however, I don't see why you would not just use a synchronous old school XHR call in the guard as everything has to wait on the guard anyway.

Sunday, July 14, 2019

I saw Kamran Ayub speak on RavenDB at the Twin Cities .NET User Group on Thursday night.

RavenDB, a document database (NoSQL) like MongoDB, is still a thing. It is now on version 4. It is still Ayende's baby. While Mongo just has a CLI (command line interface) for you to use, Raven has a rich studio experience which Kamran Ayub showed off. Raven is written in C#, focused on fast reads, and allows for graph queries which transverse nested gunk. As of version 4, it is now built in .NET Core. cloud.ravendb.net will allow you to create a free account hosted at either AWS (Amazon Web Services) or Azure. X.509 SSL (secure sockets layer) Certificates are used for security. A collection is a way to organize documents. Guids are still the defaults for keys, however, you may now have keys that are plain text names and there are routes, so-to-speak, to these keys, drilling into containers, something like foo/bar/baz/qux for example (wherein qux is the document key, referred to as the "slug" in the path, and foo, bar, and baz the hierarchy of organization called prefixes). Well, honestly, I think the whole route is the key and not just the slug chunk at the end. The collections have indexes as to what they contain in the name of querying against them, however new insertions are not immediately indexed but rather indexed eventually. In this way Raven is BASE instead of ACID. In querying directly against a document key, perhaps with a slug, the result will be ACID. Even if you are just using Guids for the keys and they are auto-generated, you may get a key before you actually commit an in-memory object to the database. CompareExchange in C# allows you to avoid concurrency issues. Kamran was showing this off some in live coding. The Raft algorithm is used with it which I don't pretend to understand. The Wikipedia write up on it suggests there is an elected leader and only one leader at a time. Other actors in the algorithm would be followers. I'm guessing this logic determines who wins in a collision. I saw some B grade martial arts movie on HBO once where the immovable object versus unstoppable force conundrum took shape in a parable in which a rhinoceros charged an elephant. That's concurrency people, and you work out the winner with CompareExchange and Raft. RavenDB's API is built on top of web sockets so you can have what Kamran referred to as Observables! Socket.IO was namedropped as a solution for web sockets in the Node space. SignalR was used in a coding example to update a counter at a web site in real time. The queries look like this:

from Orgs as org
where id() = "orgs/microsoft"

Saturday, July 13, 2019

Nova Launcher

This provides a way to change the skin for your Android phone. You may pick from canned skins online, etc. You may break out of the usual six by six icon layout to up to a twelve by twelve format.

I saw Todd Gardner of TrackJS speak on the build versus buy dilemma at AngularMN on Wednesday night.

There were some dinosaurs in this talk! One guy in the audience mentioned the old Classic ASP app being run at his work and without knowing anything about it Todd asserted that the app must be very successful as otherwise the organization would have gotten away from Classic ASP a long time ago. He also mentioned that Joel Spolsky, who gave use FogBugz and StackOverflow, has a "don't rebuild systems" quote (see this) bearing in mind that a mature, utilized, important system will have grown beyond what is in any documentation there may be taking on numerous esoteric quirks that will be hard to rediscover in the name of a recreation leading the recreation to be a big waste of time. Todd went on the assert that he has seen scenarios in which the recreation gets to a point where it covers a chunk of the first system and people start using it before the first system is turned off, but then it never fully replaces the first system and soon both systems are running while a third system is created to reconcile the two, share data, etc. Todd also offered that as good as your architecture standards may be, everything eventually becomes a "Big Ball of Mud" which is one of the antipatterns mentioned here and regarding which Todd pointed us to this blog posting by Brian Foote and Joseph Yoder. Another dinosaur mentioned by another audience member was IBM AS/400, an old green screen app. This was offered as an example of abandoned tech that there was nonetheless no getting off of in that scenario. Todd suggested that Sybase, a forerunner of SQL Server that is decades old and has no new adopters, ups its licensing cost by thirty percent every year to milk the base it has left which at this point in history is comprised exclusively of individuals who are trapped with Sybase, unable to wiggle free. This is vendor lock-in. In a scenario in which a company leans towards buy in the buy versus build decision making, IT becomes just vendor contract management. The opposite approach, leaning towards build, is called "not invented here syndrome" (NIHS) and in this model an organization rebuilds everything that could be purposed from elsewhere. There are reasons not externalize. Per Eric Ries, ninety-nine percent of companies that take outside money (venture capitalism) are going to die within five years and certainly there are examples of bad vendors to use, however, Todd suggested that Best Buy rewrote their own in-house versions of the DigitalOcean cloud platform and the Cisco Jabber chat client which are really pretty established and too generic to be business-specific. You can take the carpe diem thing too far cowboy. It is probably better to use Angular than to roll your own JavaScript framework. Google and Microsoft probably won't throw Angular away anytime soon. Where is the porridge that goldilocks should pick then? Todd recommends posing these five questions in decision making:

  1. What is the impact of failure of the system? (This affects the amount of time you put in.)
  2. Do you need this for competitive advantage? (begging the question "Could you sell it?" as if it is not interesting enough for someone outside of your organization to want maybe it's a solved-problem not cornerstone to your niche)
  3. What is our bias?
  4. What could we do instead?
  5. Is it sustainable?

Fifty-five percent of software implementations fail. In the buy approach you may have to pick between industry standards and something highly-configurable. Jira is an example of something so highly configurable that it empowers you to accentuate your bad workflows and that also makes it hard to escape. This is known as "being sticky" and cloud vendors are kind of sticky in another manner by way of making you learn so many processes that are specific to their platform. In contrast, when you roll your own, how many people need to be hit by a bus before you are in trouble? How many fiefdoms of knowledge (UI, DBAs, etc.) share ownership? What are your ownership policies, change approval processes, and time-to-death sunset policy? What does the upgrade horizon look like? These are all things to think about. Also pay attention to size of scope. Todd thought that the famous "I think there is a world market for maybe five computers." quote by the original CEO of IBM, Thomas Watson, could in modern times become "There should only be seven companies using Kubernetes." Don't compare your company's needs to those of Netflix which has to stream content to millions of people at once. Time to wrap up. Red Hat Ansible is for provisioning, deployment, and configuration of home spun stuff. Octave Klaba's OVH (On Vous Héberge which is French for "we host you") is a datacenter management company that you may engage with to keep your apps afloat. I think Box was namedropped as another cloud thingy that Best Buy rewrote in-house. Daniel Pink was definitely namedropped. He has written of levels of mastery. DR is data recovery. left-pad is the npm package that when removed as suggested here, broke so many other things. All it did was pad a string on the left side and yet it set a precedent wherein npm now no longer allows you to just turn stuff off at a whim. Todd Gardner runs TrackJS, and TrackJS does error monitoring. The intro here has a bit about it.

Friday, July 12, 2019

I learned today that as Uber and Lyft complete with each other, they do not have city-specific pricing.

If you an Uber driver in Los Angeles what you make and what your costs are to average Joe is the same as any other city even though Los Angeles has a higher cost of living than most cities.

Glassdoor for employers

If you are an employer, you may now pay Glassdoor to be a tech recruiter just as you might pay any other tech recruiter.

Thursday, July 11, 2019

DFS stands for Distributed File System

This is Microsoft tech. If you have many Windows servers you may spread the root folder of a "file share" across many servers on your LAN.

how to teach yourself React

https://www.youtube.com/watch?v=sBws8MSXN7A has what seems like a great training video for teaching yourself React although I honestly have only watched the first twenty-five minutes. I ran into a Juno Vue at this event and he recommended it. Some takeaways from the first twenty-five minutes:

  1. You have to use className where you would otherwise use class in HTML markup in the JSX markup.
  2. render() is a lifecycle method and the only one that is required for a component.
  3. To loop in a component in another component, for example a component called Walrus, you would import Walrus up top in the imports for the component as you would in Angular and in the JSX you would have <Walrus />
  4. Give components Pascal Case names.
  5. Have state = { } above your declaration for render() at a component, and obviously put something inside of state. Both of these things do not need to be chased by a semicolon which surprised me.
  6. Something random that came up seems to be global settings in CSS defined with an asterisk like so:
    * {
       box-sizing: border-box;
       margin: 0;
       padding: 0;
    }

Wednesday, July 10, 2019

dbo.SORT temporary run storage

This error means the tempdb is fullish. The tempdb is a place where SQL Server stores memory and you may query against it for stuff midstream in transactions.

Tuesday, July 9, 2019

Super 8

A year ago today was the last day of the Wells Fargo Advisors contract. I lived in St. Louis for half a year and worked as a contractor at Wells Fargo Advisors for five months and change before getting cut. The experience would have been a bad one if not for the seven other individuals in the same boat as me. This lists who they were and Kabin dubbed us the Super 8. I like to think that he named us after the movie that came out when this blog was two days old and not the type of film the J. J. Abrams and Steven Spielberg collaboration was named for nor the chain of motels that wears the moniker. I guess all three things don't really draw a parallel to eight people who are super. Kabin was Nepalese and there were also five Telugu Indians on the team. In working in tech and working with the Nepalese and Telugus (this was NOT the first time by a longshot) I, as a white guy born to America, found that the Nepalese and Telugus had stories that made me jealous. They see more of the country (United States) than the people who are born here as they hop city to city and contract to contract. It seems akin to the telegraph operator of the nineteenth century who rode the rails city to city getting some regional job as a telegraph jockey during his days and falling into IRC chat over telegraph with other likeminded individuals at night in off-hours. (This description comes from a Bruce Sterling talk I saw at a South by Southwest when I was young.) They (Indians/Nepalese/Bangladeshi) all have a communal roommate situation that supports them, lowering the cost of rent, in any city, any environment, where there are tech jobs. Without such a support structure I still wanted to have the experience. I had been living in Texas for thirty-one years and was ready to do anything to get out. I learned the hard way that the place that will just give you a job out of state and over the phone without an onsite interview is not a good place to work. Right after this contract I took a similar one, secured through one over-the-phone phone screen, at Optum in the Twin Cities and it was sickly in comparable ways. I guess I won't hop states again, but at least I've had the experience and I got to escape Texas, right? There was a lot of talk from the Telugus of Trump and how he was making the art of being an immigrant that much harder and that much more expensive. Most Telugus are really chill people and I wish things were easier for them. I'm glad that they are here and I do not wish them away. The team was rounded out by another White American named Josh who was from St. Louis itself and could kind of coach us as to things to explore in the city. We ate out a lot as a team.

Ted Drewes has some pretty good custard and Corner 17 is easily the best Chinese restaurant I have ever eaten in, the kind of Chinese place where you see other Chinese people and not just White Americans eating out of Styrofoam containers with plastic forks.

The photo of Sri up top in this blog post is from a Cinco de Mayo street party that is a surreal blowout in St. Louis in spite of the fact that there are not really any Latin people there. Maybe everyone is just happy to have a margarita. (I'm not encouraging you to drink.)

Your bank may deem that a series of credit card payments to Uber smell of fraud.

This means that the next day you will be unable to run your credit card with Uber until you call the bank. I hope you don't have to go anywhere before 8AM! This happened to me today. As dumb luck would have it, a coworker lives in my apartment building and he gave me a ride to work as otherwise I would have been marooned until 8AM.

Monday, July 8, 2019

How can I tell what servers I am deploying to in Octopus?

Go to the "Infrastructure" tab at the tabs across the top and then pick "Deployment Targets" from the menu at the left.

Friday, July 5, 2019

fractal

A coworker was telling me today that a lot of the patterns in nature have been proven to have fractals driving them and thus fractals are used quite a bit in modern 3D graphics for games to render patterns in nature.

Thursday, July 4, 2019

logical versus physical design

In the logical design an analyst, who may not necessarily be able to sling T-SQL, lays out the tables to be in a tool like Excel perhaps. In the physical design the tables are actually made at a database.

I found a SQL a cheatsheet in a coworker's cube.

I guess this is "real" SQL and not T-SQL. Look at everything-but-the-intersection query at the lower right:

SELECT <select_list>
FROM TableA A
FULL OUTER JOIN TableB B
ON A.Key = B.Key
WHERE A.Key IS NULL
OR B.Key IS NULL

Brio Intelligence

This is more old BI (Business Intelligence) stuff from a darker day that is done.

Query records with a stored procedure in Entity Framework's database-first approach while also handing in variables!

Let's start with a simple example:

public async Task<Division> GetDivision(string businessDivisionCd, DateTime
      finalFriday)
{
   Division division = new Division(businessDivisionCd);
   var date = new SqlParameter("@ContractFuturesMonth", finalFriday);
   var name = new SqlParameter("@BusinessDivisionCd", businessDivisionCd);
   var contracts = await _dbSetDivisionContracts
         .FromSql("UI.GetContractByBusinessDivisionCd @ContractFuturesMonth,
         @BusinessDivisionCd", date, name).ToListAsync();
   division.Contracts = contracts;
   return division;
}

 
 

Great! We don't explicitly state what type contracts is of above but the collection will have to be of a type that is friendly to Entity Framework in that, at the very least, the [Key] attribute must decorate one of the getsetters to denote a primary key (for which you will need the System.ComponentModel.DataAnnotations namespace looped in the using declarations) and that getsetter and all of the other getsetters at the type must match up one-to-one with the column names of the columns being queried out of the stored procedure. If you want "better" names you can turn around and map what emerges to a different type with AutoMapper. Let's look at a more complicated example in which we hand in a user-defined table type for one of the variables:

public async Task<List<Division>> GetDivision(string[] businessDivisionCds, DateTime
      finalFriday)
{
   List<Division> divisions = new List<Division>() { };
   DataTable scope = new DataTable("BusinessDivisionCds");
   scope.Columns.Add(new DataColumn("BusinessDivisionCd", typeof(string)));
   foreach(string businessDivisionCd in businessDivisionCds)
   {
      var row = scope.NewRow();
      row["BusinessDivisionCd"] = businessDivisionCd;
      scope.Rows.Add(row);
   }
   var date = new SqlParameter("@ContractFuturesMonth", finalFriday);
   var name = new SqlParameter()
   {
      SqlDbType = SqlDbType.Structured,
      ParameterName = "@BusinessDivisionCds",
      TypeName = "dbo.BusinessDivisionCds",
      Value = scope
   };
   var contracts = await _dbSetDivisionContracts
         .FromSql("UI.GetContractByBusinessDivisionCd @ContractFuturesMonth,
         @BusinessDivisionCds", date, name).ToListAsync();
   foreach (string businessDivisionCd in businessDivisionCds)
   {
      divisions.Add(new Division(businessDivisionCd)
      {
         Contracts = contracts.Where(c => c.BusinessDivisionCd ==
               businessDivisionCd).ToList()
      });
   }
   return divisions;
}

 
 

All of the above is C#, but everything that follows is T-SQL. dbo.BusinessDivisionCds could look like:

USE [EnterpriseConsumption]
GO
CREATE TYPE [dbo].[BusinessDivisionCds] AS TABLE(
   [BusinessDivisionCd] [varchar](50) NULL
)
GO

 
 

The stored procedure:

USE [EnterpriseConsumption]
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [UI].[GetContractByBusinessDivisionCd]
   @FinalFriday DATETIME,
   @BusinessDivisionCds dbo.BusinessDivisionCds READONLY
AS
BEGIN
   set nocount on;
   DECLARE @AdminOrReporterAttestationCount int
   DECLARE @AdminOrReporterAttestation TABLE
   (
      ReportDate DATETIME NOT NULL,
      Id int NULL,
      AttestedBy varchar(50) NULL,
      AttestedDate DATETIME NULL
   )
   INSERT INTO @AdminOrReporterAttestation
   SELECT TOP 1 ReportDate, CFTCReportID, AttestedBy, AttestedDate FROM
         dbo.CFTCReport
   WHERE ReportDate = @FinalFriday
   SELECT @AdminOrReporterAttestationCount=COUNT(ReportDate) FROM
         @AdminOrReporterAttestation
   select
      c.ContractId
         ,c.CFTCReportID
         ,c.CHSLocationID
         ,c.BusinessPartnerTypeID
         ,c.ContractStatusID
         ,c.CommodityID
         ,c.ContractDate
         ,c.ContractDeliveryDate
         ,c.ContractDueDate
         ,c.ContractFuturesMonth
         ,c.ContractODSID
         ,c.ContractNbr
         ,c.ContractTypeCd
         ,c.ContractTypeDesc
         ,c.ContractCategoryCd
         ,c.ContractCategoryDesc
         ,c.PricingDate
         ,c.Price
         ,c.Currency
         ,c.PriceStatusDesc
         ,c.IsPriced
         ,c.isInTransit
         ,c.isReceived
         ,c.SourceTotalQty
         ,c.SourceAppliedQty
         ,c.SourceRemainingQty
         ,c.UOMID
         ,c.CFTCKBUQty
         ,c.CFTCStandardQty
         ,c.isBUAttested
         ,c.BUAttestedBy
         ,c.BUAttestedDate
         ,c.isDivAttested
         ,c.DivAttestedBy
         ,c.DivAttestedDate
         ,a.AttestedBy as 'AdminOrReporterAttestedBy'
         ,a.AttestedDate as 'AdminOrReporterAttestedDate'
         ,c.is204
         ,c.SourceID
         ,c.SourceSystemID
         ,c.SourceKey
         ,c.BusinessUnitID
         ,bu.BusinessDivisionCd
         ,bu.BusinessDivisionDesc
         ,bu.BusinessUnitDesc
         ,bu.isDisplayUI
         ,c.CreDate
         ,c.UpdDate
         ,c.CreBy
         ,c.UpdBy
   FROM [dbo].[Contract] c
      INNER JOIN [dbo].[BusinessUnit] bu
   ON c.BusinessUnitID = bu.BusinessUnitID
      LEFT JOIN @AdminOrReporterAttestation a
      ON c.CFTCReportID = a.Id
   WHERE c.ContractFuturesMonth = @FinalFriday AND bu.BusinessDivisionCd IN
         (select BusinessDivisionCd from @BusinessDivisionCds)
END

At work the backlog grooming is being renamed to backlog refinement.

The term "grooming" is seen as pedophilic.

Tuesday, July 2, 2019

Page 325 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis touches on Template-Driven forms in Angular 5.

These are the other way to do the forms that everyone hates in contrast to the Model-Driven (or Reactive) forms. They'll have you punching the wall of your cubical when you work on them. You may put the required keyword at an input tag to make it required and you may check form.invalid off of the form that uses ngForm and it should only be true if a validation is not met. This is like form.dirty right? There is a dirty property on each individual field too. The opposite from dirty is pristine and I was surprised to learn of touched hanging off of each field to measure not if something has changed like dirty but if something was ever visited.

Monday, July 1, 2019

Static typing implies a strongly-typed language that is compiler safe.

The opposite of course is a dynamic or interpreted language where there is nothing catching errors before runtime.

making PDF reports off of SSRS reports that fake the look of an old school paper and ink government form

Apparently, you may use an image as a background in SSRS. You could scan the piece of paper in question and lay that out as a background in SSRS and then overlay SSRS controls.