teleren/devto huggingface dataset:
Troubleshooting Flask Chatbot Application
Tags: chatbot, flask, python, codenewbie
Published: 2024-03-24 21:01:58


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9aw47ixwjwbtf7kezh0j.jpg)

## Introduction

Hi folks. I am troubleshooting something and am wondering if anyone can help out. I am a bit of a noob, but eager to learn and help others in their own projects. I can return the favor if you want someone to help with your own programs. 

## Intake Chatbot for Business

I am currently working on a **Flask** application chatbot to assist a business in carrying out various administrative tasks. I used **Python** for the backend** logic and **Javascript** for the frontend. I also have this all integrated with the **Google** ecosystem. The intention is for the chatbot to carry out a structured or unstructured interview, and then send the data to a **Google Sheet**. The Google Sheet also has several functionalities using **Google Apps Scripts**. Once I finish the code, I intend to embed it on a **Wordpress** site. I also think I could make simple tweaks to it and sell it to individual businesses for their own needs. Below are the features of the program.

* Basic Chatbot UI to be deployed as a widget on a wordpress site
* Carries out structured or unstructured interview
* Makes various **API** calls specifically for Google Sheets, **Gmail**, **Open AI** etc
* Google Apps Script sends data to Open AI for Summarization, Analysis and to write personalized emails
* Google Apps Script also has function to automate email 

### Program Structure

The program utilizes **Pytorch** to carry out a more loose, unstructured interview, but for now I don't need this functionality and it is commented out. For now, I just have a structured interview written into the code with pre-set questions. There is a dictionary to store the question category responses and a step handler that moves on to the next step when it receives input. Then the idea is to take this information and append it to the Google Sheet

#### Troubleshooting

The program should work fine, but there is one hiccup. For whatever reason, the data is not appending to the Google Sheet, which is the final function and should be triggered by the last step. I have tested this function separately in a simpler program with hardcoded data and there doesn't appear to be any issue with my service account or API. Something is going wrong in the last step which should trigger the append to sheet function

#### Issues

Again, I am bit of a noob and must admit that I use **ChatGPT** as a bit of a crutch, so it is very possible the code is wretched. 

## Invitation for pointers

I have learned a lot during this project, but I am self-taught and there are a lot of gaps in my knowledge. If anyone wants to take a look at the code and give suggestions I would appreciate it and would certainly find a way to return the favor. 

Cheers,

Tony   
*
Automate Your GitHub Workflow with Bash Scripting
Tags: webdev, git, github, linux
Published: 2024-03-24 19:39:00

Introduction:
In today's fast-paced development environment, efficiency is key. One way to streamline your workflow is by automating repetitive tasks, such as adding, committing, and pushing changes to GitHub repositories. In this article, we'll explore how to create a simple automation script using Bash scripting on Linux to handle these tasks effortlessly.

Prerequisites:
Before we dive into the implementation, ensure you have the following:

A GitHub account
Git installed on your Linux machine
Basic knowledge of Bash scripting

Script Overview:
Let's dissect the script step by step:

```
#!/bin/bash

# Check if a commit message and repository URL are provided
if [ -z "$1" ] || [ -z "$2" ]; then
    echo "Usage: $0 <commit_message> <repository_url>"
    exit 1
fi

```
The script starts with a shebang line to specify that it's a Bash script. Then, it checks if both a commit message and a repository URL are provided as arguments. If not, it displays a usage message and exits.

```
# Add all changes
git add .

```
Next, the script adds all changes in the current directory to the staging area using git add ..

```
# Commit with the provided message
git commit -m "$1"

```
It then commits the changes with the commit message provided as the first argument.

```
# Set the remote repository URL
git remote add origin "$2"

```
The script sets the remote repository URL to the one provided as the second argument.

```
# Push changes to the remote repository (assuming 'main' is your branch, modify as needed)
git push origin main --force

```
Finally, it pushes the changes to the remote repository, assuming that the branch name is 'main'.
Usage:
To use this script, follow these steps:

