Tuesday, December 31, 2019

Copy HTML into the clipboard from the DOM with JavaScript.

var textArea = document.createElement("textarea");
textArea.value = document.getElementById("touchMe").innerHTML;
textArea.style.position = "fixed";
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
document.execCommand('copy');
document.body.removeChild(textArea);

 
 

Honestly, something like this might be a little bit better:

if (!copying) {
   copying = true;
   var textArea = document.createElement("textarea");
   textArea.value = document.getElementById("touchMe").innerHTML;
   textArea.style.position = "fixed";
   document.body.appendChild(textArea);
   textArea.focus();
   textArea.select();
   document.execCommand('copy');
   var cleanUp = function() {
   try {
      document.body.removeChild(textArea);
   } catch (error) {
      
   }    clearInterval(interval);
   copying = false;
   };
   var interval = setInterval(cleanUp, 6000);
}

A switch is designed to connect computers within your LAN.

A router gives you your internet connection.

Ctrl-P

...tends to kick off printing things in Windowsland.

SentryOne Plan Explorer

This helps you see the execution plan for a blob of T-SQL and tune it.

Apache Directory Studio

It will allow you to browse Active Directory records.

ApexSQL

It is a set of SQL Server DBA tools.

pivot table

It's a snapshot, a high-level summary of a more detailed table.

Dashforge

It's a Bootstrap 4 template for a dashboard.

New Local Branch From...

The "Team Explorer" in Visual Studio 2019 will allow you to tie into Git. You may switch between the dev and master branches. You may right-click on one of them and pick "New Local Branch From..." to make a new branch.

GitLab is Linux-based.

You host it on Linux servers. You do Azure DevOps stuff with it. You can have a wiki.

bitmask

This determines something with a series of on and off switches.

Koycera is a brand of printer.

Lexmark is a brand of printer.

Luddite

dictionary.com offers: someone who is opposed or resistant to new technologies or technological change

Scala cake pattern

It has to do with stacking up components to build out an application.

switcheroo

It swaps out a React component in a React app based upon part of the URL, hence the name switcheroo. It is JavaScript routing magic to accommodate partial views in asynchronous swapability, etc.

Scalar functions in T-SQL return you a single value while table-valued functions return a table.

Table-valued functions (TVF) are kind of like views only you hand in some variables. In aggregate functions you write your own versions of some of the "aggregates" associated with GROUP BY clauses such as SUM and COUNT and STRING_AGG. Meh.

Mitel Connect

It is another stupid chat app.

Monday, December 30, 2019

It is possible to craft raw SQL strings with Entity Framework implementations that just allow attackers to do SQL injection attacks!

using System;
using System.Collections.Generic;
using System.Linq;
using DataAccessLayer.Models;
using Microsoft.EntityFrameworkCore;
namespace DataAccessLayer.Filters.Entity
{
   public static partial class Filters
   {
      public static List<dbo.Foo> GetFoo(this DbSet<Foo> DbSet, string bar) =>
         DbSet.FromSqlRaw("select * from Foo where Baz = '{0}'", bar)
            .Include(x => x.Qux)
            .OrderBy(x => x.Id)
            .ToList();
   }
}

 
 

The .Include here will drag along the joined Qux for each Foo if there is one I think.

Umbrella JS

It is something like jQuery with similar syntax only lighter in fatness. This is not just a lighter jQuery like zepto.js was.

Saturday, December 28, 2019

Winaero is pronounced "win arrow" and may be installed at the most recent three versions of Windows to extend what Windows may do.

For example, you may turn off the ability to lock your computer at Windows 10 with Winaero.

Premium domain names sort of cost more.

