Monday, September 21, 2020

Setting VS Code to Edit Windows Batch Files

You will need to edit the Windows Registry to make this update so tread lightly.
  1. Launch the Registry Editor (regedit.exe)
  2. Navigate to the following branch: HKEY_CLASSES_ROOT\batfile\shell\edit\command
  3. Double-click the (default) value on the right. By default, VS Code is installed under C:\users\{YourUserName}\AppData\Local\Programs\Microsoft VS Code and the executable file is Code.exe. You will need to find the path to VS Code executable.
  4. Replace the existing data with the complete path of VS Code that you discovered in step 3. In my case it was: "C:\Users\{YourUserName}\AppData\Local\Programs\Microsoft VS Code\Code.exe" "%1"
  5. Note that in step 4 above to include the "%1"
  6. Exit the Registry Editor.

 

Sunday, September 20, 2020

A Fast vs Slow Thinking Example

A few years ago a ran across the book entitled Thinking, Fast and Slow by the 2002 Nobel Memorial Prize in Economic Science winner Daniel Kahneman. 

In short, we have two systems that drive the way we think. System 1 is fast, intuitive, and emotional; System 2 is slower, more deliberative, and more logical. While system 1 may serve us well in many circumstances, we must take the time to examine our fast, initial gut-level thinking and consider that it may be wrong. 

For an example of system 1 taking precedence over system 2, I got an email from an undergrad student concerned that his previous extra credit grades were not calculated correctly in his overall course grade. Here is the initial email:

---start email--- Hi Professor,

I just finished the coding assignments and I noticed that even though I got full points on both assignments the total percentage for my grade went down.  Is this because the extra credit was not a separate assignment/category and was part of the normal assignment weighting?

Thanks,
John Doe ---end email---

While I empathize with the student in that one does not want to see their overall score lowered when they got perfect scores on subsequent assignments, his gut-level response was in error. After considering his question, here is my response:

---start email--- John, This is because of the mathematical relationship between the divisor and quotient in division. Simply put, when the divisor increases and the dividend remains constant (or does not increase at a constant rate with the divisor), the quotient will decrease. Here, the divisor increases by 1 for each score. To remain at the percentage of 106.1111111111111, you would need to score 106.1111111111111 on each assignment. 

Below is the calculation of your course score to date.

   100 - assignment 1a
   100 - assignment 1b
   100 - assignment 2a|
+ 100 - assignment 2b
   116.6666666666667            - extra credit (35/30) assignment 3a
   120                          - extra credit (60/40) assignment 3b
-------------------
   636.6666666666667 / 6 = 106.1111111111111 – Your score before assignment 4 a & b
   100 - assignment 4a
+ 100 - assignment 4b
-------------------
   836.6666666666667 / 8 = 104.5833333333333 – Your score after assignment 4 a & b ---end email---

Now, to be honest, I think my initial reaction to my overall score decreasing would be the same. However, after actually calculating the score, system 2 wins again.


Saturday, September 12, 2020

Loving VS Code (as much as Notepad++)

OK, I really do love VS Code as much as Notepad++ now. One thing that I have liked about Notepad++ was that when exiting, unsaved files are persisted in the view. I discovered that VS Code provides the same!

First, select File | Preferences | Settings.

Next, search for “hot exit”. Then, update the setting to onExitAndWindowClose.

Enjoy!

Saturday, February 22, 2020

DevExpress' Blazor Roadshow Workshop with Carl Franklin of DotNetRocks fame

I recently attended the DevExpress' Blazor Roadshow Workshop with Carl Franklin of DotNetRocks fame.

I have often heard of DevExpress but now that I see that they are considering the great value that can be found in Blazor via Web Assembly and the native and cross platform capabilities I will be paying more attention to DevExpress.

Also, had a great time discussing all things Steely Dan and bourbon with Carl following the workshop.

Are Your Tech Practices Sustainable?

I have been in the tech industry for over 25 years. I have often questioned what is "hot" and trending as no doubt glittering but not gold. In my view, there has long been two fundamental problems in the tech industry.

Last year, the following was laid out. First, "Rachel Thomas, cofounder of fast.ai, addresses the tech industry’s 'glorification (and in many cases, requirement) of unhealthily long hours,' pointing out that it 'is not only inaccessible to many disabled people and harmful to everyone’s health [and] relationships, but it is also contrary to research on productivity.'"

Next, "Tim O’Reilly takes issue with Silicon Valley’s favorite growth strategy, blitzscaling—or as proponents Reid Hoffman and Chris Yeh describe it, 'achieving massive scale at incredible speed.' Instead of prioritizing growth above all, he argues, companies should be focused on 'mak[ing] their companies more sustainable, not just more explosive; more equitable, not more extractive.'"

This was brought to my attention by this Wired article, https://www.wired.com/story/midwest-christian-entrepreneurs-startup-life/. Let's quit the idea that everyone is not really living unless they are always working.