Thursday, March 22, 2018

When you lose a menu bar or somehow otherwise change the layout in Visual Studio Code 1.17.2...

  1. Press the Alt key to make the File/Edit/Selection/View/Go/Debug/Tasks/Help menu appear if it is hidden.
  2. Go to: "View"
  3. Change the toggles for "Toggle Full Screen" and "Toggle Zen Mode" and "Toggle Menu Bar" as applicable.

Bewilderment and Bemusement

That must have been what this girl was feeling when I asked to take her picture and I suspect it is what Vladimir Putin and his government are thinking in watching America's free society. They shouldn't smirk. We (Americans) actually have an economy bigger than that of Mexico and it isn't one-dimensionally based on oil and a lot of that is due to the fact that people actually want to live here, but not to rant about how real capitalism is better than the late-to-capitalism stuff... The Russians who "meddled" in our presidential election are probably amused that they could do so exploiting what are really just loopholes in free speech. Pump advertisements onto Facebook to influence people. Target specific segments to make a difference in flipping what was blue to what could be red, etc. But having said all that the Russian meddling really didn't do anything wrong. It is all free speech after all. I guess someone did hack Hillary Clinton's campaign and find out how much she was being paid for speeches and that Donna Brazile of CNN leaked questions for an upcoming debate to Hillary (that ended up on WikiLeaks), but aren't you glad you know those things instead of them being kept a secret? I voted for Hillary in 2016 and I even voted for Hillary over Bernie Sanders in her pregame power struggle with him preferring in both cases boring to crazy, but I sense a minor trend in U.S. presidential elections in which the more interesting candidate ends up beating the less interesting candidate. You have to go all the way back to 1988 when the first president Bush faced off against Michael Dukakis for my model to break. It is hard to say which one of those men was more boring, but I guess I give Dukakis the edge in being more interesting in that at least he had big eyebrows. Anyhow, following the pattern, Donald Trump with a history of saying racist things and a wink at torture went to The White House and a lot of liberals are looking for an explanation. Enter the Russian meddling. For all of the crybaby crying that Hillary has done since she lost I have never heard her point to the social media stuff or the hack that revealed some embarrassing secrets of hers as the reason for her loss. Instead she blames James Comey's handling of her email scandal and it is the talking heads on the left who instead trumpet the Russian meddling stuff. Hillary won't go there herself because she knows there is little to it. I have to believe that the meddling didn't move the needle more than a half of a percentage point in the polls at best, and again a lot of the targeted marketing stuff is just free speech and the stuff leaked from a hack of Hillary is stuff we should have been told anyways. More recently it has been found out that Facebook gave data to an academic agency that then turned around and fed it to the Trump campaign allowing the campaign itself to do some targeting marking. Hey, and what if Trump was colluding with the Russians in the marketing and hacking? How awful? Not really. Again, I don't think the needle moved more than a half of a percentage point, and if I'm wrong, if we as Americans can be so easily manipulated, well then yes there is a reason for outsiders to laugh at our openness. I don't think however the needle moved much. This touches on how hard it is to flip someone's political opinion on social media in spite of how easy it might be to figure out what their opinions are based on their Facebook likes. This makes me smirk at all the ruckus. I guess it's just politics. When Hillary's husband was president his enemies tried to make a big deal out of Monica Lewinsky to destroy him and that was silly too. The girl in the photo is another encounter from the Mardi Gras event mentioned here and here.

Wednesday, March 21, 2018

What does SimpleChanges at ngOnChanges do anyways?

Following up on this, this has the following example of inspecting specifically what changed at ngOnChanges with SimpleChanges:

ngOnChanges(changes: SimpleChanges) {
   for (let propName in changes) {
      let change = changes[propName];
      let curVal = JSON.stringify(change.currentValue);
      let prevVal = JSON.stringify(change.previousValue);

The title tooltip is not showing up at a button when the button is disabled?

Slap this CSS on the button to fix the problem:

pointer-events: auto;

Tuesday, March 20, 2018

git reset --hard HEAD~1

As a Git Bash command, this is going to throw away the most recent commit to your branch. (Using "soft " instead of "hard" will unwind the changes while destroying the commit to your branch. The uncommitted changes will be back at your source code however instead of being reverted.)

a good pattern for barrels

A good pattern for barrel files in an Angular 4 app is to make an index.ts file be an index of what is in the folder it sits in and not an index of what imports the files in the folder have in common. Do not try to use an index at a folder to clean up what is in that particular folder. Instead let it represent the folder when files and different folders call out to things in that folder. When referencing an index file in another folder, you make make an import devoid of the actual index name/word such that...

import * as Whatever from '../../yin/yang/index';


...may be be simplified as...

import * as Whatever from '../../yin/yang';


Addendum 3/21/2018: The as variable should probably be in camel case and not Pascal case and thus be whatever and not Whatever.

Ctrl-K followed by S pressed by itself

...saves all open unsaved files in Visual Studio Code 1.17.2