Save the script into a file, e.g., git_auto.sh.
Make the script executable by running chmod +x git_auto.sh.
Execute the script, providing the commit message and repository URL as arguments:
`./git_auto.sh "Your commit message" https://github.com/your_username/your_repository.git
`

**Conclusion**
With this automation script, you can significantly streamline your GitHub workflow. By eliminating the need to manually execute Git commands, you can focus more on your development tasks. Feel free to customize the script further to suit your specific requirements. Happy coding!
Tqanya . تقنية
Tags: android, ios, windows, games
Published: 2024-03-24 19:14:17

موقع تقني عربي يقدم روابط تحميل مجانية ومباشرة وآمنة تماما لبرامج وتطبيقات والعاب أنظمة التشغيل اندرويد وايفون وويندوز، بالإضافة إلى مجموعة متميزة من أفضل الشروحات التقنية والحلول لمشاكل هذه الأنظمة
https://www.tqanya.com/
Day 1 of #100DaysOfCode Hash Tables
Tags: c, datastructures, algorithms
Published: 2024-03-24 19:05:41

**🔍 Efficient Data Retrieval:** Arrays offer O(1) access, but the linear search takes O(n). Hash tables leverage hash functions for O(1) insertion and access.

**Note:** hash function: Is a function that spits out the index of an available slot of the list to to insert new data or to retrieve data if data exists.

**⚙️ Dynamic Data Management:** Arrays require shifting elements for insertion, while linked lists demand traversal. Hash tables, through hash functions, ensure O(1) insertion regardless of position.

**🔑 Key-Value Pairing:** Hash tables resolve the search complexity (O(n)) by associating each element with a key. A hash function maps the key to its location, facilitating rapid retrieval.

**➖ Smart Removal Technique:** Additionally, hash tables employ intelligent removal methods. By leveraging the key, removal becomes an O(1) operation, maintaining efficiency.

**🔗 Collision Resolution:** I also explored collision scenarios where different keys map to the same location, leading to chaining and linear probing techniques. Chaining involves linking collided elements in a linked list, while linear probing explores adjacent slots for placement.

**_hash_table.h_**:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k1yz9fympy35j6edghde.png)

**_bucket.h_** (slots of the table)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tw9vu9b41b1efwyaybzt.png)

**_person.h_** (value of the table)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qdwvp590zstxputv85e0.png)

#100daysofALXSE
Introducing $MAGATRUMP: A Revolutionary New Cryptocurrency Set to Make Crypto Great Again
Tags: btc, blockchain, memecoin, megatrump
Published: 2024-03-24 18:51:11

March 22, 2024 - In an era where the digital currency landscape is constantly evolving, a new candidate is set to disrupt the market: MAGATRUMP. This Binance Smart Chain (BCS) token is designed to drain the swamp and make crypto great again, one YUGE bull run at a time.

**Tokenomics**:
● Token Name: MAGATRUMP
● Token Symbol: $MAGATRUMP
● Total Supply: 100,000,000,000
● Taxes: 2/2
● Token Distribution: Presale 49%, Liquidity 51%

**Join the MAGATRUMP Movement**
MAGATRUMP is more than just a cryptocurrency; it's a call to action for those who believe we
can Make America Great Again by offering a cryptocurrency that can give every person an opportunity. Our tremendous community is bigger and stronger than the wall! With a unique distribution strategy focused on empowering Trumpsters, MAGATRUMP is set to pave the way for our future.

**Innovative and Fair Token Distribution**
With a commitment to fairness and growth, MAGATRUMP's token distribution ensures a balanced ecosystem. The presale allocation allows early adopters to be part of the journey from the ground up, while a majority stake in liquidity guarantees confidence among holders.

Even though taxes are for the libs - this 2% tax fuels YUGE marketing plans to become the greatest and most powerful crypto community of all time. The campaign will include fast tracked
listings, partnerships with over 100 top influencers, a massive YouTube blitz, trending across top channels, X (Twitter) and Telegram raids, a major advertising campaign, AMAs in crypto’s most sought after groups and ongoing contests that will keep the community winning. 

Following the fair launch presale on PinkSale on March 29, the campaign team will roll out a Presidential roadmap that will continue to ignite the community.