I read about them this morning and there are basically two shapes. The keepers of .info or other new-as-of-the-new-millennium top level domains can subjectively price up never registered names they think are special. The other, more interesting shape is simply a domain name that someone already owns having a fat price tag. This squatter-controlled variant is interesting to me because I just realized this week that its shape has changed a little bit. It used to be that when you went to register.com or Network Solutions or GoDaddy or wherever to try to buy decanet.com that you would just be told that someone already owns it and then you could use the whois lookup stuff to figure out who owned it. Also, you might be able to just go to decanet.com and see a ceremonial web page advertising for how one might buy the domain name. Anyhow, the ceremonial web page is still there, but the registry stuff behaves differently. Instead of being told at the registry that "it's taken" you are told "it's available" and when you hit their shopping cart to try to checkout your socks are blown off (forgive the cliché (who came up with "socks are blown off" anyways?)) by the price tag. How is that possible? Apparently there are now tools that facilitate this for domain name squatters that registries honor. Arguably this is just greasing the wheels of capitalism. It probably helps average Joe by just dropping the price tag to an acceptable floor in lieu of there being some bidding and negotiations back-and-forth.

Paywall

It's the whole selective access restriction that does not allow you to see content at a web site until you sign up for a membership. You have to pay to get around the wall, get it? I found a playlist with the first few episodes of the Harley Quinn cartoon at YouTube and this term was namedropped along the way.

Friday, December 27, 2019

createStore

It's the command to actually create the Redux store in Reactland. And, yes, you don't have to do this in the Angular approach.

Dragging in D3 charting to an Angular application allows for some jQueryesque nastiness.

Import like so:

import * as d3 from 'd3';

 
 

Make a variable:

private host: d3.Selection<any>;

 
 

Then do stuff:

let innerWrapper = this.host.select("#outerWrapper")
   .append("div")
   .attr("id", "innerWrapper")
   .style("max-width", '800px');

The feature name "records" does not exist in the state, therefore createFeatureSelector cannot access it.

This error came for me in having an store shaped like so:

import { IModelStore } from "../models/model-store";
export interface IMainStore {
   records: IModelStore
}
export const ModelStore: IModelStore = {
   records: null
}

 
 

I replaced it with this:

import { IModelStore } from "../models/model-store";
export interface IMainStore {
   models: IModelStore
}
export const ModelStore: IModelStore = {
   records: null
}

 
 

The doubleup of the name "records" was somehow making things sick!

No store found. Make sure you follow the instructions.

When you see this error in the Redux DevTools for Google Chrome (which appear as a new tab in the Google Chrome Developer Tools that you see when you press F12 at Google Chrome) you get around that by putting this as an import at your outermost God module of your Angular 8 application:

StoreDevtoolsModule.instrument()

 
 

Put this up top in the .ts file to get it to work:

import { StoreDevtoolsModule } from '@ngrx/store-devtools';

 
 

In order to get that to work you must specifically install something.

npm install @ngrx/store-devtools

What's cooking in the kitchen?

I've learned the hard way that the jury is out as to whether or not a job is a good job until the day it ends. Today was my last day at ILM Services and I am pleased to report that it was a good job. Let me introduce you to some of the characters:

Dan Lehto is in the foreground of this 1/14/2019 photo and from left to right across the back are Jason "J" Erdahl, Jason Carlson, Matt McDonald, Luna Ahmed, and finally Amy Rempher with her back to us. We were celebrating five years of employment for Matt on this day.

Let's just focus on the faces showing in this photo. From left to right they are Alex Ryazhnov, Phil Nowak, Amy Rempher, Doug Little, and Brett Hazen. The photo is from 7/26/2019 and the occasion was a planning session for what the sessions should be for the 2019 Minnesota Developers Conference which was spearheaded by ILM (imagination, learning, mentorship).

Amy Rempher, Joe DeCock, Phil Nowak with his back to us, Dan Lehto, Chris Vitko, Justin Blake, and finally Matt McDonald are shown from left to right in this 11/22/2019 meeting for which there was both a Thanksgiving time potluck and later a discourse on 401K benefits that I didn't stick around for. Matt is hamming up the picture a little bit by being the one person in all three photos who realizes he is being photographed, but I forgive him.

Tuesday, December 24, 2019

I'm finally done with Chapter 8 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis.

