You convey cute happiness with it. OuO and O_O and similar little faces. Do you see it?
Sunday, September 8, 2019
Saturday, September 7, 2019
When testing a service that does not implement a contract in an Angular app you still replace and fake the service.
In the providers for the test have something like so:
{provide: MyService, useClass: MyFakeService}
MyFakeService in this example can just be an any type object. At the constructor of the component wired up by TestBed the external dependency of the service will be wired up with MyFakeService in spite of any specific type for the service denoted right there at the constructor inline and when methods are called on the service by the test they had better have dance partners at MyFakeService. However, MyFakeService does not need to implement MyService for this trick to work or anything like that. For further reading:
On Wednesday night I attended "The Greensboro Sci-Fi/Fantasy Group" meetup moderated by a Jason Bowles.

Jason Bowles is pictured here, and the event itself was at the cafe inside of a Barnes & Noble Booksellers in Greensboro, North Carolina. This was a freeform discussion about many things and it did get into tech a little bit with a discourse on telephones. Two of the attendees got smartphones for the first time in 2010 and they spoke to the pain of their first smartphones. A girl got a BlackBerry Curve which was the first BlackBerry with a touchscreen and hated it while a guy got a Samsung Intercept which had a little keyboard that slid out and he hated it too. He stuck with Samsung long enough to have a Samsung Epic next and eventually ended up with the Samsung Galaxy S4 Android device (S for Super Smart and 4 for the version). I had not heard of any of these devices save for the Galaxy of course. The same guy suggested that there was a time in the 1980s wherein you could not buy a phone and instead you were just renting a phone from Ma Bell, the Bell Telephone Company. I don't recall this myself, but then, again, I was a child and not someone buying telephones. A different guy said that he knew of a farmhouse in the area that had an old hand crank phone with which one could only call out to an operator and then tell the operator where one wanted to really route a call to. Some books were discussed. Jason is going through the "The Song of the Shattered Sands" series by Bradley Beaulieu, mentioning "The Twelve Kings in Sharakhai" specifically. He said that it was fantasy set in Ancient Persia but as best as I can tell in reading about it online Ancient Persia would just be the inspiration for a fantasy setting in the series. The Samsung phone guy was buying a copy of "Hope Never Dies" by Andrew Shaffer in which Joe Biden and Obama are wrapped up in some sort of murder mystery. The Samsung phone guy was from Joe Biden's Delaware and asserted that Andrew Shaffer had some Delaware credentials as well. Hurricane Dorian loomed ready to give North Carolina a bit of rain and Jason had us try to site examples of hurricanes in literature. The BlackBerry girl had read something in which a hurricane devastated someplace somewhere in the U.S. taking a power grid offline and then, in the aftermath, the Chinese army was everywhere and people thought that they had invaded when really the Chinese army was just helping America rebuild. BlackBerry Girl couldn't recall the name of this work and I can't unearth it in Googling either so it will stay a mystery. "New York 2140" by Kim Stanley Robinson is a book about a permanently flooded by global warming New York City in the year 2140. Jason found the cover art intriguing and dug up a copy of the book from within the bookstore to show to us. I noticed the term peri-apocalyptic on the back cover and, as opposed to the post-apocalyptic Mad Max stuff, the peri implies during the apocalypse. The cover art was pretty "fun" with canals between skyscrapers where roads used to be. I am intrigued by living in the peri-apocalypse. There were some new skyscrapers in that New York depiction too, replacing the twin towers. Hot air balloons dotted the sky.
Balazs Hideghety at Ceremity/UPS didn't want to use the Core First version of Entity Framework with .NET Core.
I always assumed that he didn't know what he was talking about, (He disliked and didn't use interfaces in C# and thought that microservices and domain-driven design were synonymous.) but since then I have run into others echoing the notion that the first rollout of Code First Entity Framework for .NET Core was pretty bad. I can't tell you what was so terrible offhand, but apparently as of .NET Core 2.2 it is solid and shipshape.
I saw Eric Harding present at Triangle F# on Tuesday night.

