Saturday, June 30, 2018

A coworker was telling me about Hadoop some yesterday.

You may use Hadoop in big data scenarios. Replacing an ETL or running queries where the queries are "heavy" are pretty good use cases. Queries can sure be slow when you are crawling millions of records and especially so if the query is also crawling several racks of computers in several data centers and has to look through all of the computers. One of two things that Hadoop does to make things fast is to keep metadata records of ranges (say if you were searching people by last name at data as big as Facebook's) for searches at a sister metadata server logistically "next to" the main master server that will be running Hadoop itself and doing the querying. This will tell you things like... I dunno... the people with the last names that start with Dw are on this computer in this rack in this datacenter over here. It would be impossible to try to find someone you are not connected to on Facebook if Facebook did not allow you to use this technology (this piece is called Hive) to look someone up. Below the data nodes are the individual computers and the slaves the racks in datacenters. I'll get to what the secondary name node is in a minute.

 
secondary name node
name node (master)
metadata server
 
   
   
slave
data
node
data
node
data
node
data
node
data
node
data
node
data
node
data
node
   
   
slave
data
node
data
node
data
node
data
node
data
node
data
node
data
node
data
node
   
   
slave
data
node
data
node
data
node
data
node
data
node
data
node
data
node
data
node
   
   
slave
data
node
data
node
data
node
data
node
data
node
data
node
data
node
data
node
   
   
slave
data
node
data
node
data
node
data
node
data
node
data
node
data
node
data
node
   
   
slave
data
node
data
node
data
node
data
node
data
node
data
node
data
node
data
node
   
   
slave
data
node
data
node
data
node
data
node
data
node
data
node
data
node
data
node
   
   
slave
data
node
data
node
data
node
data
node
data
node
data
node
data
node
data
node

HQL is the Hive Query Language, and a rival/alternative to Hive is Impala. Instead of having the metadata server's cache grow too fat and cause performance problems which can happen with Hive, Impala stores queries at the databases being queried. I would assume there has to be some outside indexing at the metadata server too, but maybe I'm wrong. I don't really know what I'm talking about. Ha ha. Cloudera provides Apache Hadoop and Apache Spark software. (The community just puts all of this stuff under the Apache license by convention). Hortonworks is a company like Cloudera and it has ties to IBM. Apparently IBM has a big data university where one may take online classes and this is where my colleague got his own ramp up on this sphere of things. Alright, let me circular back to a couple of things I have name dropped: Spark and the secondary name node ...The other way the Hadoop approach may make an ETL process faster is with Spark which allows of parallel processing for batch processing of records to be written back to the databases at the data nodes with machine learning to boot. Data will be split and stored on numerous computers and while we are at it and have the performance gain of the parallel processing we can afford to write duplicate records to different machines to have backups. But, what if master dies? How should THAT be backed up? The secondary name node is a periodic backup of the name node (Hadoop server) and is never used in any other capacity unless there is indeed a problem one dark day. At the metadata server we will have job trackers paired with task trackers and when a task is found there is a judgment call made about whether or not it should be approved and the job runs upon approval. The metadata server's machinery can apply to the write side with Spark and not just the read side with Hive and this arena of things (task trackers and job trackers) is called the MapReduce level. The chart above in contrast shows the structure level which is the layout of server interactions. Peak and Woozy are two other tools that come into play at the data node granularity of which my teacher for the moment restrained himself from speaking of suggesting that everything else he just mentioned was more than enough for an elementary introduction.

Friday, June 29, 2018

baidu.com

It's the Chinese Google.

use HttpClient in a canned Visual Studio Angular 5 application

Per "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis one must have HttpClientModule in the imports metadata property in app.module.shared.ts in a canned Visual Studio Angular 5 application to use HttpClient. Import it like so:

import { HttpClientModule } from "@angular/common/http";

Thursday, June 28, 2018

This was interesting, but I could not get it to work.

clone from a colleagues' branch using git command line commands at a Git Bash shell

  1. start with an empty folder and clone in the master stuff with git clone https://git@github.example.com:u000000/MyTools.git
  2. a folder will be made in the folder you pulled code down into... go one folder deep into that folder
  3. at the GitHub web interface, have your coworker go to his profile and from there drill into his repository, not the master repository, to get the path to his stuff
  4. add a remote like so: git remote add MyTools git@github.example.com:u123456/MyTools.git
  5. pull down code from the remote: git clone https://git@github.example.com:u123456/MyTools.git

 
 

Addendum 6/29/2018: These commands give an example of doing this for real:

  1. git clone git@github.example.com:u000000/MyTools.git
  2. cd MyTools
  3. git remote add myfriendlyname git@github.example.com:u123456/MyTools.git
  4. git remote -v
  5. git fetch myfriendlyname
  6. git checkout -b 3FOX myfriendlyname/myspecificbranch

Wednesday, June 27, 2018

When searching in Visual Studio Code 1.17.2 you may filter with regular expressions.

One of the icons to the right of the search box toggles this on and off and it looks like a square dot with an asterisk by it. Alt-F will also toggle this control if you don't want to manually click on it.

what compiles?

Click on "TypeScript" at the base of Visual Studio Code 1.17.2 at the lower right when you have a .ts file open to change the version of TypeScript to affect the squiggly red lines put under things and the sanity checking of what compiles.

at process._tickCallback (internal/process/next_tick.js:188:7)

This error means that Node is giving up and is no longer running.

RxJS skip and take

Just as you have Skip and Take in C#'s LINQ, there is also skip and take in the Observables stuff for RxJS. These both take an integer for the number of items to skip or take. There is also skipWhile and takeWhile and these will take a condition such as: takeWhile(val => val <= 4)

BASE_URL

Something from "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis...

constructor(@Inject('BASE_URL') base: string) {

 
 

This at the constructor of an Angular 5 component allows you to turn around and use it in an HttpClient implementation like so:

this.http.get<Foo[]>(base + "api/foo").subscribe(result => {
   this.foo = result;
}, error => console.error(error));

 
 

This kinda assumes that the Angular stuff and the C# API have the same root URL as perhaps in a canned Visual Studio Angular application.

Using Git Bash commands, suck the code from another code base into the code you are working on.

There may be a lot of merge conflicts to resolve in the event of similarly named folders and files. Then again, if the folder setup is wildly different everything new could perhaps just sit side by side with what you had.

git remote add MyTools git@github.example.com:my-Project/MyTools.git
git rebase MyTools/master

rm -r node_modules

...as a Git Bash command will delete the node_modules folder assuming you are in a folder holding the node_modules folder... afterwards type ls to get a directory listing and be sure the folder is gone... -r is for recursive and you will need it if the folder is not empty

clear screen

...as a Git Bash command this will hide all of your history... basically by scrolling you down some

files with ~HEAD appended to otherwise duplicate names appearing after a GitHub merge

These conflict markers suggest that you are not finished merging. This is metadata file stuff like the corny hidden .svn folders (or was it svn folders?) that Subversion would put in each of your folders.

git add -u

Instead of...

git add .

 
 

...solidifies deletes instead of adds in a Git Bash shell.

prep a new project when pulling from GitHub with Git Bash allowing for long path names

  1. make a new folder for keeping the stuff... let's say it is C:\PlayPlace
  2. clone in the project with git clone git@github.example.com:my-Project/MyTools.git
  3. assuming your stuff came down in a folder named "MyTools" shall we say, then go to C:\PlayPlace\MyTools in Windows Explorer
  4. close the Git Bash shell and open a new Git Bash shell at C:\PlayPlace\MyTools from the Windows folder
  5. run git remote -v and you will probably see two lines for origin and none for source
  6. run git remote add source git@github.example.com:my-Project/MyTools.git
  7. rerun git remote -v and you should see two entries for origin and two for source, four in total
  8. now go to C:\PlayPlace\MyTools\.git in Windows Explorer to reveal a hidden folder
  9. open the "config" file and add longpaths = true under [core] not [remote "origin"] nor [branch "master"]
  10. run git pull --rebase source master to get the files you could not get before which have long path names

Tuesday, June 26, 2018

version 1.24.1 of Visual Studio Code will autoimport imports in TypeScript files for an Angular application

It will also grey-out unused imports and unused variables.

tap is for a side effect in NgRx

We are tapping into something here:

this.foo = this.store.select(mySelector).pipe(tap(m => this.model = m));

 
 

It is a "while you are passing through, do this too" bolt on. The .pipe code here will never run until there is a subscription to foo or perhaps foo is used with the async pipe in component template markup.

Accept Incoming Changes

You will see this as a link above <<<<<<< Head in Visual Studio Code 1.17.2 when a file has a merge conflict. Clicking this link just takes the inbound changes and throws the others away.

 
 

Addendum 6/27/2018: I experienced a surprise today in pair programming with a coworker who was using this trick to pull another codebase into our own while our own codebase was winning in "Accept Incoming Changes" collisions. Perhaps "Incoming" suggests not literally of the drug in code base but instead which file was changed most recently.

Kubernetes

It organizes Docker containers. Docker Swarm is a rival container orchestration tool.

The font tag in HTML.

This is kinda like the span tag for restyling a stretch of copy in a paragraph perhaps in HTML, but it is long out of vogue.

I saw Duane Newman speak on Xamarin.Forms at the St. Louis .NET User Group last night.

This was a very high-level talk that sort of assumed the audience was populated with outsiders looking in. The one time Duane showed us some C# in Visual Studio instead of just the XAML (Extensible Application Markup Language) we saw a switch statement around Device.Idiom wherein TargetIdiom.Phone was one of the cases. This comes with a concept called OnIdiom, idiom as in idiomatic (niche-specific and tailored in kind), which allows you to tell in code if you are running code on a phone, a tablet, at a desktop, or at a TV. Some caveats were that UWP (Universal Windows Platform) always reports a device to be a desktop even if it is a tablet and cheaply manufactured android tablets often masquerade as phones. Flexbox, as a concept, entails having a series of items in either a horizontal row or a vertical row appearing in a progression be it left to right, right to left, top to bottom, or bottom to top. The flex stuff for newish CSS drives these layouts. Duane suggested this was something to consider for UX alongside grid layouts too as CSS has been brought into Xamarin.Forms in tandem with or in collision with XAML styles. Navigate that! Supported platforms for Xamarin are iOS, Android, UWP, and MacOS. Tizen, the platform Samsung uses for its TVs, phones, smartwatches, etc. uses Xamarin for the UI (user interface). You may publish Xamarin to a WPF (Windows Presentation Foundation) application and also a GTK+ (the name used to mean GIMP Toolkit where GIMP stands for GNU Image Manipulation Program) application for the Linux space. Also supported is WebAssembly, a binary format for code for web pages, in the form of Ooui (pronounced weee! and short for object-oriented UI), a GitHub project. The Blazor Project from Microsoft is an attempt to bring C# and .NET in the form of the Mono language to the browser allowing Xamarin.Forms in the browser via Ooui. The Master-Detail Page layout and the hamburger menus behave differently on different platforms which is something to keep in mind. State management distinguishing if controls are normal, focused (clicked on and immediately current), or disabled is new as of the last release of Xamarin.Forms. In giving an example of confusing UX, Duane had us look at the calculators on our phones. When the phone is held vertically it is a simple calculator and when flipped horizontally the calculator changes to scientific mode showing more controls. This is largely true across most devices and different platforms and is also... bad. I was surprised by the way flipping a phone horizontally unlocks extra functionality and Duane suggested it shocked him too. He gave an alternative calculator he made as an example of something better and as he drug out a window to exposure more real estate more controls appeared. xamarin.com was recommend as a resource. Microsoft Hyper-V (codenamed Viridian) can provide VMs for testing. Google Play, a digital distribution App Store kind of thing, has an emulator too. You have to have a Mac to use the iOS Simulator. Duane kept saying something like "Hacksem" which requires Windows Preview (huh?) and it is an emulator too though I can't figure out what he meant in Googling against a phonetic faking of what he said. ADK is the Accessory Development Kit for Android and iOS SDK (software development kit) is the counterpart for the iPhone space. From using visualstudio.com or VSTS (Visual Studio Team Services) one may tie into the toolkits and do builds. TestFlight is an installation and testing helper for the iPhone space that may be tied in. Cake (C# Make) may be used for build scripts. Duane Newman is with an Alien Arc Technologies, LLC which is a consultancy.

Monday, June 25, 2018

Math.max in JavaScript returns the highest number from a set of numbers.

Consider:

alert(Math.max());
alert(Math.max(13));
alert(Math.max(42, 23));
alert(Math.max(13, 69, 27));
alert(Math.max(13, 42, 69, 86));
alert(Math.max(86, 23, 27, "foo", 42));

 
 

Alright, the alerts will say -Infinity, 13, 42, 69, 86, and NaN in that order. If we set all of the maxs to mins like this...

alert(Math.min());
alert(Math.min(13));
alert(Math.min(42, 23));
alert(Math.min(13, 69, 27));
alert(Math.min(13, 42, 69, 86));
alert(Math.min(86, 23, 27, "foo", 42));

 
 

...we get: Infinity, 13, 23, 13, 13, NaN

the take imported from "rxjs/add/operator/take" in an Angular 4 application

Something like this...

return this.store.select(getWidgets).take(1).subscribe({
   widget => this.latestWidget = widget;
}).unsubscribe();

 
 

...can really just be something like this:

return this.store.select(getWidgets).take(1).subscribe({
   widget => this.latestWidget = widget;
});

 
 

The .take(1) makes the Observable go cold. There is no reason to unsubscribe. The listening is at an end. .take(1) is going to take the first value emitted from the Observable while .take(5) would take the first five. The door is held open at the Observable until the count is reached. .take(5) implies four updates triggered since the initial read. Some links:

when selectors call other selectors in the NgRx Redux pattern

Let's say you have a const variable like so in a breakfast.selector.ts file:

export const getBreakfast = createSelector(getEggs, getToast, getBacon, (eggs:
      Array<Egg>, toast: Array<BreadSlice>, bacon: Array<BaconStrip>):
      BreakfastModel =>
   ({
      name: eggs.length === 0 ? "Ghetto Breakfast" : bacon.length === 0 ? "Eggs
            & Sausage" : "Eggs & Bacon",
      numberOfEggs: eggs.length,
      hasBacon: bacon.length > 0,
      hasSausage: bacon.length === 0,
      hasOrangeJuice: true,
      toast: toast
   }));

 
 

...and an import to empower createSelector like so:

import { createSelector } from '@ngrx/store';

 
 

Yet, elsewhere is code, the selector is called like so in the name of fishing the BreakfastModel out of the store:

return this.store.select(getBreakfast).take(1);

 
 

The thing to notice is that it is called with no variables in spite of the fact that there is so very much being handed into createSelector. This should prompt the question "Where does all of the other stuff come from?" Alright, there will always be two or more variables handed into createSelector. The last of n number of variables will be a function that takes n-1 variables and returns a model, in this case BreakfastModel, and the n-1 variables are hydrated by the variables upstream of the function variable such that, in our case, getEggs populates eggs, getToast fills in toast, and getBacon, as the name suggest, gets us bacon. So what are getEggs, getToast, and getBacon? They would be other const variables. They too may be made with createSelector like so:

export const getEggs = createSelector(inventoryKitchen, (kitchen: Kitchen):
      Array<Egg> =>
   {
      return kitchen.eggs;
   });

 
 

Obviously, not every createSelector can be hydrated by a createSelector. There has to be something else somewhere upstream of all that. In the case immediately above inventoryKitchen could just be a function assigned to a const variable. If there is just a function returning an object at the mouth of the river, the createSelector machinery must also be trying to pull stuff of the shape handed in from the store in lieu of just using the default object handed in. I'm not sure how that works just yet. It's magic to me.

Make Google Chrome Developer Tools cling to the right edge of Google Chrome instead of the bottom.

Click on the three dots in a vertical progression at the upper right, just left of the X for closing Google Chrome Developer Tools. Then pick one of the "Dock side" options. The rightmost one specifically docks right.

firstChange with SimpleChanges at ngOnChanges in an Angular 4 application

Alright this if condition is going to get met if the myInput input changes for the first time:

ngOnChanges(changes: SimpleChanges) {
   if(changes.myInput.firstChange) {
      alert('it changed!');

Cross-Origin Read Blocking

CORB is an algorithm for flagging and not going forward with alarming API endpoints which have CORS (Cross-Origin Resource Sharing) opened up and are readable but nonetheless are not something you should want to read from as they are sinister somehow. Imagine the difference between medicine locked up in the medicine cabinet (no CORS) and a bottle of poison freely sitting out and available (no CORB) to understand this. Beyond your ethernet (LAN), be careful what you drink.

Sunday, June 24, 2018

I saw Josh Godi speak at the STL Angular Meetup Wednesday night on the ABCs of making an Angular 6 application.

Nrwl Extensions for Angular have an Nx prefix and Nx Workspaces is a way to share apps and libraries so that n number of apps could use n number of repositories. This gets around pushing stuff out to a third party repository so that multiple applications may have at it. The Angular CLI has monorepo support for the Nx stuff and by mono-repo I mean it keeps many things in one giant God repository as opposed to doing it the multi-repo/many-repo way. Pluralsight, Lynda, egghead.io, and angular.io were recommended for training materials. I recommend Maximilian Schwarzmüller's Udemy trainings myself. nvm (Node Version Manager) allows for different versions of Node if you have been working in version 7 but now need the current version. The Angular CLI requires version 8 of Node. As a CLI command ng --help tells you all of the commands you may run utilizing the CLI and ng new cat --routing --style=scss is a good example of a command to set up a new project. Here will we will be making a project named cat, looping in the routing which would otherwise be absent, and using Sass instead of LESS for making the CSS. You may use Jest instead of the default karma-jasmine if you'd like for testing. That would be another configuration beyond what is given here. One of the differences between the 6 stuff and what came before is the imports of NgRx. Before one would import Observable by importing from rxjs/Observable and now it comes from rxjs all alone. The reason stuff like this was not done before is because we did not want to drag into scope the whole of the rxjs library as it was too fat. In modern times, it is alright to pull in the whole of the fat library because the treeshaking has gotten so good. The treeshaking will shake out all of the unused portions of the rxjs library. The angular-cli.json file which showed up in version 5 of Angular is now an angular.json file in version 6 and there are all sorts of configurations you may do inside of this file. There is a build section under the architect section for... yes, build configuration. There are test and linting options too. You may now blacklist certain imports as a part of the tslint.json linting. There is a way to ngUpgrade angular-cli.json to angular.json. Make a dog folder with a DogModule in the dog folder with ng generate module dog and, following up on that, ng g component dog/dog-list makes a DogListComponent in the dog folder and wires the DogListComponent up to be tied into the DogModule component. The six main concepts in Angular are Bootstrapping, Modules, Data Binding/Events, Providers, Components, and Directives/Pipes. Modules keep track of Components and Providers in short. Bootstrapping could be considered all of the wire up upstream of the outermost module that makes an index.html page into a SPA application. Josh had this example of loadChildren in a module route:

const routes: Routes = [
   { path: '', redirectTo: 'list', pathMatch: 'full' },
   { path: 'list', loadChildren: './cat-list/cat-list.module#CatListModule' },
   { path: 'cat/:name', loadChildren: './cat-view/cat-view.module#CatViewModule' }
];

 
 

Above is an example of lazy loading modules from another module. A more cut and dry example of routing might be:

const routes: Routes = [
   { path: '', component: 'CatListComponent' }
];

 
 

The providedIn trick mentioned at this talk earlier in the day was brought up again in Josh's talk and he gave an example of an attribute directive too that was like so:

import { Directive, HostBinding } from '@angular/core';
@Directive({
   selector: '[expz]'
})
export class ExpzDirective {
   @HostBinding('style.font-weight') fontWeight = 'bold';
   @HostBinding('style.color') color = '#712C30';
}

 
 

A member of the crowd opined that the markup was quite a bit different than that of JSX a frontend framework for React and another tool that was named dropped was Travis CI a continuous integration tool that is both hosted and distributed that plays nicely with GitHub. The GBYE JOSH message shown in the photo here does not apply to this Josh. Josh Godi clarified that a different Josh in human resources was moving on from Bullhorn which hosted both this event and the employment of the two Joshes. Also it really did say GBYE JOSH in balloons and not GBYC JOSH. The middle spike on the E is kinda bent backwards and you can't see it here in this picture. Goodbye Josh!

Saturday, June 23, 2018

SkyView

I went with a coworker to the Hollywood Casino Amphitheatre, an outdoor venue in Maryland Heights (St. Louis' little India), tonight and we saw some washed up eighties hair bands (specifically REO Speedwagon and Chicago) play. A woman out there was showing me the SkyView app on her phone. I assumed the one bright "star" in the sky by the moon was the planet Mars, but it was in fact Jupiter. The woman with the app used her smartphone to find the moon and from there her phone was able to tell her what the other things in the sky were around our locale. It outlined some consolations that we could have also seen if we were living in the nineteenth century without all the modern gunk in the night sky. Cool stuff. The REO part of REO Speedwagon stands for Ransom Eli Olds, an automotive industry trailblazer of yore.

I saw Chris Hardin speak on Dependency Injection in Angular 6 midday Wednesday at the St. Louis Angular Lunch.

Angular dependencies are listed in a declarative (solve a problem at a high level without specific instructions) manner in that they may be in one for three places in the "Injector Tree" and this fuzziness can lead to some behavior a noob would find unpredictable. The three:

  1. First, at the root of the tree is the root injector for the whole of the application. Injectors here are singletons and they get looped in at the outermost module. Once a service (anything injected, the items at the providers metadata property) is setup here its lifecycle will be the whole of the lifecycle of the application. The "root" way of doing things is the default way of doing things and the recommended way of doing things.
  2. Next, at the component level one may similarly have a service (at the providers metadata property) and these are available to that component and child components and have lifecycles tied to the component where they are looped in. Chris gave a rich text editor with a bunch of controls written in a parent-with-a-tree-of-children manner as a good use case for these. If the WYSIWYG editor needed to appear upon clicking in a textarea and then go away again to be refreshed anew when a different textarea is edited, then the lifecycle behavior herein is appropriate to that circumstance. Most of Chris' other experience with dependency injection is of the Java Spring framework and she said that the component level injection felt like what would be a prototype bean in that alternative universe. Alright, the important thing to know here is that when a component service has a conflict with seemingly the same service in a module that the component service wins. This is not the challenging, tricky part.
  3. Finally, services created at lazy loaded modules can "shadow" those created at root and allow you to accidentally get multiple instances of things and here is where the bad creeps in. Augury can even misreport the services from lazy loaded modules as if they are of root.

There is a new providedIn property in Angular 6 for injectors that may be used like this:

@Injectable({ providedIn: 'root' })

 
 

...and like this:

@Injectable({ providedIn: HeroModule })

 
 

...and that both complicates things and makes them simpler. The 'root' trick, when used with the lazy loading approach, will allow the service to be in the root code (the compiled code) at the dist folder, surviving treeshaking, but nonetheless not instantiated in scope until the lazy loading occurs. That gets rid of the dupes problem. The providedIn thing at the component level can yet stamp over the providedIn stuff of the dupes problem solving as just mentioned. Alright, it is now possible to have a circular reference in which HeroComponent is looped in at HeroModule which provides HeroService which "provides in" (forgive my hamminess) HeroComponent and to get around this you need to inject a middleman as a buffer so that HeroComponent is looped in at HeroModule which provides both MiddlemanService which sucks in HeroService which provides in HeroComponent and furthermore also HeroService which, of course, provides in HeroComponent. I think this is the fix. I haven't tried it firsthand and I was kind of distracted in scribbling other notes when Chris was talking. I am making some assumptions also in Googling against this stuff and finding this. Of course there is an old joke about the word assume. You may use this new syntax with injection tokens which I also haven't really gotten my head around. This seems to have some details. One has to have a class and not an interface for an injecton token and so if you need an "interface" you basically must use an abstract class instead in TypeScript and use the implements keyword instead of the extends keyword to get a class to implement the abstract class. I type this here not yet knowing what I'm talking about as I haven't worked with the injection tokens. Furthermore along the lines of things I don't really get yet, in routing concerns, root() is a way to pass configuration data to a module and forChild() restricts scope for lazy loading but otherwise is the same sort of thing. Chris Hardin, pictured sitting, works at Oasis Digital which does Angular training and this event sort of showed off their teaching tech chops. The last time I attended this group the venue was Oasis Digital itself, but this time it was a bit different. Oasis Digital is in one of a set of three office buildings and this Wednesday's locale was in a conference room in one of the other buildings that I suspect has a communal bowl grab-time-when-you-can thing going on. It's by the Gallagher Bassett office space. The two times now that I've been to this meetup a Kyle Cordes has been the moderator. Kyle is pictured in the Tommy Bahama Hawaiian shirt. I know it's Tommy Bahama because I bought that exact same shirt online myself. The pattern is dubbed "San Juan Fronds" and... anyways...

Friday, June 22, 2018

See what is in state when debugging in Visual Studio Code 1.17.1.

Press Ctrl and backtick together to get the pane with the PROBLEMS, OUTPUT, DEBUG CONSOLE, and TERMINAL tags. At DEBUG CONSOLE call functions, etc. Assuming this code:

var doubleUp = (doubleMe) => {
   return doubleMe + doubleMe;
};
debugger;

 
 

If you were stopped at the debugger line, you could type this in at the prompt at the far base of the DEBUG CONSOLE tab:

doubleUp(12)

 
 

...and get:

24

assignee IS EMPTY in JQL

Use "assignee IS EMPTY" to find unassigned Jira tickets in searches like this.

Terran Cleaner 5

I'm trying to remember what you did with this. I think with Terran Cleaner 5 you could take an uncompressed .avi and compress it without making it nasty and pixelated. AVI stood for Audio Video Interleave.

Thursday, June 21, 2018

canned air/compressed air dusters

Maybe this is good for cleaning all of the dead skin off of your keyboard. I wouldn't know. My personal laptop has grown to be pretty gross.

Did you know that if you create a trailing variable led by the spread operator in TypeScript object destructuring that everything you didn't pull out in the other variables ends up in the new, watered-down variable?

Consider:

var hogwash = {
   foo: 13,
   bar: 42,
   baz: 69,
   qux: 86
};
const { bar, baz, ...malarkey } = hogwash;
console.log(bar);
console.log(baz);
console.log(malarkey);

 
 

The following will be logged:

  • 42
  • 69
  • {
       foo: 13,
       qux: 86
    }

$implicit in Angular!

At an Angular 4 application if the context for a variable has an $implicit at it's root at the TypeScript side of a component, this may be used as a default setting for a token let- variable at a template tag in a component's template. So, for example, something like so:

this.cat = { isCalico: false, numberOfLives: 9 };

 
 

...in the TypeScript for a component may be used at the component's template like so:

<ng-container *ngTemplateOutlet="kittyTemplate;context: cat"></ng-container>

 
 

Now imagine that kittyTemplate looks like so:

<ng-template #kittyTemplate let-feline>
   <h1>Felis catus</h1>
   <div>
      Calico? {{ feline.isCalico ? 'Yes' : 'No' }}
   </div>
   <div>
      Mana: {{ feline.numberOfLives }}
   </div>
</ng-template>

 
 

Alright, what is above is legit and will work. This suggests that you may think of this trick, the $implicit trick, like so:

<ng-template #kittyTemplate let-feline="$implicit">
   <h1>Felis catus</h1>
   <div>
      Calico? {{ feline.isCalico ? 'Yes' : 'No' }}
   </div>
   <div>
      Mana: {{ feline.numberOfLives }}
   </div>
</ng-template>

Check to see if something is an array in JavaScript!

Per this, this will be true or false:

Array.isArray(fruits)

Nodemon

This is a tool for detecting when some part of your node app changes to automatically restart Express so that you do not have to do so manually. Nodemon monitors as its name suggests.

Wednesday, June 20, 2018

console.log and console.dir showing partial representations of JSON hierarchies while just giving "Object" for deeply nested things

console.log might give you a string representation of an object but console.dir should show the whole tree right? Neither should work in a swallow let's-skim-the-surface way right? Alright this suggests this is specifically a trapping of logging things to the node console and has this fix:

const util = require('util');
console.log(util.inspect(myObject, {showHidden: false, depth: null}));

Remember when you were a child and you'd goof off with a calculator and multiply two really big numbers together and get that display with an E in it?

Well that is what is known as scientific notation a subset of floating-point numbers (E for exponent) and the existence of these means that you may type a lowercase e or an uppercase E into an HTML element like this...

<input id="foo" type="number">

 
 

...and that kinda sucks.

Thingamahoochie Software's WinMerge allows you to sort a comparison of two folder structures by "Comparison result" and the items which have a "Text files are different" setting are the actual changes.

Other files which can appear in the list include those that will have "Text files are identical" and "Binary files are identical" at this column and also files that only exist in one spot but not the other. Also note that you may right-click on the name of file in the list and pick "Compare" to see what has changed in the "Text files are different" items. What is more, Copy Pathnames and Copy Filenames should be options one sees when one right-clicks amid a selection.

tech writing

This is the art of documentation and instructional design for tech tools and processes. I am not a tech writer. My blog is pretty silly. Real tech writing is professional and to-the-point in a dry free-of-flavor Mr. Spock manner. Honestly Mr. Spock is too flavorful as he can raise an eyebrow or be dismissive. It's even more dry than that. Maybe if Valdimir Putin played Spock instead of Leonard Nimoy...

Tuesday, June 19, 2018

Bracket notation requires some sort of object reference to the left of the left bracket.

(or the leftmost bracket if you are dot dot doting out to something with bracket notation without any dots as its bracket notation, duh) There is no way in JavaScript to get this to fly:

var theGr8 = "enemy of the good";
alert(["theGr" + (4 + 4)]);

 
 

Instead, we have to do something like so:

var pitfalls = {
   theGr8 = "enemy of the good";
};
alert(pitfalls["theGr" + (4 + 4)]);

 
 

Some things cannot be had at through calculated magic strings.

IBM Tivoli Identity Manager

Acronyms include TIM, ITIM, and ISIM where the S is for Security instead of Tivoli, a company in Austin that IBM bought up. This tool manages user accounts and the like.

business requirements document

The BRD can be the documentation for BDUF (big design up front) in a waterfall project.

Monday, June 18, 2018

PlatformNotSupportedException

It's C#! This suggests: "This exception signals an attempt to access a class or member that is not available on the current platform. For example, many properties from System.Diagnostics.Process are not available on Windows 95, 98, or ME."

How do I dot dot dot into things with bracket notation in JavaScript?

You can drill deep into a JSON object like so:

switch(game.board["row" + (xCounter - 1)]["spot" + yCounter]) {

 
 

It's syntactically a bit like having at a multidimensional array in C#.

Ctrl-Tab will actually change tabs in Notepad++

Tab alone will indent of course and Shift-Tab takes the indentation away from a selection again.

NMock3

Like Moq, Rhino Mocks, and NSubstitute, NMock3 is a mocking framework for the C# space. I learned of it this morning because it was name dropped by "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis.

Sunday, June 17, 2018

Django

django.js is something like RequireJS. This is some way to reference a file full of JavaScript from another file full of JavaScript. Django not JS is some sort of Python framework.

Chuck Norris Framework

This is continuous integration build and deployment stuff.

How do I zoom out at Apple Maps at my iPhone?

You have to sort of pinch the screen like so:

To zoom back in, do a reverse pinch where you sort of move two fingers away from each other in opposite directions.

preprocessor directives in C#

"ASP.NET Core 2 and Angular 5" by Valerio De Sanctis suggests that regions in C# are "pre-processor directives" and I found this list of preprocessor directives which backs that up. They all lead with number symbols/hashtags/pound signs. As best as I can tell from the link I provided, a compiler might have a second, you-go-first compiler that preprocesses the preprocessor directives in another language to make them something that the compiler can understand, but in C# there is really just one trip though one compiler and the preprocessing is faked a little bit. Perhaps the preprocessor variables just get looked at first before the rest of the code. I don't know.

Saturday, June 16, 2018

Microsoft's Project Rome

It's cloud-based infrastructure. It allows for apps to bridge numerous devices.

I migrated an Angular 4 application to an Angular 6 application today.

I used the Angular CLI to install a new app and then I copied the package.json and package-lock.json files over their counterparts in the old app. Finally, I destroyed my old node_modules folder and copied over the node_modules folder from the new app I made. When I tried to run the application, I hit a few errors. What follows is what they were and how I got around them:

  1. Local workspace file ('angular.json') could not be found.
    Alright this is a new file. It sits side by side with package.json and I had to copy it next to package.json.
     
  2. ...rxjs/Observable"' has no exported member 'Obervable'.
    This really sucks. To fix this, you have to go through your codebase and replace this...
    import { Observable } from 'rxjs/Observable';
    ...with this...
    import { Observable } from 'rxjs';
     
  3. import { InMemoryWebApiModule } from 'angular-in-memory-web-api'; was an import in my outermost module which got the squiggly red line under it in Visual Studio Code like InMemoryWebApiModule could not be found. I just deleted this line of code. InMemoryWebApiModule was not used anywhere. It must have been some version 4 scaffolding stuff.
     
  4. Can't resolve 'rxjs/add/observable/of'
    There is no good way around this. There is a hack to make some old code behave in an Angular 6 application though. Run this Angular CLI command:
    npm install rxjs@6 rxjs-compat@6 --save
     
  5. You seem to not be depending on '@angular/core'. This is an error.
    Huh?
    Alright, I beat this stupid error by running this Angular CLI command:
    npm install
     

Addendum 6/17/2018: I think, strictly speaking, this last command is just an npm command and not an Angular CLI command. An Angular CLI command would probably have ng in it as its lead in instead of npm.

 
 

Addendum 1/22/2020: There is a typo above. Obervable has no s in it. Lame.

If you do things the RESTful way in MVC you may still need an attribute at your action.

"ASP.NET Core 2 and Angular 5" by Valerio De Sanctis will have you making a controller that starts out like this if you follow along and build out the code suggested in the lessons.

[Route("api/[controller]")]
public class QuizController : Controller
{

 
 

Two of the actions inside start out like this:

  • [HttpGet("{id}")]
    public IActionResult Get(int id)
    {
     
  • [HttpGet("Latest/{num}")]
    public IActionResult Latest(int num = 10)
    {
     

See the difference? The first is like a traditional REST endpoint and the second is what the book dubs attribute-based routing even though both actions utilize attributes.

Friday, June 15, 2018

DoorDash is an app for having food delivered to you.

Drizly is an app for having alcohol delivered to you. (only in St. Louis)

Rust

...is another programming language, kinda like C++ and Wikipedia lists Alef, C#, C++, Cyclone, Erlang, Haskell, Haxe, Hermes, Limbo, Newsqueak, NIL (New Implementation of Lisp), OCaml, Ruby, Scheme, Standard ML, and Swift as influences.

ViewEncapsulation.Emulated scoping and what it means for your CSS

It means you can probably style tags like div and span standalone more often in lieu of slapping a class on the token div and the token span in a component. This should reduce a lot of the orphaned code that tends to build up in stylesheets due to abandoned classes never removed upon a sweeping change. Basically, ask yourself if you really need a class as if there is no longer one God stylesheet there may be many opportunities to avoid using a class that did not exist in prior frameworks. If you need to you can break tags up by semantics. The article tag and the section tag are functionally the same as the div tag, but could have different styles. When approaching semantics, avoid tags which are too specific such as the b tag in favor of similar tags with a bit more general meaning like the strong tag. ViewEncapsulation.Emulated is of course the default ViewEncapsulation in an Angular 4 application and it allows for all styles for the component to be scoped to that component. Basically the compiler crawls that app and renames the classes in both the stylesheet and the markup to append a lead-in in the name that is component specific.

Kotlin

...is a programming language like Groovy insofar that it runs on the Java Virtual Machine. However, it is statically typed not strongly typed and thus there is not compiler safety.

XML format for documenting what a method or class does in C#

This has this example:

/// <summary>
///  This class performs an important function.
/// </summary>
public class MyClass{}

 
 

I've seen stuff like this before. When I was at FramesDirect, Anshu Jain had a name for these. It was something like dioxide comments. I can't remember. Sandcastle is a tool for making this stuff. This has a list of the suggested tags. I guess the reason for XML is to allow the comments to be easily crawlable by another tool.

Thursday, June 14, 2018

[NotNull]

This has the following example of a NotNull attribute which is also mentioned in "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis.

public static IApplicationBuilder UseMvc([NotNull] this IApplicationBuilder app,
      [NotNull] Action<IRouteBuilder> configureRoutes) {

 
 

The Stack Overflow link I provide also mentions that this is Microsoft's MVC 6 source code and not some random C# that someone wrote. [NotNull] is really not something for you to use yourself in C#. These are really just annotations provided to make ReSharper understand what is going on better in being helpful and not for example a compiler-level safeguard against handing in a null value. This has some more on how you might loop in a JetBrains library to use these, but keep it mind that this is something esoteric (wacky) and not a pillar of C# that you'll get asked about in an interview.

Time Warner in a merger?

Yes, it will merge with (get bought out by) AT&T (owner of Southwestern Bell Telephone Company, SBC Telecom, etc.) but this is not the Time Warner Cable which used to be Road Runner and became Spectrum, instead it is the company that owns HBO (Home Box Office). This should allow AT&T to use HBO Now as its streaming service and compete in the Netflix space. HBO Now is basically the same thing as HBO Go save that Go is a feature of having HBO as part of cable TV and Now is a standalone service you may get without having a television. I guess this is looking forward to a future. You don't want to be HP keeping itself alive on ink cartridge sales for printers. Keep up your game.

Make a string of underscores in Microsoft Word and then press Enter.

It makes a horizontal line/divide that is page wide.

Wednesday, June 13, 2018

npm install --save @angular/material @angular/cdk

Per this this is the Angular CLI command to drag Angular Materials into an Angular 6 application.

Amazon Fire HD 8 is a tablet from Amazon kinda like the iPad.

It is a lot cheaper though. I assume the HD part stands for high-definition as in it has a high-definition display on its eight inch screen. Monitors are typically measured diagonally so I assume the eight inch display is eight inches across from corner to corner diagonally. 8 would be the c in a2 + b2 = c2 (Pythagorean Theorem)

I was restlessly looking at some of the topics in Austin area meetups today now that I no longer live in Austin.

Spectre is a "meltdown" vulnerability at the Intel processors that leaves a cache of immediate data in memory available and exposed to an exploiting process that knows how to get at it such as a JavaScript script that runs at a sinister web site. Branch misprediction in which the mircoprocessor is tricked into making some bad assumption at a fork-in-the-road decision point is cornerstone to all this though I don't really understand it. If you type in your password and it gets encrypted, at some point it had to be plain-text right? I think you get yourself off the immediate thread where you typed in your password that you'll be alright. Go-kit is a mircoservices approach for the Go scripting language. The buffalo framework is some rapid-development framework for Go for the web and Pop is the canned database part of it. RPC stands for remote procedure call and gRPC (note: recursive acronym for gRPC Remote Procedure Calls) may be used with a Postgres database to call into/out to a database elsewhere.

Your system is running low on resources. You cannot log on as a new user. Please use an account that has already been logged on.

This Windows 7 message rears its head when Windows 7 blocks you from logging in when your PC hasn't been shut down properly. I set the stage for this at day's end yesterday by just closing my laptop without powering it down and then in the morning I was having some trouble when I attempted to log in. Of course this error has nothing to do with the account you are using being newish. That is all misleading. To get around this stupidity, just manually power down and then manually power back up again. It was connected to the dock when I restarted and that may have helped. I don't know if being disconnected from the docking station could be a factor but it seems like it could be as the complaint being vocalized more or less has to do with battery life.

NgZone

Once when I was last at Dell and I was taking a break from blogging, there was a random training on the zones associated with NgZone which I then never worked with. I scribbled all my notes down in a little notebook that I ended up throwing away and now I cannot remember what was discussed. This makes it look like a way to sandbox processes so that we do not kick off other watchers and update components and cause a performance problem. I wonder if this would even be needed if you have the OnPush ChangeDetectionStrategy afloat in prevalence. If you are using the Default ChangeDetectionStrategy and you normally don't have a problem in having the usual watchers running, but you also want to set up your own loop on a timer to manage some corny cartoon clock in the corner of the screen of something like that well I can see why you might not want that overhead adding to the rest of the overhead of the watchers by triggering change detection. The link I provide has this example;

this._ngZone.runOutsideAngular(() => {
   this._increaseProgress(() => {
      
// reenter the Angular zone and display done
      this._ngZone.run(() => { console.log('Outside Done!'); });
   });
});

 
 

This code sits in a component and _ngZone is a variable declared at the constructor (as so many variables of Angular magic are) of type NgZone. _increaseProgress is a method that you might run in the sandbox, get it?

convention-based routing versus attribute-based routing in MVC

Some of the history is touched on on page 91 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis. Convention-based routing is the old approach in which a few global rules are specified in Global.asax and maybe there is a distinction between the regular controllers and the API controllers insofar as the API controller have "api" as the first hunk of the route. Attribute-based routing will have you decorating actions (methods inside a controller) with attributes to define their routes and is new as of MVC5. MVC6 which is ASP.NET Core MVC and a complete rewrite of MVC has it too.

Tuesday, June 12, 2018

Corel Photo-Paint was to Adobe Photoshop what Corel Draw was to Adobe Illustrator.

Corel Painter was another raster graphics app that allowed one to add effects to an image that were flavored in a traditional painting with a paint brush style.

DX versus UX

The public-facing friendliness and grace of an API that a developer must use is sort of like the UX for the API, huh? UX isn't the appropriate term here obviously because it is still not the end user using the API. Instead another scientist, not Frankenstein himself, Igor maybe, is kicking the tires on Frankenstein's monster, and hence "the developer experience" is the buzz term to use for this circumstance.

Beginner's All-Purpose Symbolic Instruction Code is what BASIC stood for.

Remember this old 1980s stuff?

Azure Publishing Profile

A coworker was telling me today that it is pretty easy to push stuff up to a repository from Visual Studio with an Azure publishing profile. When you get Azure hosting you may just be given a file for making a connection in this manner.

CompTIA Security+ certification

If you have this cert I suppose that you know cybersecurity. CompTIA is short for Computing Technology Industry Association and the organization is a non-profit that does certs.

TS Hero: Add an import to current file

One trick you may do with TypeScript Hero in Visual Studio Code 1.17.2 is that you may, from within a .ts file, press F1 and then start typing "TS Hero: Add an import to current file" to find an option for that name. It looks like Ctrl-Shift-I more directly is the hotkey for this. Once you trigger this effect you will be given a second place to type where you may find the thing you want by starting to type out the first of its letters and this will ultimately add an import statement.

Helicontech Isapi Rewrite and the Url Rewrite feature of IIS 7 and up

...are examples of how to do creative MVCesque routing in web forms name dropped by "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis on page 90. By the way, this book is full of little typos and mistakes. It suggests Helicontech Isapi Rewrite was called Helicontech's SAPI Rewrite. There is considerable prose upfront in the book about all of the testing that went into the book's code, but there are things right and left in the book itself that are just goofy. I am learning a lot but I cannot really recommend the book given how sloppy it is. ISAPI stands for Internet Server Application Programming Interface and is an API of IIS (Internet Information Services).

Monday, June 11, 2018

Resource Oriented Architecture as opposed to Service Orient Architecture is sort of the same thing but has more to do with internal thrashings than reaching beyond one's LAN off to web services.

Maybe a complicated in-house ETL process for a nightly job some with SOAesque safeguards would qualify as ROA.

NgRx is made with RxJS

...but the names are not synonymous. RxJS is the Observables stuff, and NgRx is described as "Reactive Extensions for Angular" and it has that Reduxesque store and a funny database implemenation too. This lists all of the NgRx parts. I guess I cannot promise that all of the things you can do with NgRx also use RxJS but there is a heavy, heavy influence.

Universal Description, Discovery, and Integration (UDDI).

This is a SOAP standard for making APIs discoverable. Think of the WSDL thing.

Sunday, June 10, 2018

I sense something sinister.

This details these acronyms that Microsoft has cooked up for guessing how evil an email might be.

  1. SCL is spam confidence level
  2. PCL is phishing confidence level
  3. BCL is bulk complaint level

The first two metrics speak for themselves. The BCL however is a finger-to-the-wind divination of how likely there is to be a problem given... "history"

.NET Standard

...is some attempt to have some standard APIs and way of doing things across .NET Core, .NET Framework, Mono (open-source .NET for old would-be great smartphone stuff that I have not heard of since I worked at Headspring), and Xamarin. This has a list of what is covered and for some reason Silverlight was abandoned along the way. Imagine that.

battery throttling

Lately when I see movies there is an ad beforehand for abandoning the iPhone for a Samsung Android device. A frustrated woman takes her iPhone 6 to an Apple store and when asking for the phone to be fixed she is told "You could turn off the performance management feature, but it may lead to unexpected shutdowns." to which she replies "battery throttling" and I know exactly what she means. I would have kept my iPhone 4S forever if it had not grown sickly over time. Towards the end I was carrying a portable battery to try to keep it alive.

Saturday, June 9, 2018

CSV stands for Comma-separated values

You may export a .csv file from Microsoft Excel. It has less noise in it when you open it up in Notepad than the .xls and .xlsx files of Excel.

Module build failed: Error: Debug Failure. Unexpected node. Node PrefixUnaryExpression was unexpected.

I was getting this error in an Angular 4 application in attempting to compile. A one operand operation is unary in nature, and in this particular case the problem was:

@Input() transactionId: string | -1;

 
 

I fixed the problem by revamping the line of code to look like this:

@Input() transactionId: string | number;

original definition for bandwidth?

Telecommunications. the smallest range of frequencies constituting a band within which a particular signal can be transmitted without distortion.

...yet this specific meaning slid into a grey area to mean: Do you have enough on your plate to do? Do you need more? Can you take on more? Are you choking?

Alphabet, Inc. is the parent company of Google.

It was invented in a restructuring.

Thursday, June 7, 2018

penne

Alright, today makes seven years of this blog. Blogger.com reports I that got 11,432 views in the month of May of 2018 and that means at least a few of you are paying attention. Thank you. I'll take it. I can be childish and I can be a jerk and all that will all come out here. Things will continue to be refreshingly unprofessional. If you hate me and you want to see me get my ass kicked I assure you that I am getting my ass kicked... I work in tech. The basil pesto penne at Vito's Sicilian Pizzeria & Ristorante at 3515 Lindell Blvd, St. Louis, MO 63103 was my treat to myself for today's milestone. Per the suggestion of my waitress, I got it spicy and it was dandy. This was my first time at this restaurant. The portions could have been bigger. A salad could (should) have been included with the meal. Meh.

Look at the routing events in an Angular 4 application.

ngOnInit() {
   this.whereAreWeReally = this.activatedRoute.snapshot.url[0] ?
         this.activatedRoute.snapshot.url[0].path : '' ;
   this.router.events.subscribe((event:any) => {
      if(event.toString().split("(")[0] === 'NavigationCancel'){
         this.isNavigationCanceled = true;
      }
      if(event.url) {
         const routePieces = event.url.split("/");
         this.whereAreWeMaybe = routePieces[routePieces.length - 1];
      }
      if(event.route) {
         this.whereAreWeMaybe = event.route.path;
      }
   });
}

 
 

Routing events may vary. NavigationStart, RoutesRecognized, GuardsCheckStart, GuardsCheckEnd, ResolveStart, ResolveEnd, and NavigationEnd should come in said order and if NavigationCancel appears the last three of these will not appear.

TDD pairing

This says: In ping-pong pairing the driver writes a test for a behavior then asks the navigator to implement the behavior and make the test pass.

Tom's Guide has information on phones/games/devices

Something new I learned today is that if you call #3282 from a Verizon cellphone account that you will get a text message telling you how many gigabytes of data you have left and what percentage that is of your total monthly allowance. Tom's Guide had this bit of knowledge.

Wednesday, June 6, 2018

I can't suck in a JSON object in an independent .json file with a typical import in TypeScript.

That's correct! The way around that is to write a function like this at the top of the TypeScript file where you will need to get at the JSON object...

declare function require(moduleName: string): any;

 
 

...and then have at the JSON object's guts like so...

let cicada = require('../../cricket.json').katydid;

 
 

...this seemed like another example of TypeScript not being a superset of JavaScript to me. I didn't see why the second line of code wouldn't work standalone and apparently it will work in mere JavaScript. It was explained to me that the reason that TypeScript can't understand require to compile it is that is it implemented at most modern browsers through their own prototype provided bolt-ons and it is not technically standard JavaScript. Boo hoo! Above we are fishing the katydid property out of the JSON object and assigning it to the cicada variable.

progress tag in HTML

W3Schools has this example of a progress bar which is twenty-two percent complete.

<progress value="22" max="100"></progress>

 
 

This thing looks wildly different between Edge and Chrome in an unstyled state with differing default widths and heights. The Chrome version has markers at every ten percent point along the way.

hidden .git folder

When you get this error...

Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue.

 
 

...and it seems like you cannot see the folder that index.lock is in to destroy the index.lock file well maybe Windows is hiding it from you. Try navigating to the folder holding the root of your project in an Explorer window and then appending \.git to the path.

DHCP is Dynamic Host Configuration Protocol

It's a management protocol used on UDP/IP networks. UDP is User Datagram Protocol, part of IP (Internet Protocol). UDP provides port numbers. IP is the ip address stuff. DHCP gets into the dynamic allocation of IP addresses at a LAN.

JavaScript is a functional programming language.

There are not classes. It's just yay-let's-do-stuff functions. This is the only example of functional programming I really have any experience with.

Tuesday, June 5, 2018

Slap labels on Jira tickets so that you may then search against the labels and generate a list of tickets that have the labels.

At a particular ticket, the "Labels" setting under "Details" at the top of the ticket will allow you to type in a magic string for a label. Let's say our label is "YakShaving" and we want to add it to five tickets. Well, we just type in the string on the first ticket and then we will be able to use that string to find the label on subsequent tickets. At the left where it says Backlog, Active sprints, Releases, Reports, Issues, Components go to Issues then click "View all issues and filters" at the upper right and finally "Advanced" at the upper right to use JQL like so to make a list of the tickets with the labels:

labels = YakShaving

Appium

A mobile space testing framework, Appium plays nicely with both native and hybrid mobile apps.

Microsoft buys GitHub!

Some people have trust issues with Mircosoft, so this is some drama yo.

Monday, June 4, 2018

iOS 12 will let you make a custom emoji of yourself for yourself.

Group FaceTime will allow for conference calling so to speak. I love modernity and all of its stupidity.

Sunday, June 3, 2018

C++ 11 introduced smart pointers which have automatic garbage collection.

Yulia Danilova mentioned this to me.

QC is quality control

In contrast to QA (quality assurance) this is product-oriented and about taking the bad parts off the assembly line instead of finding bugs in code.

Call one action returning JSON from another at a .NET Core MVC controller!

"ASP.NET Core 2 and Angular 5" by Valerio De Sanctis calls the "Latest" method (action) at the bottom of this like so from an action in the same controller!

[HttpGet("Random/{num}")]
public IActionResult Random(int num = 10)
{
   var sampleQuizzes = ((JsonResult)Latest(num)).Value as List<QuizViewModel>;
   return new JsonResult(sampleQuizzes.OrderBy(t => Guid.NewGuid()), new
         JsonSerializerSettings()
   {
      Formatting = Formatting.Indented
   });
}

 
 

Things to note:

  1. JsonResult of Microsoft.AspNet.Core.Mvc.JsonResult is used to cast off what it is gleamed from the other action, then a .Value is done off of that, and finally there is a second casting utilizing the "as" keyword.
  2. The return statement has a cool hack for randomizing things in a collection, huh?
  3. This example and the one here use optional parameters, but I do not think these parameters are really optional. I cannot get the routing to work if I just leave off the trailing number when I experiment at the URL line in Microsoft Edge.

Saturday, June 2, 2018

Make a new "API controller" in .NET Core 2.

Right-click on the Controllers folder and pick Add > New Item... ...and pick Web API Controller Class from the ASP.NET Core options or the Web options within the ASP.NET Core options or the ASP.NET options within the Web options within the ASP.NET Core options to make something like so:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
 
// For more information on enabling Web API for empty projects, visit
      https://go.microsoft.com/fwlink/?LinkID=397860

 
namespace Pasta.Controllers
{
   [Route("api/[controller]")]
   public class SpaghettiController : Controller
   {
      
// GET: api/values
      [HttpGet]
      public IEnumerable<string> Get()
      {
         return new string[] { "value1", "value2" };
      }
      
      
// GET api/values/5
      [HttpGet("{id}")]
      public string Get(int id)
      {
         return "value";
      }
      
      
// POST api/values
      [HttpPost]
      public void Post([FromBody]string value)
      {
      }
      
      
// PUT api/values/5
      [HttpPut("{id}")]
      public void Put(int id, [FromBody]string value)
      {
      }
      
      
// DELETE api/values/5
      [HttpDelete("{id}")]
      public void Delete(int id)
      {
      }
   }
}

 
 

Note that our class is inheriting from Controller and not ApiController. There are no ApiControllers anymore in modern MVC like there were in MVC 4 and MVC 5. Instead there is just Controller to inherit from and whether or not it, our child of Controller, serves up JSON or a view depends on what we put inside. Pages 78 and 79 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis have us making such a controller, but the controller has one method which starts out like this:

[HttpGet("Latest/{num}")]
public IActionResult Latest(int num = 10)
{

 
 

...and ends like so:

return new JsonResult(
   sampleQuizzes,
   new JsonSerializerSettings()
   {
      Formatting = Formatting.Indented
   }
);

 
 

sampleQuizzes is a collection to be returned and the second argument denotes how to serialize the collection. The using Newtonsoft.Json; using declaration loops in the ability to serialize JSON in this manner.

Friday, June 1, 2018

some notes on working with remote branches via git command line commands

I haven't tested any of this yet, but I think this pulls from the remote repository to a local handle named yournamehere.

git remote add yournamehere ssh://github.pasta.com:lasagna/noodle.git

 
 

I think this does the same thing only the name will be "origin" instead of yournamehere.

git clone ssh://github.pasta.com:lasagna/noodle.git

 
 

This will list the local grabs of remote repositories.

git remote –v

 
 

This refreshes yournamehere pulling in changes that have happened out in the world since you took a snapshot.

git fetch yournamehere

 
 

This makes a local branch from a branch at yournamehere.

git checkout -b feta yournamehere/feta

 
 

At your local branch (made from a branch of a remote repository) you can rebase from "master" so to speak with this command, I think.

git pull --rebase

I have a friend who was experimenting with .pipe to catch errors at Observables in an Angular 5 application and that made me curious.

https://stackoverflow.com/questions/48030197/what-is-pipe-function-in-angular-2 touches on it and https://stackoverflow.com/questions/46197223/transforming-observable-with-map more generically touches on mapping. My friend was trying to do a .map inside of the pipe machinery. Some of her code was like:

.pipe(
   tap(d => this.log('foo')),
   catchError(this.handleError('bar', []))
);

 
 

I think the tap attempts to resolve the promise to test if it will resolve or if it will freak out and then the catchError stuff comes in. I should shut up. I don't really know what I am talking about. Maybe you can have a map inside like this:

.pipe(
   .map(x => x[0]),
   tap(d => this.log('foo')),
   catchError(this.handleError('bar', []))
);

 
 

I'm not sure what that does, getting the first thing inside of an Observable (is it its promise?) and then doing nothing with it. I thought the better thing to do might be:

.pipe(
   tap(d => this.log('foo')),
   catchError(this.handleError('bar', []))
).map(x => {
   return { betterThing: x.thing + 1 };
});