There are now less than one hundred pages for me to read in 2020 to be done with this book I am completely sick of. By the time I am done with this thing I will have been nibbling on it for more than two years. I guess this shows off how quickly I read books. I remember that when I was at Headspring that Dustin Wells would opine that he never finished books so I probably shouldn't judge myself too harshly. He's doing just fine. Anyways, here are some of the things I've learned since last writing of this treatise on now dated tech.

  1. Some claims in the Microsoft Identity model are spun up on page 391. I don't understand this yet. now is a variable below which has DateTime.UtcNow assigned to it.
    var claims = new[] {
       new Claim(JwtRegisteredClaimNames.Sub, user.Id),
       new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
       new Claim(JwtRegisteredClaimNames.Iat,
          new DateTimeOffset(now).ToUnixTimeSeconds().ToString())
    };
  2. The book has us storing tokens in localStorage! I don't know how I feel about that. Anyhow it mentions that roundtripping (making up my own word) to localStorage and back is a synchronous thing and if you need to do it asynchronously to improve performance you should check out angular-async-local-storage an npm package by Cyrille Tuzi namedropped on page 400.
  3. ?. the Elvis operator of Angular 5 should not be confused with !. the "non-null assertion operator" of TypeScript which is used in the middle of something in a truthy/falsey check. If the left side is both not null and not undefined and the right side is truthy the two things separated by the operator (the right thing should be a property/variable or a function/method hanging off of the left thing as would make sense if the exclamation point were not there) get graded as truthy. This comes up twice in chapter 8. I don't understand how it works other than as perhaps a convention. If you look at the JavaScript the Typescript makes the exclamation point just comes out so there is no safeguard keeping your code from blowing up when the left side is null or undefined.
  4. The book advocates using the Watch window in Visual Studio to look at the Request coming over the wire to the API side and at Request.Headers.HeaderAuthorization you may see the token.
  5. The way the ahead of time complication works apparently involves turning a template into a TypeScript class. This is the reason that the component's methods accessed by the template must be public in AOT complication as now a class is trying to talk to a different class in TypeScript compilation. Without AOT, the template may just access private methods in a paradigm that at first blew my mind as it broke with the web forms and web forms code behinds way of doing things. (Angular is the new web forms.)
  6. The [Authorize] attribute in ASP.NET Core decorates API endpoints to validate the token used. I don't understand how this thing works yet either.
  7. Sliding sessions allow more life to be added to a token, setting back its expiration date, with every use of the token. So if a token is to only live for half an hour and you spend four solid hours working in a web portal, you will not be booted.

Saturday, December 21, 2019

HTTP referer

I just saw something online that points out that this field in an HTTP header (for where one was before one came in the door to where they are now) is a misspelling of referrer.

Friday, December 20, 2019

How do I test a service in an Angular application?

What a puzzle! I have found an article online that just shows off testing services that are the equivalent of static utilities in C#, but where is the fun in that? The really question here is: How do I test a service that has external dependencies (API calls) in it? I think you are going to have to do the deps trick to hand in external dependencies to a service, stub/mock the deps, and then unit test the rest of functionality in the service. This would mean that HttpClient calls are kept in a few common methods and that services just prep what is handed into those methods, etc. This may sound clunky, but it is less clunky if you are doing GraphQL instead of ReST wherein you are always using the POST verb and what is handed in, the query, is always ultimately a string.

  1. https://semaphoreci.com/community/tutorials/testing-services-in-angular-2
  2. https://medium.com/@MatheusCAS/injecting-a-service-into-another-service-in-angular-3b253df5c21
  3. https://blog.angulartraining.com/how-to-write-unit-tests-for-angular-code-that-uses-the-httpclient-429fa782eb15

Get back both an Observable and then later ultimately a Promise with HttpClient in an Angular 8 application.

import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from '../../environments/environment';
import { Model } from '../models/model';
import { HttpClient } from '@angular/common/http';
import { Contract } from '../contracts/contract';
@Injectable()
export class Service implements Contract {
   constructor(private http: HttpClient) {}
   
