Happy Holidays! Linux vs Unix Environments

I made an environment that had specific installs using pip and conda package managers within a linux system. I made an export file to recreate the environment on a different system. When I tried to use the file in a unix system, it had errors and wouldn't populate. Apparently this is known issue! Word to the wise. After much research, and yes finds to possible solutions, I just decided to go down the line installing the packages manually. It didn't take long. After a little tinkering, I got my project up and running with all updated packages on my unix system too. Note, the issue doesn't exist going from unix to linux. Funny, huh? "But I heard him exclaim, ere he drove out of sight, HAPPY CHRISTMAS TO ALL, AND TO ALL A GOOD-NIGHT!"

Lightbox Modal Image Gallery

Firstly, https://www.w3schools.com is a great tutorial site for learning tons of front end things. Secondly, I came across a curious little bug when trying to apply css styling to a lightbox. Some of it was not applying correctly. The issue was narrowed down to bootstrap css creating the conflict. If the link to it was removed everything looked fine. Thankfully I didn't need all the components that usually are incorporated with a slideshow that displays thumbnails. Upon removal of that the issue went away. But the fact still remains that the source of the issue may have come from a conflict between screen sizes and margin allowance. Food for thought.

Random thought of the Day

Do you ever just forget to hide your expressions for a minute and then you're like "woah, I did NOT mean to make that face out loud!"

CSS: Centering Content For Various Screen Sizes

The following, when added to a .css file, will center the content on screens > 600px. For screens < 600px the content will end up spanning the whole page. .your-class-name { display: block; max-width: 600px; margin: auto; } In bootstrap, you can also use the "mx-auto" class for horizontal centering. It can only be used on content that has specifications for display: block; width: "some amount". Example inline code: <div class="mx-auto" style="display: block; width: 100px;"> Centered Content </div>

Sqlalchemy: Case-Sensitivity

I came across an issue with a Registration Form where it was allowing duplicate accounts to be made due to a lack of character case-sensitivity comparison. There were 2 solutions that kept appearing in online forums. Option 1: was to use "from sqlalchemy import func" and incorporate func.lower() or func.upper() in my query to convert the database and user input to the specified case before comparing them against one another. Option 2: was to use ILIKE in the query, thus making it a case-insensitive comparison by nature. Option 2 seemed to be the easiest to use. However, upon testing I believe it was not working in the way I needed. The comparison seemed to be counting the database characters as equivalent to any combination of user input characters as long as the same letters were present. So the word "flask" was equal to "ksalf" and would then raise a validation error that the word already existed even though it really did not. I later found out that it was because I had added the wildcard character '%' to the front and back of my variable for the user input. This made a huge difference in the pattern matching for the ILIKE operator. So the fix was just to remove the wildcard characters from around my variable. Lesson learned! Anyway, either option was a decent solution.

1 2 3