North Carolina's Tech Triangle is founded around three nearby universities in Raleigh, Durham, and Chapel Hill and really the identity has expanded to a triangle of tech sphere jobs based around those three North Carolina cities. I visited all three on 9/3/2019, catching lunch at a brick and mortar Korean bar that evolved out of some food trucks called Namu in Durham, dinner at a Laotian restaurant called Bida Manda in Raleigh, and a tech event at the Chapel Hill public library on F#. Eric Harding hosted the event, a monthly meetup.com meetup of a group called "Triangle F#" (we just discussed what the triangle part of the name means) and while he kind of projected from his laptop (well, we could see his laptop display on a TV in the room) and spoke some it might be a stretch to say that he was the speaker or that there was a particular topic. Instead, this just seemed to be a free-for-all of thoughts from a handful of F# enthusiasts in the room. A lot of what I experienced builds atop this talk with mentions of Fable-Elmish and MVU. A host of other wacky things came up. Racket is a language based on the Scheme dialect (support for both functional and procedural programming) of Lisp. Eliza is an old chatbot. C came out in 1972 and machine learning (ML) in 1973. In "choose" in the gang of four patterns, you walk a chain of responsibilities trying to see if you match at each link of the chain and continuing if you do not. Blah, blah, blah. In MVU a view function is a pure function which takes in an immutable model and produces a model tree (a view) while an update function takes in your existing message and a model and gives you an updated model. A dispatch takes in an event. Eric showed off fable.io/repl on the TV, which is an online play place for F#. It uses, by default, I think, FiraCode (pronounced a bit like "fear of code") as a font which does wacky things like turn |> into a rightward pointing triangle (there is a triangle again) kind of like the play button of tapeplayer controls and -> into a rightward pointing arrow. So what do these two things do? Foo(Bar(Baz(qux))) in C# could be qux |> Baz |> Bar |> Foo in F# and the rightward pointing arrow is kind of like a lambda operator suggesting use what's at the left of the arrow as a variable name for immediate scope to be used in the machinery at the right of the arrow. Fake is the F# Make/Jake/Rake/Psake build tool. F# embraces immutability by default using immutable types and this means we have structural equality wherein you can just compare two different, independently created objects and still have the objects be equal if all of their properties are the same. That's not how it works with reference types in C# wherein you would be comparing two different pointers in a similar scenario and the two objects could never be equal. In C# you end up comparing perhaps the unique id of a database-driven object, be it integer or GUID, to its counterpart on a sister object to gauge if the sisters are really the same girl. The Fable, F# to JavaScript, porting is the way to go for the UI. The only variations for the UI are: What JavaScript framework do you poop code out to? It doesn't have to be React which is kinda the default. It can be Vue. Eric had not seen an Angular rollout but he didn't see why that would not be possible. In an App.fs file is where you would normally assign what version of JavaScript to spit out with something like .withReactBatched for example. There is no markup in the F# UI. You just have a function to represent a button for example. Here is what was shown off for making an HTML table:

Sencha Ext JS of course famously took this approach too and it wasn't really a good thing. One nice thing I will say about this is that when you think of what Blazor is attempting in the C# space, well, F# is really already there isn't it? If you want to explicitly compile to WebAssembly Bolero kinda leverages Blazor in the F# space. The reason to go there is if you want to loop in extras via NuGet packages as opposed to npm packages (which is what Elmish demands). Fabulous for F# spits out Xamarin XAML instead of JavaScript. OpenGL (Open Graphics Library) and GLSL (GL shading language) are things you may interop with from F#. You make 3D graphics with this stuff. A sequence in F# is like IEnumerable in C#. A discriminated union in F# is kind of like a union in TypeScript allowing for multiple possibilities with a pipe symbol wherein type Msq = | ChangeValue of string | Reverse might be an example. The SAFE stack uses Saturn, Azure, Fable, and Elmish. So what's Saturn? It is an abstraction on top of ASP.NET that allows you to write server-side stuff in a functional F# way that is somewhat akin to Ruby on Rails. It has canned routing for example. If you want to come off the rails, Giraffe is the do-what-you-will alternative. The convention of giving every class its own file in C# does not carry over to F#. Instead many things are often nested in one big file and scope builds top to bottom in a way it does not in C#. If you see a type in use and you wonder what it is you can probably just look upwards in the file to find it. Don Syme and Tomas Petricek are some of the big names in F#. F# tries to balance correctness with performance while F* (pronounced F star) has a heavier emphasis, as a similar programming language, on the correctness. Mozilla is porting F* to C in building their Everest project which attempts to allow builds that are verified as HTTPS-friendly (the S in HTTPS stands for Secure) top to bottom of web gunk. The immutability of F# plays nice with parallelism and allows for gains even as Moore's law breaks down. Also CPUs increasing have more than one die with their cores (actor managing a thread, doing work) not necessarily on the same die (chunk of silicon) and a packet cannot be shared across two dies like it might be across two threads. Herein again, the parallelism of immutability is a nice to have. let! (pronounced: let bang) is like the await keyword in C#. A packet.lock file allows for some of the Yarnesque-version-locking-flavored stuff. Type providers in F# allow for some code generation that lives at database tables. Of the two eateries, it was Namu I went back to again.
the iPhone charger that plugs into the cigarette lighter in the rental car
The day after Labor Day of 2019 I visited the "Asheville Mall" which is, yes, a mall in Asheville, North Carolina. At the Verizon store I bought the "Dashport" car charger by "Ventev" and it's legit. I endorse this product. I had thought I could go on a road trip without this and then I got the unpleasant surprise of finding that my phone was about to die because for some reason it had not charged overnight.