**Secure as the Wall**
Just like our great President, MAGATRUMP is draining the swamp. No team tokens will be allocated, and 51% of Liquidity will be locked, making funds safe for trading and holding.

MAGATRUMP’s Smart Contract has been audited by top cybersecurity firm Cyberscope, to ensure safety.

**Join Our Community**
MAGATRUMPs fair launch presale on PinkSale will go live on March 29, 2024 at 3:00 p.m. UTC.

Be part of the MAGATRUMP revolution by joining our Telegram and Twitter to stay updated on all developments, announcements, and community events. Visit our website to learn more about
our vision, roadmap, and how you can be part of this historic movement.

1. Website: https://magatrumpbsc2024.com 
2. Telegram: https://t.me/MAGATRUMPofficial 
3. Twitter: https://twitter.com/Maga_Trump_BSC 

**Disclaimer:**
This press release is for informational purposes only and does not constitute investment, financial, or trading advice. Prospective investors are advised to conduct their due diligence and consult with a professional financial advisor before making any investment decisions in cryptocurrency
4 tips to write simple CSS
Tags: css, programming, tutorial, webdev
Published: 2024-03-24 18:41:15

I hear a myth CSS is difficult. I don't agree. I'd like to share my tips about how to write simple CSS. 

If you like it you'll get more [by subscribing to my newsletter](https://cssisntmagic.substack.com).

## `:has()` and `:focus-within` remove fragility of the next-sibling combinator

The next-sibling combinator has one disadvantage. It's broken if the order of elements is changed. The reliable alternative is `has()` and `:focus-within` 🔥

```html
<div class="cb">
  <input id="cb" type="checkbox" class="cv__input">
  <label for="cb" class="cb__label">Remember</label>
</div>
```
*Some solution*
```css
.cb__input:checked + .cb__label::before {
  /*
    styles of the custom checkbox are here
  */
}

.cb__input:focus + .cb__label::before {
  /*
    styles of the custom checkbox are here
  */
}
```
*My solution*
```css
.cb:has(:checked) .cb__label::before {
  /*
    styles of the custom checkbox are here
  */
}

.cb:focus-within .cb__label::before {
  /*
    styles of the custom checkbox are here
  */
}
```
## The power of CSS inheritance when defining line-height
Folks, I messed up. I forgot I can use CSS inheritance and add line-height to `<body>` instead of adding it to `<p>`, `<h*>`, `<ul>`, et al. separately 😉

*Some solution*
```css
p {
  line-height: 1.5;
}

ul {
  line-height: 1.5;
}
```

*My solution*
```css
body {
  line-height: 1.5;
}
```

## It’s time to use a new way for centering elements with position: absolute
Do you still use the old snippet to the center element with position: absolute using transform(-50%, -50%)? It’s time to use a new alternative! Meet place-items: center 😉

*Some solution*
```css
.parent {
  position: relative;
}

.parent::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
```

*My solution*
```css
.parent {
  display: grid;
  place-items: center;
}

.parent::before {
  content: "";
  position: absolute;
}
```

## We don't need to use 0 anymore to define margins and paddings
I had to make a not logical thing, i.e. use 0 to define margins, paddings with opposite sides 😒 Now margin-block, margin-inline, padding-block, padding-inline help us to make the same without 0 🥳

*Some solution*
```css
.container {
  margin: 1rem 0 1.5rem;
  padding: 0 1rem 0 1.5rem;
}
```

*My solution*
```css
.container {
  margin-block: 1rem 1.5rem;
  padding-inline: 1.5rem 1rem;
}
```
A rare situation when Laravel's session regenerates on each request in some specific servers
Tags: laravel, session, bug, webdev
Published: 2024-03-24 18:37:37

Hello Nerds,

I recently had a situation where I faced a weird problem with Laravel's session after migrating from **Laravel** 8 to **Laravel** 10. The thing was my application was regenerating the session on each request. Thus, resulting errors with `TokenMismatchException` and causing to 419 (page expired) error. 

The fun fact is it was happening in only a specific server of a platform named _siteground_ and was perfectly fine in my other WHM based shared hosting and Ubuntu VPS.

