teleren/devto huggingface dataset:
The 9th day of the 100 days of code challenge
Published: 2023-05-24 21:48:05

Today, I finished the project I'll be using as my reference point from yesterday and I finalized the planning of the project I'll be making. The first step is to learn UI/UX to make sure I've got what I need to start designing it, probably using Figma.

I didn't have as much time as I did yesterday, but I'm usually better working with structured courses.

As this is a field I've never tried to do anything in, I'll make sure to go through the entire course before trying anything. I will go for one of the courses Angela Yu offers, as she's my idol when it comes to courses.

That's about it for today,
Happy coding everyone!

Edit: Dedicated another 10 minutes to reading Atomic Habits, that’s how I end my day nowadays. Staying consistent with it is really important to me and I love writing just a tiny bit about what I read.

It’s interesting how our lives follow a “stacking” pattern - where we do things automatically one after the other. For example: Wake up -> brush your teeth.

The fact that we can apply this to habits is amazing, I believe that I’m already doing something similar just by reading the book right after I brush my teeth.

So my “night” routine looks like this: Brushing my teeth -> Reading -> Going to bed.

That’s about it now!
Bytewax at Data Science Summit. Interactive Dashboards To Detect Data Anomalies In Real Time
Tags: conference, datascience
Published: 2023-05-31 13:44:02

---
title: Bytewax at Data Science Summit. Interactive Dashboards To Detect Data Anomalies In Real Time
published: true
date: 2023-05-24 21:41:03 UTC
tags: conference, datascience
canonical_url: https://bytewax.io/blog/interactive-dashboards?utm_source=rss
---
![talk invite](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jdl0zu6hnx1png37c1gt.png)
## Data Science Summit

