Categories
Mastering Development

How to add CSS to the HTML file that I send through e-mail with Python

msg = MIMEMultipart(‘alternative’) msg[‘Subject’] = "Test" msg[‘From’] = GMAIL msg[‘To’] = EMAIL_TO_SEND_TO html = open("template.html").read().format(Name="swix") part2 = MIMEText(html, ‘html’) msg.attach(part2) with smtplib.SMTP("smtp.gmail.com", port=587) as connection: connection.starttls() connection.login(user=GMAIL, password=PASSWORD) connection.sendmail(GMAIL, EMAIL_TO_SEND_TO, msg.as_string()) This works fine and sends a mail with the html, however, I do not get the CSS that I have applied. Any idea how […]

Categories
Mastering Development

mysql.connector only inserts 1 character per row into MySQL database

I have this (somewhat) working script that takes comments from a Reddit subreddit and insert them into a MySQL database. The spaghetti code I ended up with, however, pastes one character from each comment to each row of the database instead of one comment per row. I have searched through but couldn’t find any instance […]

Categories
Mastering Development

How to create a 4-4-5 calendar using python/SQL?

I would like to have a dataframe consisting of the corresponding week numbers and month every date from 1/1/21 to 31/12/50 would belong to. For instance, date | day | week_no | yyyy-mm | quarter 01/01/21| Friday | 40 | 2021-01 | Q4 2021 02/01/21| Saturday| 40 | 2021-01 | Q4 2021 . . 24/01/21| […]

Categories
Mastering Development

Ionic5 prod build error – unknown component

My issue with ionic capacitor build –prod ios is that my working components starting with the likes of <ion-content> <ion-grid class="ion-no-padding"> <ion-row> <ion-col> fail build with ‘ion-grid’ is not a known element: 1. If ‘ion-grid’ is an Angular component, then verify that it is part of this module. 2. If ‘ion-grid’ is a Web Component […]

Categories
Mastering Development

ttk.Treeview’s width increases after hitting ttk.Radiobutton

I have been making this downloader app in python using tkinter and tkinter.ttk and added a recent feature in the app for the users to see a log of previous actions done by the program. It works fine, however, I recently discovered a bug. I have a settings button which creates another Toplevel and then […]

Categories
Mastering Development

Alternative way of submitting rate form

I made a rating model, it’s working alright, however, the design is horrible. This is one of my first ASP.NET Core MVC projects. Any suggestion on how can I make it with a star rating is appreciated. Thank you! cshtml: <form asp-controller="Ratings" asp-action="Add" method="POST" class="comments-form"> <input type="text" name="movieId" value="@Model.Id" hidden /> <input type="number" name="Score" required> […]

Categories
Mastering Development

perf intel_pt couldn’t resolve symbols at .plt sections

I tried to leverage perf to record the exection flow of binary, as well as call stacks. For resolving the symbols, I installed all of the necessary debug packages (like -dbg and dbgsym packages). Now it’s feasible for perf to resolve symbols of the binary, however, those plt symbols could not be resolved. An example: […]

Categories
CMS Mastering Development

Write project config to cloud storage

I’m on a read-only filesystem using Google App Engine Flex. I was able to write my cpresources to cloud storage using a plugin, however, now I need to have project.yaml be written elsewhere. perhaps cloud storage as well. Not sure how to approach this

Categories
Mastering Development

How can I show the updated state?

When I’ll click submit, it will save in the firestore, however, I still need to reload the page to update the state. How can I code it in a way that once I’ll click submit, it will immediately reflect on the screen without reloading it? const Account = () => { const [displayName, setdisplayName] = […]

Categories
Mastering Development

Confluent control-center throws error after 1 minute when viewing the messages on any topic in UI

I have setup confluent 5.5.0 on kubernetes (AKS) using "cp-helm-charts", however, I am facing some issue with the control center. Everytime I am on the messages window of a topic in control center ui, the below error shows up after 1 minute. It works fine for 1 minute and then the error pops up. If […]