Author: way0utwest

  • A New Word: Rückkehrunruhe

    rückkehrunruhe – n. the feeling of returning from an immersive trip only to notice if fading rapidly from your awareness, as if your brain had automatically assumed it was all just a dream and already went to work scrubbing it from your memory.

    I feel like rückkehrunruhe happens at the end of quite a few trips. Certainly all the volleyball ones where I’m coaching. Such an intense emotional experience competing with a team, but not doing much more than providing light guidance. I don’t get on the court and can do little to affect the outcome in the moment.

    However, I also felt this recently after coming back from That! Conference in Wisconsin. 3+ days in a fun, scout-camp-meets-tech-conference atmosphere and back to work. I think having a 30 hours turnaround at home before reading to the wedding also made the transition back from the work event to life full of rückkehrunruhe.

    From the Dictionary of Obscure Sorrows

  • Adding Copilot to Azure Data Studio and a Few Experiments

    As a part of a recent Data Exposed that I was on, there was an ADS update which mentioned Copilot being added. Since I’ve been experimented, I decided to give this a try.

    This is part of a series of experiments with the ChatGPT and other AI systems. Lots of Copilot lately.

    Installation

    One of the easy things about VSCode and ADS is that you can install things from the marketplace very easily. You search and it appears, as shown here. Click Install to add it.

    2023-08-02 12_33_05-Extension_ GitHub Copilot - VCS_Primer-1 - Azure Data Studio

    Once you do this, it’s enabled. I have access to the Copilot with my GitHub account, so I assume this picked this up.

    Using Copilot in ADS

    There’s a blog about what this tech is and a few workflows. However, I decided to try something first. I picked a table in this connection and started typing. Copilot added a suggestion.

    2023-08-02 12_40_32-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    It’s not a good one. That’s a table, not a function.

    2023-08-02 12_40_51-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    Yeah, some AI isn’t reading my schema and sending it back to GitHub. Boo, this isnt’ helpful. I can only guess that seeing “StringSplit” had the AI guessing this was related to string_split(). Something a new dev might think.

    2023-08-02 12_47_56-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    OK, let’s pick a table and see if intellisense works better. I’m guessing it doesn’t. Here’s a suggestion based on what I typed.

    2023-08-02 12_43_04-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    Not a bad guess. I have some schema in here, and there is an OrderHeader related to a Customer table. However…

    2023-08-02 12_43_24-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    There is no orderdetail. This clearly isn’t intellisense. It’s an AI taking guesses.

    Trying Comments as Prompts

    Let me try a few things from the blog. I’ll enter a comment.

    2023-08-02 12_50_25-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    I don’t like that. While I think this is valid for MySQL or PostgreSQL, it isn’t for SQL Server. Setting aside why LIMIT isn’t in T-SQL, why doesn’t copilot recognize this is T-SQL? Let me help it.

    2023-08-02 12_54_06-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    Better, but I don’t want to add “in T-SQL” to everything.

    Another experiment. I tried a couple of prompts, but realized that asking for “orders” doesn’t mean that the AI knows I mean orderheader. Context around what or where an order is stored is something humans might include in natural language. However, I got this:

    2023-08-02 12_55_26-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    Which doesn’t work. I’d left the “in t-sql” from the previous prompt, so I’m not annoyed there, but this isn’t looking at schema. I also find the Oracle help not helpful.

    2023-08-02 12_55_36-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    However, this was interesting. I wanted a shipdate (this is a column) in 2023. The first suggestion was = Jan 1, but when I deleted that and hit enter again, I got this.

    2023-08-02 12_58_12-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    Not bad. I tried a longer prompt, with a few comments. All of the code was suggested a line at a time, and when I hit Enter, I got the next line.

    2023-08-02 13_00_38-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    The blog does note that adding the table create at the top of the query helps. Let’s try that.

    I’ll add creates for customer and orderheader. I then try a simple prompt and get this.

    2023-08-03 15_19_54-● SQLQuery_2 - dbo.OrderHeader Aristotle_SQL2022.sandbox (Integrated) - VCS_Prim

    Note, I tried “write a query”, but that didn’t work. I used “fetch” from the blog and that got me something. Though, not sure why this term is needed.

    I also changed my prompt trying to get all matching orders and got this instead.

    2023-08-03 15_20_20-● SQLQuery_2 - dbo.OrderHeader Aristotle_SQL2022.sandbox (Integrated) - VCS_Prim

    I also tried changing this to get matching orders. No idea why the customer name is limited in here.

    ads_query_1

    What about aggregates? I know some people have trouble with these.

    ads_query_2

    Not bad.

    Conclusion

    Adding Copilot to ADS is easy, but using it isn’t. The code it produces can have lots of mistakes, and not even work. It can make some strange assumptions, like junior devs might do.

    Adding context makes things better, but for many of these simple queries, I have to describe things enough that I might as well write the query. Especially with SQL Prompt, I’d use SSMS instead.

    However, learning to use prompts is a skill and it’s one to work on. Hopefully the AI will improve over time and I’ll start to see more useful suggestions, especially with different types of code.

    So far, I’m impressed very little with this tool.

  • Searching for People

    Inside Redgate Software, someone posted a picture and was asking if anyone knew who the person was. In this case, there had been a conversation at an event, and a picture was taken, but our employee couldn’t remember the individual’s name to whom they’d spoken.

    This happens a lot, especially to me. I’m really good with faces, and often remember what we talked about, but I’m horrible with names.

    Someone suggested an image search, so I decided to give that a try and see what happened. For privacy reasons, I won’t put the person’s image here, but use mine instead.

    Google Searches

    Google will perform image searches, but it’s not doing facial recognition. They talk about that somewhere, but I’ve seen that listed a few times for privacy reasons. I took a picture of myself and decided to test this.

    First, go to the Google home page. In the search area, you can see an icon, which lets you pick image search.

    2023-07-28 12_05_11-Google

    If you click this, you can upload an image.

    2023-07-28 12_05_14-Google

    I did that, and it clearly wasn’t looking for a person, but rather a shirt. My results are shopping oriented, and not good.

    2023-07-28 12_05_22-Google Lens

    Of I change the focus, it’s still bad.

    2023-07-28 12_05_54-Google Lens

    Supposedly it’s looking to match real images, not people, so I’ll give a photo I know is on the Internet. I know because I searched in Google for this image with text, and then screenshot’d it.

    The initial focus was on Simon’s robe, but even changing this to me, it doesn’t find this picture.

    2023-07-28 12_06_43-Google Lens

    Google isn’t great here. I think because it’s really looking for something to buy. Good if that’s your focus, less helpful here.

    PimEyes

    There are other engines. PimEyes is one. This is a paid service, but I uploaded my first picture, and saw these results:

    2023-07-28 12_20_17-Look at the face I found with PimEyes! Try it yourself on PimEyes.com! _ PimEyes

    I like that they’ve blurred out some of the others, and instead focused on me. These are all pictures of my, and if I paid, I assume they would have my name. If I scroll down a bit, I’ll see some URLs, like my blog site, which would help me figure out where to find this.

    2023-07-28 12_55_51-Look at the face I found with PimEyes! Try it yourself on PimEyes.com! _ PimEyes

    I only had 3 free searches, but this seemed to work well.

    TinEye

    TinEye is another engine. This one was less useful than Google.

    2023-07-28 12_57_46-0 TinEye search results

    FaceCheck.ID

    I tried https://facecheck.id/, which made me feel like a Private Investigator. I had to agree to terms, meaning I won’t do this for nefarious purposes, and then also fill out a puzzle captcha.

    2023-07-28 13_00_47-FaceCheck - Reverse Image Search - Face Recognition Search Engine

    My request was queued, as I’m guessing they only have so much compute that they share amongst people that want to the service. Once the search started, it was interesting. Face flying by my image.

    2023-07-28 13_02_40-FaceCheck - Reverse Image Search - Face Recognition Search Engine

    When this was done, I get some great results. With rankings.

    2023-07-28 13_03_16-FaceCheck - Reverse Image Search - Face Recognition Search Engine

    The lower ones clearly aren’t me, and the rankings are in the 60s, though the lower left ranks a 68 and that is me. The lower ones made me laugh a bit. Do I look like these?

    2023-07-28 13_04_29-FaceCheck - Reverse Image Search - Face Recognition Search Engine

    Privacy Concerns and the Future

    I don’t know where this will go, but more and more people are being captured in images and uploaded to the Internet. Even if you don’t do this yourself, if you go to public places, especially while traveling, who knows if someone taking their own photo will capture you and upload your image.

    Certainly many governments and even private companies do this, though often their results aren’t uploaded to the public Internet. Not that they aren’t or that those images are safe, but hopefully those aren’t easily searchable.

    I don’t know how we get around things, but I do like that lots of companies don’t want to allow AI bots to search their content and are limiting API access. I appreciate that in this case.

    Conclusion

    Looking for someone is interesting and I was surprised both how hard it was and how easy.

    If you haven’t looked for yourself, give it a try. I wonder what you find.

  • Republish: Code Building Code

    Today is a Redgate event in Pasadena and I know the day will get away from me. Since I can’t manage the site or respond, you get a republish of Code Building Code.