Author: way0utwest

  • T-SQL Tuesday #170–Abandoned Projects

    It’s the first T-SQL Tuesday of the new year. As we move forward, this month’s invitation is neat in that it’s looking back to learn how to move forward. I think while many people do look back, they don’t always use that information to move forward. This month’s host, Reitse Eskens, asks us about abandoned projects.

    As always, if you’re interested in hosting, blog, and then send me a note about hosting. I still have space in 2024.

    Abandoning a Project

    I’m sure that many of my employers started something and then abandoned it, and there are no shortage of projects I’ve abandoned myself, but nothing big springs to mind. Mostly I find my employers muddle through very poorly written, poorly performing projects and are very hesitant to abandon them.

    However, I will say that I have a couple things on my mind personally. This past December I completed the Advent of Cyber, which I wrote a bit about.  I actually got a certificate (of sorts).

    2023-12-28 16_08_10-Window

    That wasn’t abandoned, and I was glad I went through this, learning about a few tools.

    However.

    In the past, I’ve worked on the Advent of Code, and I’ve never finished it. I even built a repo, where I separated out puzzles by year. I invariably get a week in and then don’t have the time, and I struggle with coding out the puzzles. They get hard, and since this is a spare time thing, I run out of energy and interest.

    I do think, however, I learn some things. A few years I’ve tried to solve puzzles in PowerShell, Python, and SQL, which makes me translate logic, and think about the issues. SQL is hard, as a number of the puzzles are really iterative, and SQL isn’t great at iteration.

    I do learn.

    Even when I abandon projects, I get better at writing code and solving problems. It requires me to think, and it also teaches me things about how to look at a requirement and then write code. I also love the skill of building in tests to verify my code from the samples, which is a good skill.

    It’s an abandoned projects, and even as I write this, I feel like I should work on the 2023 puzzles a bit. I probably won’t because of time, but I do think starting and abandoning this project teaches you something.

  • Backing up the Teslamate Database

    I was worried about some of my data, so I wanted to be sure I had a backup of my Teslamate system. This post covers the config I’d added and how I backed things up.

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

    The Backup Volume

    In my Teslamate docker-compose file, I had added a backup volume some time ago. My config section looks like this:

    2023-12-19 15_02_56-docker-compose.yml - PublicDocuments - Visual Studio Code

    For this database container, I’d added the volumes for data and explicitly set a location that maps from a folder on my e: drive to a folder called backup in the postgresql location inside the container.

    This ensures I can easily find my PostgreSQL backup file if I need it, which I hope I never do, but you never know.

    Once this is set up, you can restart your container and the folder is mapped.

    Running the Backup

    There are instructions on the Teslamate Docs site, but I kept getting errors. I think some of those were because I was on docker compose v1, but I didn’t want to update without a backup.

    So.

    I used this code to connect to the container.

    docker exec -ti teslamate_database_1 /bin/bash

    Next, I ran this to backup the database.

    pg_dump -U teslamate teslamate > backup/teslamate_20231219.bck

    As you can see, it worked.

    2023-12-19 14_55_16-Custom Selection

    And I had a backup file in my folder.

    2023-12-19 15_14_52-backup

    Now to upgrade things.

  • Advice for Business

    During the last few months, I’ve seen a few different advice posts that caught me eye. One was Kevin Kelley’s blog (and his book) on life advice that I previously wrote about, I look at the book once a week or two, read 1-2 items, and think about them. I think some of them are geared more for younger people growing into life, but quite a few are still things that I appreciate as learnings or reminders.

    Recently I ran across another one, Sam Altman’s post looking back from a business point of view. I’ve worked in business for a long time, used to own one, and I tend to enjoy smaller businesses than larger ones. While I enjoyed my time at JD Edwards, I prefer companies with a few hundred people rather than 10,000 or more.

    This is an interesting list and one that looks at the world more from a startup perspective. Sam Altman was the CEO of OpenAI (maybe still is), and has worked in several small tech companies in his career. Some of these items are things that I’ve seen or used. Maybe one of the more interesting ones from a business perspective is about incentives. These really do drive and change how people work, and often management gets this wrong by incentivizing one thing, but saying or preaching another.

    However, the advice I think resonates more with me, as someone who works inside of an organization and with others, are the items that relate to people. One is about cohesive teams, and how they can get things done with both calmness and urgency. I’ve always wanted to interview with and know who I work with at many companies because having a team I enjoy and work with is powerful. I think Grant and Ryan are amazing, and I wish our jobs were a little more closely aligned. Unfortunately, we all tend to work on slightly different things most of the time, and work more solo, but I do appreciate the projects we tackle together.

    Another is that things that matter are important. You (and I) need a sense of purpose, which is why hard things that matter are easier than easy things that don’t. In life and at work. I also think that recruiting is important. I do look for people who I like, appreciate their views, and can work alongside more than those who know all the skills. We can learn from each other and teach each other when people have that potential (in addition to intelligence and drive). That’s why I think it’s almost always worth hiring good people, even if you don’t have a specific use for them. Too often we hire people for a need, and they’re way less qualified than others.

    Maybe my view is summarized well in the last entry: working with great people is one of the best parts of life. We spend so much time at work, so it better be enjoyable.

    By the way, if you want to find and enjoy great opportunities, learn to be better. Better at your profession, better at learning, better at being part of a team.

    Steve Jones

    Listen to the podcast at Libsyn, Spotify, or iTunes.

  • Has AI Changed Software Development?

    I saw a piece that asked the question about AI and software development, specifically ChatGPT, a year after its release. Has software development changed? It’s a question I’ve been trying to ask for myself, though I do think the way AI works for lots of code is fundamentally different than how it works for databases. Databases need a lot of context, with schema and relationships, whereas a lot of other code can be structured in a more narrow sense, focused on an algorithm rather than specifically needing to reference other objects.

    That’s not to say that a generative AI can write application code better than database code. I think in both cases it can be helpful or hurtful. As I read the article, I find myself agreeing that AI has changed software development. It’s a tool, and it can be useful. It can help structure code, point out issues, and help with building tests.

    That being said, I also agree with this sentence in the article: “…given that to write anything resembling maintainable code with AI, you’ll need some level of expertise in programming.” Everything I’ve seen from AIs still requires a review from a human that understands if the AI is on the right track in approaching the problem. I’ve written this a few times (and discussed it with others) that I think an AI produces junior level code in many cases, and it takes a subject matter expert to decide if that’s OK for the situation.

    However, I feel that AI does a few things really well. First, it’s a great search engine, able to understand multiple prompts in a row that narrow in the thing I might spend much more time searching for. It also does some nice predictive things in guessing what code is needed next. In most application languages, this is helpful. In SQL, not so much, since the SQL language lays code out in a way that makes it harder to predict things. The LINQ structure of from, where, select is much more cleaner in many ways. If only RDBMSes natively executed LINQ…

    If you’ve tried AI, what has worked, what prompts give you help? Is there anything especially time-saving you’ve found? I, and many others, are looking to understand where it can help us.

    Steve Jones