Sunday, January 09, 2022

Creating/Documenting your Lego designs

I recently needed to create a lego build instruction for the Lego team that I coach. I have used Lego Digital Designer, but that tool has been discontinued.

I found that the new tool the community uses is called:  Bricklink Studio and it can be downloaded from: Studio Download [BrickLink]

When you need to add parts, you can do it via the Palette Config:

The sets I imported are:

  1. 51515 - Robot Inventor Mindstorm
  2. 45678 - Spike Prime Set
  3. 45680 - Spike Prime Expansion Set
  4. 45300 - Wedo 2.0

And here are some links to additional parts you might need:

LEGO MINDSTORMS Robot Inventor Set 51515 part list and Studio part files (

Studio Spike Prime - Google Drive (via CAD.pdf (

CustomParts-51515 - Google Drive (via CAD.pdf (

Friday, November 12, 2021

Android 2021 - scrolling capture not working with Chrome browser

 Looks like the scrolling capture functionality is application dependent. With Chrome, you can enable this functionality by visiting chrome://flags/#scroll-capture

Once you enable and restart, you should I'll be able to scroll capture web pages in chrome.

Thursday, November 11, 2021

GitLens Remote Provider Settings for AWS CodeCommit

 If you wish to enable the shortcuts in GitLens to open remotes, as shown in the following screen shots, here is how I did it.

Screenshots of the shortcuts:

1. CTRL+SHIFT+P to open command palette.

2. Type Preferences: Open Settings (Json). Click on it to open the user settings file.

3. Add the following code, fixing the region values (As a Gist: (

"gitlens.remotes": [{
        "regex": "https:\\/\\/(git-codecommit\\.us-west-2\\.amazonaws\\.com)\\/v1/repos\\/(.+)",
        "type": "Custom",
        "name": "AWS Code Commit",
        "protocol": "https",
        "urls": {
            "repository": "${repo}/browse?region=us-west-2",
            "branches": "${repo}/branches?region=us-west-2",
            "branch": "${repo}/browse/refs/heads/${branch}?region=us-west-2", //
            "commit": "${repo}/commit/${id}?region=us-west-2",
            "file": "${repo}/browse/refs/heads/${branch}/--/${file}?region=us-west-2&lines=${line}",
            "fileInBranch": "${repo}/browse/refs/heads/${branch}/--/${file}?region=us-west-2&lines=${line}",
            "fileInCommit": "${repo}/browse/${id}/--/${file}?region=us-west-2&lines=${line}",
            "fileLine": "{line}",
            "fileRange": "${start}-${end}"


Monday, August 16, 2021

Microsoft work account doesnt send push notifications for sign ins to Authenticator app

 Push notifications suddenly stopped working for me. Here is how I fixed it:

  1. If you go to My Sign-Ins (, you can see all the ways in which you can sign in to your microsoft account.
  2. In my case, "Microsoft Authenticator" was in the list, but on my phone within the authenticator app, my account was grayed out.
  3. I deleted the "Microsoft Authenticator" item from the list and then added back again. The website prompts you through a couple of dialogs and then finally provides you a QR code to use against the authenticator app. Once I did this, the account was no longer grayed out.
  4. The final step was to mark the Authenticator app as the default sign in method on the website.
That fixed my problem.

Tuesday, May 11, 2021

Add Git Commands to the Visual Studio Toolbar

 I wanted to be able to quickly access the Git "Manage Branches" from the toolbar.

Here is how to do it:

  1. Go to View >> Toolbars >> Customize
  2. Switch to the "Commands" tab
  3. Then radio check the "Toolbar" option and in the drop down select "Standard" (in my case, I wanted to add it to the standard toolbar. You can add it to a new toolbar or a different toolbar).
  4. Click on the "Add Command" button
  5. Select "View" under categories
  6. Select "GitRepositoryWindow" and also optionally the "GitWindow"

  7. You now have easy access to the commands:

Wednesday, February 24, 2021

Databricks - Connecting to an Azure Storage Account using a SAS key

This post is about setting up a connection from Databricks to Azure Storage Account using a SAS key.

This method is perfect when you need to provide temporary access with fine grained permssions to a storage account. In this post, I will show how to setup readonly access for a temporary period of time.

Please note: you should try and use pass through credentials, but, that functionality need premium tier databricks. This post is a workaround that utilizes the Shared Access Signature.

  1. Create a Shared Access Signature Key for your Storage Account
    Go to your Storage Account and under "Settings", select "Shared access signature"
    Allowed Services: "Blob"
    Allowed Resource Types: "Container" and "Object"
    Permissions: "Read" and "List"

  2. Click Generate SAS and connection string
  3. You need the "SAS Token"

  4. Python code for Databricks Notebook:

from pyspark.sql import SparkSession
container = "<<containerName>>"
storageAccountName = "<<storageAccountName>>"
sasKey = "<<sas token from step 3>>"; # you should use:#dbutils.secrets.get(scope="scopeName",key="keyName") 
spark.conf.set(f"{container}.{storageAccountName}", sasKey)
spark.conf.set("spark.sql.execution.arrow.enabled", "true")
spark.conf.set("spark.sql.execution.arrow.fallback.enabled", "true")

inputfilepath = f"wasbs://{container}@{storageAccountName}"
dataframe ="mergeSchema", "true").parquet(inputfilepath)


The SAS key doesn't seem to allow you to use the abfs[s]: endpoint from databricks. Instead you need to use the wasb[s]: endpoint. Also, the SAS key doesn't seem to allow you to use the DFS URL (eg: {storageAccountName} So this isn't ideal, but, its a great way to connect using a temporary SAS key

Tuesday, December 22, 2020

"this dataset won't be refreshed" error in PowerBi service when using Web.Contents

If you get the "This dataset wont be refreshed" error in PowerBi online and the dataset refreshes fine in PowerBi Desktop, then one reason maybe in how you are using Web.Contents.

The first thing you should do is check your "Data Source Settings" in PBI-Desktop and check to see if you get the "Some data sources may not be listed because of hand-authored queries". (See: for more info)

For a majority of users, this is most likely happening on the usage of Web.Contents.

Here is some code that caused this error for me:

uri = "" & tenantID & "/oauth2/token",
xxx = Web.Contents(uri, [Headers = authHeaders, Content = Text.ToBinary(authQueryString)])

The problem with the above code is that PBI service does not like to refresh URLs that are computed on the fly. So to fix the above code all you have to do is, pass the dynamic parts as a RelativePath, like so:

uri = "",
relativePath = tenantID & "/oauth2/token",
xxx = Web.Contents(uri, [RelativePath =relativePath,  Headers = authHeaders, Content = Text.ToBinary(authQueryString)])

More info:

Sunday, September 13, 2020

D365 Finance and Operations: Odata query authentication: "No P3P Policy defined" error

 My background is with D365 Sales and I have tons of code that works flawlessly using the "Service to service calls using client credentials" flow to get its authentication token. Recently, I have been working with F&O and I was trying to using the same basic code to perform an OData call against Finance & Operations. But, I was getting a "No P3P Policy defined" error. Its not a very helpful error.

After some trial and error, I was able to determine that the problem was the URL I was using for the acquisition of the token, via the "AcquireTokenAsync" method). This does not work:, whereas this one does: The only difference was the trailing slash. Once I removed it, the error went away and all my queries began working flawlessly.

Sample Code:

Error Details

StatusCode: 401, ReasonPhrase: 'Unauthorized', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:

P3P: CP="No P3P policy defined.  Read the Microsoft privacy statement at"

Other documents:

MsDocs: Service endpoints overview  

Saturday, July 18, 2020

Sharing borrowed kindle library books with kids

  1. Borrow the book (I use Libby, and so after borrowing, need to make sure I click on deliver to Kindle).
  2. Once you have claimed the book and added it to your account,  and under account settings, click on manage "Content and Devices" (this should be the link
  3. Click on the "..." Button next to your book
  4. Click on "Manage Family Library"
  5. Finally add it to your kids free time library.