Sunday, April 27, 2025

31 character limit

Making something for work, a nice simple situation of reading all xlsx files in a folder and moving the data to a tab in a single xlsx file. Easy peesy. 

30 mins later I run it the first time. It ran, but was giving me "Excel found errors, but can recover the data". Data all looked good, except every tab after the first was named "Recovered #". 

2hrs of work, with lots of long walks, and off the clock research, later, I discovered that the issue is the file names that I am trying to use for the tab names are longer than 31 characters, and the first 31 characters are the same.  OK, the first 39 characters are the same, and then there are 10 more at the end that match. These file names are insanely long. 

So I set up a simple replace to remove everything that is duplicate data in the names, and it all works! The issue was in excel, not my code. I went so far as to try writing the data to a csv, and then to the final excel file to see if there was some weird characters or formatting setting it off, before I wondered if there is a limit to the size of an Excel sheet name.

Monday, March 17, 2025

Error code

 "Oh, I know this error code! I just need to google it to remember how to fix it." 

Life of a coder.

Molly

Writing code that will search for a value.

Needed to call the searched for value something, so I named it 'molly'. 

Yep, I am looking for molly.

Friday, February 28, 2025

Programming is...

Programming is all about getting the code to do what I want, and not what I told it to do.


Tuesday, February 18, 2025

Naming conventions are important

People not following naming conventions is going to drive me insane. 

Xxxx_xxx_dddd is not the same as Xxxx_xxx-dddd.

Ok, so check if char 8 is... No wait, just get rid if char 8... Xxxx_xxxdddd doesn't care if there used to be a - or a _ there.

Ok, thanks for helping me figure out how to fix this.

Wednesday, February 12, 2025

It runs faster!

 I refactored some code, cutting run time by 34%.

The program runs once a day, takes 5 minutes, with 4 minutes of that being 2 rounds of "Wait 120 seconds and make sure we really disconnected". Around 6hrs of writing, testing, and getting approval to save 7 seconds of time per day. 

This is the life of a junior.

Sunday, February 9, 2025

Can AI code?

 Today for fun I wanted to see how much I could do just using AI code.

Below is the prompts I used:

  1. Using python, I want to create a todo type app that uses json to store the data
  2. Based off the code above, add in a due date
  3. Sort tasks by due date
  4. Add in a priority rating for task, sort task by due date and then by priority.
  5. Have option 5 show a list of uncompleted tasks, and a list of completed tasks
  6. Add in an option to edit existing task, including description, due date & priority
  7. Rather than using the command line, lets create a html interface
Step 6 I hit the first thing it didn't take into account. If you edit a task that already has a priority but remove it and don't assign it a new one it would assign it null, and then couldn't show the lists of tasks. I wrote my first bit of code and changed None to 0. Step 7... it tried to use enumerate in the task filter, which didn't work. I told it the error message I was getting and it offered me 2 fixes. Both worked, so I went with the simpler one.
Then I found out the edit button didn't bring up the edit form. "Oh hey, sorry. Here are some fixes to the JS"... still not working. Fed it all of the code in index.html. "Here you go. I had left the edit form empty". That worked.
Link to the repo I am storing it in, with pictures, and arrows, and a note on the back: https://github.com/krgirard33/todo_app

We can't do that here

I remember years ago looking over a book, Automate the Boring Stuff with Python, and thinking how this would be so useful at work. Half of m...