   GetModelsFromServer(methodToCall: (models:Array<Model>) => void): void {
      let o:Observable<Array<Model>> = this.http.get<Array<Model>>(environment.x);
      let p:Promise<Array<Model>> = o.toPromise();
      p.then((results) => {
            console.log(results);
         methodToCall(results);
         }, (error) => {
            console.log("Trouble: " + JSON.stringify(error));
         });
   }
}

 
 

I have long heard that HttpClient was the new Http and what is above should keep you from using this anymore:

import { Http, Headers, RequestOptions } from '@angular/http';

 
 

Posts look like this instead:

import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from '../../environments/environment';
import { Model } from '../models/model';
import { HttpClient } from '@angular/common/http';
import { Contract } from '../contracts/contract';
import { HttpHeaders } from '@angular/common/http';
@Injectable()
export class Service implements Contract {
   constructor(private http: HttpClient) {}
   
   SaveToServer(model: Model, methodToCall: (models:Model) => void): void {
      let o:Observable<Model> = this.http.post<Model>(
            environment.x,
            model,
            {
               headers: new HttpHeaders({'Content-Type': 'application/json'})
            }
         );
      let p:Promise<Model> = o.toPromise();
      p.then((results) => {
         console.log(results);
         methodToCall(results);
         }, (error) => {
         console.log("Trouble: " + JSON.stringify(error));
         });
   }
}

 
 

Puts look like this:

import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from '../../environments/environment';
import { Model } from '../models/model';
import { HttpClient } from '@angular/common/http';
import { Contract } from '../contracts/contract';
import { HttpHeaders } from '@angular/common/http';
@Injectable()
export class Service implements Contract {
   constructor(private http: HttpClient) {}
   
   UpdateModel(model: Model): void {
      let o:Observable<void> = this.http.put<void>(
            environment.x,
            model,
            {
               headers: new HttpHeaders({'Content-Type': 'application/json'})
            }
         );
      let p:Promise<void> = o.toPromise();
      p.then(() => {
            console.log("Fire and forget without error!");
         }, (error) => {
            console.log("Trouble: " + JSON.stringify(error));
         });
   }
}

 
 

Delete:

import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from '../../environments/environment';
import { HttpClient } from '@angular/common/http';
import { Contract } from '../contracts/contract';
import { HttpHeaders } from '@angular/common/http';
@Injectable()
export class Service implements Contract {
   constructor(private http: HttpClient) {}
   
   DeleteModel(id: number): void {
      let o:Observable<void> = this.http.delete<void>(
            environment.x + "/" + id,
            {
               headers: new HttpHeaders({'Content-Type': 'application/json'})
            }
         );
      let p:Promise<void> = o.toPromise();
      p.then(() => {
            console.log("Fire and forget without error!");
         }, (error) => {
            console.log("Trouble: " + JSON.stringify(error));
         });
   }
}

Thursday, December 19, 2019

When I spun up an Angular 8 application today and tried to add providers to AppModule a series of errors appeared at the console requiring doctor-ups to polyfills.ts as a remedy.

Uncaught ReferenceError: global is not defined

To get past this first, I added this to polyfills.ts at the top:

(window as any).global = window;

 
 

Uncaught ReferenceError: Buffer is not defined

To get past this next, I expanded upon what I put in polyfills.ts like so:

(window as any).global = window;
(window as any).Buffer = {};

 
 

Uncaught ReferenceError: process is not defined

To get past this third in order and second to last, I expanded upon what I put in polyfills.ts like so:

(window as any).global = window;
(window as any).Buffer = {};
(window as any).process = {
   env: { DEBUG: undefined }
};

 
 

Uncaught TypeError: Cannot read property 'slice' of undefined

To get past this lastly, I expanded upon what I put in polyfills.ts like so:

(window as any).global = window;
(window as any).Buffer = {};
(window as any).process = {
   env: { DEBUG: undefined },
   version: []
};

a different way to do the Injectable decorator at a service in an Angular 8 application which cries out the module to wire it up

@Injectable({
   providedIn: AppModule
})