It was very hard to debug since the problem only occurred in a very specific server and I tried almost every suggestion I got from the internet to fix this problem for that specific server. But none of them work. 

After several trials and errors, I finally figured out it sacrificing 2 nights of my precious sleep. If you are having the same problem as me and tried every trick on the book (the internet I mean) and still weren't able to fix this issue here is what you gotta do. You will probably laugh at yourself when you find out the root cause (if the scenario is similar that is).

1. Check all of your configs and see if any of them have an empty line before the php tag and remove it.

2. Check every file that are being autoloaded like Providers, Helpers etc and check if they have any empty line before the php tag and remove it.

3. Ultimately you can use the below regex to find this specific pattern and get rid of it entirely from your project using a global search and replace feature of your IDE

Search with: `^\s*\n\s*<\?php`
Replace with `<?php`

I hope this help you (and my future self) fix the problem regarding the Laravel's Broken Session that had been a pain in my ass for a whole week.

Have a great day,
Keep breaking things, Nerd!
Stalactite ORM 2.0.0 is out ! 🚀
Tags: java, orm, sql, architecture
Published: 2024-03-24 18:31:25

Two years after the very first version, [Stalactite ORM](https://www.codefilarete.org/) is back with a 2.0.0 version released ! 🚀😊

As a reminder (legit one !), it has a new approach compared to JPA :
- mapping is defined by method references instead of Annotations or XML
- its fluent API helps you see the complexity of you graph
- it eagerly fetches your relations to avoid hidden sql queries

Here are some of new features :
- composite-keys
- many-to-many relations
- Map mapping
- Spring intégration

To give it a try, see documentation [here](https://www.codefilarete.org/stalactite-doc/2.0.0/)
Navigating Healthcare Choices: My Journey with America's Choice Health Insurance
Tags: healthcarejourney, insuranceadventure, coverageconfidence, wellnessguidance
Published: 2024-03-24 18:28:52


**Introduction:**
Once upon a time, in the maze of healthcare options, I found myself lost and bewildered. With so many choices and uncertainties, I embarked on a quest to find the perfect health insurance fit for me. Little did I know that my journey would lead me to the comforting embrace of America's Choice Health Insurance.

**Embarking on the Journey:**
Like any good adventurer, I started my quest with research. Scouring the vast landscape of insurance providers, I stumbled upon America's Choice Health Insurance. Intrigued by its promises of comprehensive coverage and stellar customer service, I decided to delve deeper.

**Discovering the Treasure:**
As I explored the offerings of America's Choice, I was pleasantly surprised by the wealth of benefits it had to offer. From flexible coverage options to a vast network of providers, it seemed like I had struck gold. But the real treasure lay in the peace of mind knowing that my health and well-being were in good hands.

**Overcoming Challenges:**
Of course, no quest is without its challenges. Navigating the intricacies of deductibles and copayments felt like battling formidable foes. But with the guidance of America's Choice and its transparent pricing, I emerged victorious, armed with knowledge and confidence.


**The Journey Continues:**
As my journey with America's Choice Health Insurance continues, I am filled with gratitude for the support and security it provides. With each passing day, I am reminded that I made the right choice for myself and my loved ones.

![america's choice health insurance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ps5wvi6br80cna69y69x.jpg)

**Link and Branding:**
For those embarking on their own healthcare adventures, I highly recommend considering [America's Choice Health Insurance](https://blog.webdosolutions.com/americas-choice-health-insurance/). To learn more about their offerings and to read other informational insurance blogs, visit the [Webdo Solutions blogs](https://blog.webdosolutions.com/) for insightful resources and guidance. Trust me, it's a journey worth taking.

**Conclusion:**
In the ever-changing landscape of healthcare, finding the right insurance provider can feel like an epic quest. But fear not, fellow adventurers, for America's Choice Health Insurance is here to guide you on your journey. With its commitment to quality, affordability, and exceptional service, you can rest assured knowing that you're in good hands. So go forth, brave souls, and may your path be filled with health, happiness, and peace of mind.
Desktop Monitor Guide for Elite Gamers & Content Creators ✨
Published: 2024-03-24 18:21:16

Listen up fam, you know that epic monitor can take your game to the next level. But with all the tech jargon out there, it's enough to make you .  Here's the lowdown on what to consider before you swipe your credit card:

1. Size Matters (but not THAT much):

    15-27 inches: Sweet spot for most peeps. Great for work, browsing, and casual gaming.
    27+ inches: Immersive AF for intense gaming or creators who need tons of screen space. But can be eye-straining if you sit too close.

2. Resolution: Think of it as image sharpness. Higher = crisper visuals but can strain your GPU (graphics card).

    1080p (Full HD): The OG. Good for everyday use and less demanding games.
    1440p (QHD): The sweet spot for high quality and performance. Great for most gamers and creative work.
    4K (UHD): Super sharp but $$$ and requires a beefy PC. Only get this if you REALLY need max detail.

3. Panel Type: This affects colors and viewing angles.

    TN (Twisted Nematic): Fastest response time (good for esports), but worse color and viewing angles.
    IPS (In-Plane Switching): Best color and viewing angles, good response time for most games.
    VA (Vertical Alignment): Deep blacks, high contrast, but slowest response time (not ideal for fast-paced games).

4. Refresh Rate: How often the screen updates (measured in Hz). Higher = smoother visuals.

    60Hz: Standard for everyday use.
    144Hz or 240Hz: for gamers! Makes fast-paced action buttery smooth.

5. Bonus Features:

    G-Sync/FreeSync: Techie stuff that prevents screen tearing (avoid!).
    HDR (High Dynamic Range): Super vivid colors, but not all games or content support it.
    Built-in speakers: Meh, usually not great quality. Invest in headphones instead.

Pro Tip: Don't just trust specs!  Read reviews and watch comparison videos to see what monitor ACTUALLY performs best for your needs.
Embracing the Journey: My Excitement in Joining the Dev Community
Published: 2024-03-24 17:59:05

I'm thrilled to be here, embarking on this incredible journey into the world of development. As I take my first steps into the vast and dynamic realm of coding, I couldn't be more excited to join this vibrant community of developers, enthusiasts, and learners. Allow me to share with you the exhilaration and anticipation I feel as I dive headfirst into this thrilling adventure.
DEV Challenge: a Pure CSS Alfajor
Tags: frontendchallenge, devchallenge, css
Published: 2024-03-24 17:55:25

_This is a submission for DEV Challenge v24.03.20, CSS Art: Favorite Snack._

## Inspiration 
[Alfajor](https://en.wikipedia.org/wiki/Alfajor) is a common (and delicious) sweet snack among several regions in Latin America. Recently, I received a visit from my family and have been eating so many of them... So here's my tribute to this very much loved snack.

## Demo
{% codepen https://codepen.io/vivitt/pen/NWmjoPp %}

You will also find the code in [this public repo](https://github.com/vivitt/pure-css).

## Journey

I have always been curious about drawing with CSS, so this was the perfect opportunity to get started.

- I learned about using the [clip-path](https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path) property to create custom shapes. This property adds a clipping region to set which part of an element is shown.

- I also used the [pseudo-elements](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements) ::before and ::after, which provide two additional boxes to add details to the drawing without adding more elements to the markup.

- Finally, I wanted to create a bit of texture in my drawing, so I came across this great article where I learned how to add a grainy gradient using SVG. [this great article, where I learn how to add a grainy gradient using SVG](https://css-tricks.com/grainy-gradients/).

- And had lots of fun creating this :) Thanks for reading!

<!-- Thanks for participating! -->
My First text-based Dungeon Escape Game - Python Terminal Project
Tags: python, gamedev, dungeon, firstpost
Published: 2024-03-24 17:53:07

# **ESCAPE FATE**
## *a Python Terminal text-based mini adventure!*

This principal foray into the world of text-based game design was made to emulate retro-style dungeon crawlers, with the added challenge of in game battles and lightning pitfalls. The wry humor sparsed throughout the game jabs at classic gaming tropes, and the story is littered with beautiful turns of phrase to entice the player into this strange small world.

{% embed https://github.com/bb456310/EscapeFateGame.git %}