[Data Science Summit](https://dssconf.pl/en/) is the largest and oldest independent data science conference in the CEE region. This year, we are joining them online and our CEO, Zander Matheson, is presenting! For the sixth time Data Science Summit shares knowledge in topics ranging from analysis and processing (including big data), implementation issues to visualisation (BI) and management topics. This year's edition of the most important Data Science event in Poland dedicated to Machine Learning!

10 tracks, 100+ talks, the agenda is packed with cutting-edge insights 💡

🎟️ Use code DSSML23RP20 until 09.06.2023 to grab a Standard or PRO ticket at a 20% discount

Here are details of the talk Zander is presenting:

## Interactive dashboards to detect data anomalies in real time

Join Zander for a technical exploration of crafting interactive dashboards that employ online machine learning algorithms for real-time anomaly detection across hundreds of sensors. He will guide you through how to set up a development environment with a streaming system (Kafka or similar), load sensor data to the streaming system with Bytewax, and write a dataflow using River that will transform the data and use different anomaly detection algorithms to determine if there are anomalies in the sensor data. The icing on the cake? Visualize all these complex processes on a dynamic, real-time dashboard using Rerun! Equip yourself with the tools and knowledge to monitor and react to data anomalies as they happen. Come, experience the power of Python in data anomaly detection and interactive visualization in real time!

If this abstract sounds interesting, you might want to check out these blogs: [Real-Time Anomaly Detection Visualization with Bytewax and Rerun](https://bytewax.io/blog/data-visualization-with-rerun) and [Online Machine Learning for IoT](https://bytewax.io/blog/online-machine-learning-iot#online-machine-learning-in-python). The talk is going to go beyond these but it covers same domains.

We are looking forward to exchange knowledge, share our ideas and learn from the experiences of other attendees and speakers. Stay tuned for updates from [the conference!](https://ml.dssconf.pl/en/)
Levels of email dark mode
Tags: design, email, code
Published: 2023-05-24 21:17:36

---
title: Levels of email dark mode
published: true
description: How to go about preparing your template for email clients that force dark mode on your design.
tags: design, email, code
# cover_image: https://blocksedit.com/content-code/img/email-dark-mode-layout.png
# Use a ratio of 100:42 for best results.
# published_at: 2023-05-24 21:02 +0000
---

Setting up your email’s design for dark mode isn’t really [a choice](https://blocksedit.com/content-code/dark-mode-decision/) since some email clients will do it anyway. This includes Gmail and Outlook which will invert background colors and text. This leads to potential accessibility issues that make your designs hard to read, or in some cases, completely unreadable.

## Forced dark mode

So you’ll have to adapt to the way email clients treat your design for dark mode. The way to do this is to first test your email template in the email clients that will force color changes for your design. The [email clients to look out for](https://www.litmus.com/blog/the-ultimate-guide-to-dark-mode-for-email-marketers/) are:

* **Outlook 2021, Office 365, and Windows Mail, on Windows** - all do a full invert of colors across the board
* **Outlook.com, on Windows (across all browsers)** - will invert some colors, but doesn’t always invert all background colors or text of certain elements, like buttons
* **Gmail app, on iOS** - also does a full color invert
* **Gmail app, Android** - partially inverts colors, similar to Outlook.com

Use [Email on Acid](https://www.emailonacid.com/) or [Litmus](https://www.litmus.com/) to get a range of test environments to look at.

## Making adjustments

You can adjust some aspects of your design where necessary to account for the changes. Make sure your logo and transparent graphics look good on a darker background. Consider adding an outline around your logo to ensure it’s readable. Avoid text over background images since images don’t get inverted, but the text will.

For Outlook.com, attributes are added to elements that change colors. So you can refer to those attributes and overwrite their changes by including classes in your HTML and then targeting them in your `<style>`:

For text color:

```
[data-ogsc] .classname { }
```

For background color:

```
[data-ogsb] .classname { }
```

Unfortunately, there are no other standard methods for adjusting colors for the rest of email clients that force dark mode.

## Optional dark mode

Email clients that don’t force dark mode will allow you to set your own dark mode color scheme by having you use a media query in your `<style>` to specify what you want elements to look like:

```
@media (prefers-color-scheme: dark) { }
```

A meta tag is required for some email clients:

```
meta name="color-scheme" content="light dark">
```

Along with CSS definitions as well:

```
:root {
  color-scheme: light dark;
}
```

For an example of a full template using dark mode, take a look at [the Starter template](https://blocksedit.com/starter-email-template/).
First Post on Dev
Published: 2023-05-24 21:07:32

First post on Dev.to! 

Just finished my portfolio website using React.JS. I’m planning on using a post to discuss my work and challenges met when I designed and coded for my website.

Oh btw the cover image is a photo I took in Hawaii. I miss there a lot, especially when I’m stressed and tired from school and job finding process. But I will always try my best to make progress on the career path I have passion about.

Alright here is a good point to stop on my first post. It’s all just some random thoughts after finishing deploying my website for now.

Good night^_^

Henry Z
2023/05/26 1:31am
Ace the "Tell me about a time you faced a conflict at work, and how you resolved it" question in your next interview.
Tags: career, careerdevelopment, interview
Published: 2023-05-24 21:00:00


As a job seeker, you've likely heard this question before: "Tell me about a time you faced a conflict at work and how you resolved it?" It's a classic interview question that hiring managers love to ask to see how you handle challenging situations. And while it can be intimidating to answer, it's an excellent opportunity to showcase your problem-solving skills and highlight your ability to handle challenging scenarios.  It's a tricky question, but don't worry; you can ace it like a pro with the right approach.

First, it's important to understand why interviewers ask this question. They want to know how you handle difficult situations and whether you can work effectively in a team. So, your response should highlight your problem-solving skills, communication skills, and ability to collaborate with others.

To answer this question effectively, follow the STAR method. Start by describing the Situation or Task that led to the conflict. Next, explain the specific Actions you took to resolve the issue. Finally, share the Results of your actions and how they impacted the situation positively.

For example, let's say you were working on a group project, and one team member needed to pull their weight, causing tension and delays. To resolve the issue, you could just describe how you talked to the team member to understand their perspective and concerns, worked together to identify solutions, and reassigned tasks to make sure everyone was contributing equally. As a result, the project was completed on time with improved quality, and the team member felt valued and heard.

Remember, it's okay to acknowledge that conflicts can be challenging, but focus on how you turned it into a positive outcome. And remember to mention what you learned from the experience and how you applied it to future situations.

In conclusion, conflict resolution is an essential skill in the workplace, and interviewers want to know how you handle it. By using the STAR method and focusing on problem-solving and communication skills, you can demonstrate your ability to handle conflicts effectively and work collaboratively in a team. Good luck in your next interview, and remember, stay positive and confident!
Creating a Rock, Paper, Scissors Game using Python
Tags: beginners, python, programming, gamedev
Published: 2023-05-24 20:36:40

The goal was to create a rock, paper, scissors game that the user can play against the computer.

---

_Press the RUN button to play!_


---


{% replit @cinhernandez/rock-paper-scissors-game  %}


---


If we take a look at the main.py file we will be able to see the breakdown of the code. We begin by making the text art images and set them as variables.

---

![Art Images](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zxfoevey3y1zayuocgeh.png)

---

We can then set the text art image variables in a list, that way we are able to print the image along with the player and computer choice. 

In order to receive the number we need to create an input that will be saved as a variable when the player types their choice.

After this section it is important to create an if/else in case the player types an invalid number that is not (0-2).

---


![Second part](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4wt3j9yna2qxfydas75u.png)


---

Now we can work on creating the computer choice. The computer choice variable will equal a random integer from 0-2.
In order to use `random.randint()` we must import the random module. 

---


![Third part](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gkuhk8p7tml0uje6w13s.png)

---

In order for the game to execute the correct win or lose we need to create if/elif/else statements. 


---

Text art sources: https://gist.github.com/wynand1004/b5c521ea8392e9c6bfe101b025c39abe#file-rps_ascii_art-py
postgres troubleshooting queries
Published: 2023-05-24 20:35:16

get long running queries

```
select
	pg_stat_activity.usename,
	pid,
	pg_stat_activity.query_start,
	now() - pg_stat_activity.query_start AS duration,
	query,
state
FROM pg_stat_activity
where state = 'active' and (now() - pg_stat_activity.query_start) > interval '60 minute'
```

query to find query that has locked rows

```
SELECT
    concat(client_addr, ':', client_port) AS origin_of_the_statement,
    datname AS database_name,
    usename AS database_user,
    pid,
    usename,
    pg_blocking_pids (pid) AS blocked_by_pid,
    concat(wait_event_type, ':', wait_event) wait_event,
    query AS blocked_statement
FROM
    pg_stat_activity
WHERE
    CARDINALITY(pg_blocking_pids (pid)) > 0
    AND pid <> pg_backend_pid();
```

Then to get process details

`SELECT datname,pid,usename,query_start,wait_event_type,wait_event,state,query
FROM pg_stat_activity where pid=27581;`


To get queries that have been running for a long time.

```
select
	pg_stat_activity.usename,
	pid,
	pg_stat_activity.query_start,
	now() - pg_stat_activity.query_start AS duration,
	query,
state
FROM pg_stat_activity
where state = 'active' and (now() - pg_stat_activity.query_start) > interval '0 minute'
```
Managing Duplicate Sales Records in Odoo Using Python
Tags: python
Published: 2023-05-24 20:32:15


I recently had a situation where an Odoo instance was importing sales from multiple sales channels, due to the nature of the import process some sales got created twice. Technically sales records with the same name should not allowed, but alas here we are. 


I made this script to find any records with the same name. 

```
import xmlrpc.client

# Odoo details
url = 'your_url'
db = 'your_db'
username = 'your_username'
password = 'your_password'

# Get the uid
common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
uid = common.authenticate(db, username, password, {})

# Get the models
models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url))

# Search for sales order records
sales_order_ids = models.execute_kw(db, uid, password,
    'sale.order', 'search',
    [[]])

# Read the sales order records
sales_orders = models.execute_kw(db, uid, password,
    'sale.order', 'read',
    [sales_order_ids])

# Dictionary to store the count of each record
record_count = {}

# Go through each sales order
for order in sales_orders:
    # If the order name is not in the record_count
    if order['name'] not in record_count:
        # Add it with a count of 1
        record_count[order['name']] = 1
    else:
        # If it is already there, increment the count
        record_count[order['name']] += 1

# Print the repeated records
for record, count in record_count.items():
    if count > 1:
        print(f"\033[91m Multiple sales records: {record} \033[0m")

```
What is your job search process?
Tags: career, productivity, discuss, programming
Published: 2023-05-24 20:20:43

Hello. How's the job search going? What's your search process? 

## Don't get discouraged, keep applying

I am starting to get replies to my applications! I'd estimate only about 5% of my applications got replies. I used to get so discouraged by rejection emails but I started realizing it's just inevitably part of the process. You have to accept the majority of jobs you apply to will be rejections. But the more you apply to, the better odds you have of getting a reply.

# My process

Here is the process I've been using for finding a job. Got any tips or advice? What do you do differently?

## Mornings and afternoons:
* Apply to jobs every day online on LinkedIn
* Reply ASAP to any requests to interview or other incoming opportunities, within 24 hours ideally
* Write follow up emails to all interviews you have, thanking them for their time and asking for next steps in the interview process
* Prep for interviews by having notes such as these:
  * Introduction you plan to give
  * Why you're a good fit for the job
  * A list of questions prepared to ask
* Practice interview questions on [LeetCode](https://leetcode.com/)

## Nights:
* Work on side projects
* Publish updates to side projects on LinkedIn daily
* Another thing I did recently was write an article on [Dev.to](https://dev.to/). If you stumble across a tip or technique you think others might find helpful while working on your side projects, write an article about it. For example, I wrote an article on [how to clear the VSCode terminal whenever you save](https://dev.to/austincoleman/optimizing-your-workflow-clearing-vscode-terminal-on-save-1og6).

What's your process been like?
Creating Webex Bot with GPT - A Simple Guide
Tags: azure, gpt3, webex, python
Published: 2023-05-24 20:16:52

In an age where automation and efficiency are key to productivity, the integration of AI models like GPT with chat platforms has become essential. One such powerful integration is that of GPT (Generative Pre-training Transformer) with Webex, a widely used team collaboration tool. In this blog post, we will explore how you can easily create a Webex bot that harnesses the power of GPT and discuss some of the potential business applications of this combination.

**The Power of GPT and Webex**
GPT is an advanced language model that uses machine learning to generate human-like text. When integrated with a communication platform like Webex, it enables the creation of a bot capable of answering queries, giving responses, and holding conversations that closely resemble human interaction.

Webex is a platform loved for its convenience and efficiency in handling team collaborations, meetings, and chats. It already includes user authentication which, when coupled with a GPT-powered bot, provides a secure, effective, and personalized user experience.

**Why Combine GPT and Webex?**
This integration has several advantages. Firstly, the combination provides an AI assistant that is capable of human-like interactions. This can help in automating responses to FAQs, handling customer queries, scheduling meetings, and much more. It essentially makes your Webex bot much smarter and more useful.
Secondly, with Webex's built-in user authentication, the security and privacy of your interactions with the GPT-powered bot are ensured. This is particularly important in a world where data privacy and security are paramount.
Finally, the integration finds relevance in numerous business scenarios. It could serve as a virtual assistant, a customer support agent, a meeting scheduler, or even a tool for interactive language learning. The possibilities are immense and largely unexplored.

**Your Guide to Creating a Webex Bot Powered by GPT**
If you're interested in leveraging the power of GPT for your Webex bot, look no further. I've shared a project on my [GitHub](https://github.com/MKovacik/WebexBotWithAzure) that makes this process incredibly easy. The project hosts a Webex bot on Azure and uses an instance of GPT in Azure OpenAI Studio.
The repository includes detailed instructions on setting up the bot, configuring the GPT instance in Azure, and deploying the entire application as an Azure Web App. This way, you can harness the power of GPT in your Webex bot with minimal hassle.

The combination of GPT and Webex opens up exciting possibilities in the realm of AI chatbots. With the authentication already handled by Webex and the conversational capabilities of GPT, you can create an AI assistant that is both smart and secure. Check out the GitHub project to get started on creating your own GPT-powered Webex bot today!

Remember, the journey of exploration and innovation is ongoing. Who knows what exciting applications you might find for your new GPT-powered bot?
Websockets
Tags: javascript, networking, distributedsystems, node
Published: 2023-05-24 20:08:24

O **websocket** é um protocolo que possibilita a comunicação bidirecional entre um navegador web e o servidor. Ele permite a criação de um túnel para transformar, de forma contínua, informações entre um navegador e um servidor de uma aplicação. Ele faz parte das especificações do HTML5 e é suportado pelas últimas versões dos navegadores. 

Para entender melhor esse protocolo, vamos compara-lo ao modelo HTTP que é o protocolo que utilizamos no dia-a-dia para acessarmos um site. Ou seja, quando abrimos o site no navegador uma conexão é criada e em seguida é realizada uma requisição para o servidor do site que você está acessando. Ao recebe-la, o servidor fará os devidos processos internos para então retornar/devolver uma resposta dessa requisição. Assim que essa resposta é bem recebida (HTTP `GET` status `200` = `OK`), essa conexão será finalizada, ou seja, seu browser não enviará mais informações para seu servidor e nem ele para seu navegador.

Caso, se deve pedir mais informação para esse servidor, mais uma conexão deverá ser criada, então, o mesmo processo se repetirá.

<img src="https://upload.wikimedia.org/wikipedia/commons/e/e4/Comunica%C3%A7%C3%A3o_s%C3%ADncrona_e_ass%C3%ADncrona_em_sistemas_web.png" height="377" align="right">

Como cada requisição dessas possui um atraso nesse modelo client-servidor, isso acaba sendo um grande problema para aplicações web que precisam requisitar ao servidor informações de forma contínua (tempo real de requisição e resposta), como por exemplo, podemos citar aplicações como: um chat, um jogo online, gps e etc.

Mesmo após receber as informações do servidor o navegador pode realizar novas requisições sem precisar recarregar a página utilizando o **AJAX - Asynchronous Javascript and XML**, no qual faz uma chamada assíncrona feita com JavaScript.

No entanto, mesmo realizando uma chamada assíncrona, por baixo dos panos, será utilizado o protocolo HTTP. Ou seja, uma nova conexão será realizada junto com uma nova requisição, sendo assim, cairemos no mesmo problema de performance.

Portanto, o websocket veio para resolver esse problema de comunicação. Uma vez utilizando ele a conexão criada entre navegador e servidor é contínua. E por isso a velocidade com que essas informações irão trafegar é muito superior ao do protocolo HTTP. Não sendo mais necessário a criação de uma nova conexão.