command line commands to set up a new Angular 8 application with Materials and "the store"

  • npm install -g @angular/cli
  • npm install
  • ng new dumbapp --routing --style=scss
  • cd dumbapp
  • ng add @angular/material
  • npm install @ngrx/store @ngrx/effects

'ng' is not recognized as an internal or external command, operable program or batch file

Try installing the Angular CLI globally with the -g per line two here. That should get you around this error. I found something in Googling about a PATH variable. (I started to type "advanced system settings" at the start bar in Windowsland and that opened up a "View advanced system settings" option which I clicked which opened the "System Properties" dialog box. There I clicked the "Environment Variables..." button to open the "Environment Variables" dialog box.) Anyhow, it's not the PATH variable.

Make a dumb .NET Framework 4.7.2 API to test an Angular application with in Visual Studio 2017!

using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web.Http;
namespace DumbApi.Controllers
{
   public class ValuesController : ApiController
   {
      public HttpResponseMessage Get()
      {
         DateTime immediacy = DateTime.UtcNow;
         List<Tuple<string, int>> tuples = new List<Tuple<string, int>>()
         {
            new Tuple<string, int>("foo", immediacy.Day),
            new Tuple<string, int>("bar", immediacy.Hour),
            new Tuple<string, int>("baz", immediacy.Minute),
            new Tuple<string, int>("qux", immediacy.Second)
         };
         HttpConfiguration config = new HttpConfiguration();
         config.Formatters.JsonFormatter.SupportedMediaTypes.Add(
            new MediaTypeHeaderValue("text/html")
         );
         var response = Request.CreateResponse(HttpStatusCode.OK, tuples, config);
         response.Headers.Add("Access-Control-Allow-Origin", "*");
         return response;
      }
   }
}

 
 

What is above will spit out something like this:

[
   {"m_Item1":"foo","m_Item2":19},
   {"m_Item1":"bar","m_Item2":15},
   {"m_Item1":"baz","m_Item2":32},
   {"m_Item1":"qux","m_Item2":16}
]

Wednesday, December 18, 2019

How may I check spelling in Visual Studio?

Maybe with... Visual Studio Spell Checker ...well maybe not. A friend is telling me it doesn't work well with Visual Studio 2019. Nuts. Other links:

SnapCard can mean two different things.

It can be a card you swipe to spend Bitcoin or it can be a card for spending food stamps in modern times. In the second circumstance SNAP is the Supplemental Nutrition Assistance Program.

Tuesday, December 17, 2019

Sunday, December 15, 2019

.NET 5

Xamarin, Mono, .NET Core, and .NET Framework are all going to be unified in this fifth thing and it will be built out in a way that they may all be built out.

Thursday, December 12, 2019

looking for a used car?

  • https://www.kbb.com/ can help with reasonable pricing if you punch in the year, make, model, and mileage. The corporate entity name, such as Toyota, is the make. The particular type car, such as Corolla, is the model.
  • https://www.carfax.com/value/ can help with the history of a car if you punch in the VIN (vehicle identification number) number.

the "teach a man to fish" quote that often comes up in software

Give a man a fish, and you feed him for a day. Teach a man to fish, and you feed him for a lifetime.

Pitney Bowes

...peddles the personal postage meter.

Wednesday, December 11, 2019

assorted strange SQL

  1. LEAD and LAG are esoteric and obscure. They are like ROW_NUMBER() only they get either the page before or the page after what ROW_NUMBER() would get.
  2. The whole SELECT INTO trick in T-SQL to SELECT into a temp table that is spun up right then may also be used to just make a new, regular table!
  3. When a table variable is passed to a stored procedure (in T-SQL) it is a TVP (table-valued parameter).
  4. CTEs in T-SQL use In-Memory memory management while table variables may use the Memory-Optimized Table approach to memory. I don't really understand this stuff. The MOT approach has a divide between Durable and Non-Durable and I don't understand that yet either.
  5. Not every reserved keyword in T-SQL must be wrapped in brackets to be used as a name. This only applies to the keywords which could otherwise be keywords (without error) in the SQL statement at hand.

