Category: Blog

  • Reading Data from the Command Line in PowerShell–#SQLNewBlogger

    Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

    In every language I’ve coded in, there is a way to read input from the command line. From INPUT in BASIC, readln in PASCAL, scanf in C, read in LISP, input() in Python, and more, every language can do this.

    I knew PowerShell could, and I wanted to find out how to do it. I’m building a CLI tool for SQL Saturday, and I am looking to get user input.

    A quick search led me to Read-Host. I probably should have guessed this, but it does what I need. A quick example of where I started. This code gets an event number from a user and then prints if back out, along with a string created from the number:

    $EventNumber = Read-Host -Prompt "Event Number:"
    $DataFilename = "SQLSat$($EventNumber).yml"
    # write the data
    write-host("Event: $EventNumber")
    write-host("File: $DataFilename")

    I can run this, as shown here, and put in a number.  I typed in the first 1022 below:

    2021-11-17 17_45_25-● sqlsatcli.ps1 - sqlsatwebsite - Visual Studio Code

    I’ll use this to get information from the user and then produce a YAML file that will contain what’s needed to publish, or update, an event.

    SQLNewBlogger

    This post took me about 10 minutes to assemble. I was already working through this process and stopped to jot down an idea, save some code, and make a screenshot. That was about 2 minutes out of my day, and then I went on with coding. Later, I wrote this.

    You could do the same thing. Take a minute out of your daily work, sketch a quick post, and then finish it later.

  • Daily Coping 22 Nov 2021

    I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag.

    Today’s tip is to connect with someone from a different generation.

    I used to think of a different generation as being someone older than me. However, these days, I tend to think younger. I make it a point to do this regularly as I coach, taking time to do more than interact with kids on the court, but also asking them how they think and view the wider world.

    However, I had the chance to talk to a few people recently at a technical event, and I took time to interact with someone much younger than me. Someone early in their career, who I asked questions and tried to understand the world as they see it. I got the chance to better understand what’s important to a younger person, which is vastly different than how I view the world.

    I made it a point to talk about “I think I’d do this”, rather than offer advice, counseling, or opinions on how they view things. It was quite an enjoyable conversation.

  • Tesla Bug Reports

    This is part of a series that covers my experience with a Tesla Model Y.

    I can’t remember where I learned this, but I saw someone that explained how to report bugs to Tesla in their software, or I guess, the hardware. I didn’t think a lot of it initially, but the last few weeks I’ve been using this every time something weird happens.

    The way this works is you activate the voice control by pressing the right steering wheel button. When the software responds, say “Bug report” followed by the issue.

    For example, the other day I was returning home and going down the country road that leads to my neighborhood. This road has a lot of hills, some steep, and I use cruise control sometimes to keep a steady rate. Sometimes, not always, as I go up a hill, the car will brake before cresting the hill. At times it’s light braking, going from 45 to 43. At times it’s heavy, and has slowed to 35 or slower.

    That’s not fun.

    I immediately hit the right hand button on the steering wheel and said, “Bug report phantom braking on hill”. I click the button again and it acknowledges the bug report submitted to Tesla. It also says I can schedule service if something is wrong.

    I have started to make this report as often as I get phantom braking. What I’m hoping is that every one of these reports includes the telemetry from the car. Knowing when the model is not appropriately managing car functions should help with better training.

    If it gets used.

    I’m taking a leap of faith that Tesla is looking at this feedback. Not each report, but in aggregate. Certainly test experiences with Autosteer years ago and now show an improvement. I’m hoping that giving them more data points will continue to improve things.

    There’s a quick video of my showing this.

  • Daily Coping 19 Nov 2021

    I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag.

    Today’s tip is to choose a different route and see what you notice along the way.

    I tend to be a creature of routine. I got from point A to point B often and take the same route. I might vary a bit early on, trying to find an efficient route, but then tend to settle in.

    I went down to Colorado Springs a few weeks ago for the user group lunch meeting, and decided to try a different route. I went down 83, but then cut over West at the Palmer Divide and enjoyed going through the rural areas. I’m amazed at how many new neighborhoods are tucked in the wilderness, just East of I-25. On the way home, I cut off from 83 into Russellville Road and saw the same thing.

    On one hand, I wish there were less construction and building, but on the other, I’m glad to see properties still above 1 acre and spread out. I suspect the pandemic has made it easier for people to work from the country, and not lose a large portion of their day to a commute.