Sage

This is another ERP yet. Sage is French and you pay upfront for everything you are going to get in terms of goodies instead of as you go.

Tuesday, December 10, 2019

when the file you added is not under "Excluded Changes" in TFS for some strange reason

  1. Go into the Source Control Explorer in Visual Studio 2017.
  2. Navigate to the folder holding the file you want to add.
  3. Right-click and pick: Add Items to Folder...

You may cast numbers back to characters in C#.

Obviously you may do something like so to get the number 120.

char x = 'x';
int number = (int)x;

 
 

I would offer that this is also legit for getting \r

char enter = (char)13;

Monday, December 9, 2019

ENOENT stands for Error NO ENTry

The file may just be in some dumb locked state when you get the ENOENT error. Try stopping and restarting the server. I fixed this problem for myself with as much today.

TypeScript let keyword block scoping coolness in switch statements

One of the things the let scoping around if/then statement affords is that you may use a let variable with the same name in different cases of a case/switch statement if you just nest that variable's instantiation each time inside of a truthy/false check in an if statement.

the .find in lodash

My match variable here ended up being a single object and not an array of objects.

let match = _.find(this.attorneyFilterList, function(item) {
   return item.label == potentialState.openingTier;
});

Sunday, December 8, 2019

I'd like to tell you about my three predictions for the 2020s.

  1. The ever escalating upwards trend in censorship (restrictions on what is acceptable on social media) hits a plateau and a consensus that we begrudgingly accept as a society governs us. This lasts as a guideline across a long lull until it is challenged again and when it is challenged again it will not be quickly tossed out.
  2. The near monopoly on tech that the United States of America enjoys will end as other nations get into the game.
  3. JavaScript loses its newness.

 
 

Addendum 12/10/2019: In the video clip here I meant Knockout when I said Bootstrap. Ha! I was distracted.

 
 

Addendum 1/30/2020: My reference to Bootstrap here is not ridiculous after all. I looked into it and Bootstrap, which has a good deal of JavaScript to it, basically is a Mickey Mouse GitHub project.

Here are some random things I've never heard about before from a ping over LinkedIn to get me to pursue a certification.

Six Sigma is a spec for improving a process. Define, Measure, Analyze, Improve, and Control are the five steps in the six, which doesn't make sense. Also, it might be Define, Measure, Analyze, Design, and Verify too. I'm just glancing at the Wikipedia write up and I don't really care. TOGAF is The Open Group Architecture Framework and there is a certification you can get along these lines. I guess there are a handful of different certifications in different technical oddities.

Saturday, December 7, 2019

little o or small o

The difference between this and Big O is that Big O has to do with exponential complexity, the same list to loop through potentially having to be looped against for every step in an outer loop, etc. The "find the longest palindrome" example would apply to Big O. In little o the inner loop is just a different thing altogether with its size not bound to the size of the first loop to being with. An example might be one in which we have two lists of words and we want to make a third list that only has words in both the lists, perhaps to give bonus offers to customers (usernames for the words) enrolled in two separate loyalty programs or some such hogwash. Also, you can see the right way and the wrong way to this, right? The wrong way makes for easy to read code but is expensive. You could just have a loop across the first list with a loop inside for the second list creating an a times b level of expensive/complexity. The better thing to do is to sort both lists alphabetically and then increment a position in the second list appropriately as you walk the first list and therein just walk the second list once. Also, Big O measures the most expensive possible circumstance while big Ω the least and big ϴ both, and I thought I'd mention it with everything else here. The upper bounds and the lower bounds are the proper terms for what I am dubbing "most" and "least" respectively.

You may have a database index that is made up of two columns wherein the combo of the two columns must be unique.

It is a thing.

Friday, December 6, 2019

ExpressionChangedAfterItHasBeenCheckedError

This suggests this is specifically to do with a ViewChild getting messed up in the AfterViewInit lifecycle hook in an Angular application. It is going to be something like this insofar as you are trying to manipulate a ViewChild that is lacking in some fashion. The first link I provide here suggests it stems from race conditions as many things manipulate the DOM at "once" so to speak.

Thursday, December 5, 2019

the quickest way to make a copy of an array with a new pointer in JavaScript

foo = foo.slice();

 
 

This is obviously different from the way to approach an object like so:

foo = Object.assign({}, foo);

 
 

In TypeScript you would approach the object issue like so:

foo = { ...foo };

 
 

What is the difference between .splice() and .slice() in JavaScript? They both return a chunk of the array, but the slice leaves the original unedited while the splice will remove from the first array the part it hands back from its returning.

Tux is the penguin mascot of Linux.

Puffy is the pufferfish mascot of OpenBSD and Beastie is the demon mascot of FreeBSD.

the creative

This is another word for the mockups or the comps. It's not wireframes. It is stuff with the full Photoshop bake out of how screens should look. One should be able to roll HTML and CSS based on the creative.

Razor in .NET Core

  1. Fluent Validation a library for form validations.
  2. The plain Jane validations in .NET Core's MVC and Razor paradigm are more spiffy than those of the .NET Framework days. Validations can happen at a POST method at a ReST API controller action based on the data annotations at the POCO getting mapped to.
  3. jQuery DataTables is a way to do a paginated list of records and it does support a way to do server-side pagination with AJAX calls.

Tuesday, December 3, 2019

How do I get at someone else's Shelveset in TFS.

Go to your own shelvesets and you will see, at the top of the pane, a place to change the name of party for the shelvesets list.

using statements in C# 8 have a bit more variations

using FileStream f = new FileStream(@"C:\users\jaredpar\using.md");

Per this cheatsheet is legit, and you can just use f and eventually f will dispose. The f lives until the close curly brace around it.

the Subject generic in the TypeScript of RxJS

As suggested here it is an Observable. Just put the next thing onto it with .next as suggested here.

When you somehow highlight a row of code in Visual Studio Code...

Well, for me this happened when I pressed Ctrl-F and opened a little search bar and then the copy in the search was highlighted in the file I was looking at. I got rid of it by closing the search bar.

get to "Manage Connections" in TFS when your TFS in the cloud seems to be offline

I cannot seem to duplicate the error I had to be sure I am typing up the right thing in this blog posting, but what I think I did was go to the Team Explorer pane in Visual Studio 2017, then click the downwards pointing arrow at the right of Home at the left top, and then I either picked it here/there or I picked Settings or something first.

Monday, December 2, 2019

OnPreLoad

In web forms this event runs before Page_Load and has to do with a point in time when ViewState is loaded but not the controls just yet. I had not heard of it before. This has a cheatsheet of lifecycle stuff for web forms.

Sunday, December 1, 2019

sfs stands for shout out for shoutout

If you are advertising this on Instagram you are saying: holla at me and I'll holla back... we can both advertise each other on Instagram and gain followers from each other's followers! (fine.)

second stab at React

Alright guys, React is now the thing for me to learn and I have gone back through the first twenty minutes of this for a second time as a refresher. Beyond what I wrote here, the following is stuff I did not document the first time.

  1. Install the latest Node and also React Developer Tools for Chrome before starting a new app. With regards to this second item, two new tabs will appear in the Google Chrome Developer Tools when you press F12, Components and Profiler, but they will only appear when you are looking at a React application.
  2. I used the three steps here to make a new application and get it underway. I want to say that I learned that in the first step the name of the application cannot just be a period as the YouTube movie suggests and it cannot have an uppercase letter in it. I think both of these things were once viable. They are not viable anymore.
  3. The Virtual DOM in React allows for isolation, so that when a form posts to a "Post Component" only the component changes and not the whole of the page.
  4. The context API allows for the use of "app-level state" without Redux.
  5. Class Post extends React.Component is an example of the declaration for a component. I am pretty sure this (well, something very much like it) exists elsewhere on this blog but here it is again.
  6. Ctrl-C will stop the server when run from a command prompt in Windowsland the same as in the Angular space.
  7. render() is a lifecycle method on a component and the only one it has to have.