teleren/devto huggingface dataset:
Intro to Blockchain: Gas Fees
Published: 2021-09-23 04:13:26

Gas fees. What are they? 
To fully understand gas fees, I think its important to have a little more knowledge about how the blockchain works. Since the blockchain is a bunch of decentralized nodes, those nodes all require some sort of money and incentives to keep working. We call these nodes, miners. People who have nodes set up to do the work and their sole purpose is to get paid by transactions happening on the block chain. 
Well whos paying them? Everytime a transaction happens on the blockchain, the person signing off on the transaction actually agrees to pay a certain gas fee. And depending on how many transactions are happening on the blockchain at the given time, the gas fee will vary. It can vary so much that at certain times, a simple action of minting a token can cost up to 1 Etherium just to complete the transaction.
Intro To Blockchain: MetaMask
Published: 2021-09-23 04:08:54

What is MetaMask? MetaMask is actually a company that is the leading provider for crypto wallets. What is a crypto wallet? A crypto wallet is an online storage where a user can keep all their crypto coins. With it being online and all, security is top priority number one. The way that MetaMask get's this done is by having not just an ordinary password, but also a secure set of private key words that is assigned to the user when they create their wallet. With this secret phrase, they can log onto their wallet. Without this phrase, no one can do anything. Literally no one, not even MetaMask themselves. That's the beauty about this, it is so secure that if you lose this secret phrase, you might as well just have lost all the money in your wallet, and as per usual, people in crypto, have alot to lose.
Getting rid of Next.js & styled-components Warning: Prop `className` did not match 
Tags: nextjs, styledcomponents, tutorial, javascript
Published: 2021-09-23 02:11:19

So, if you've been in touch with the Next.js + styled-components error: "Warning: Prop `className` did not match", at development stage, here's a how to solve that problem.

![Error Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9bp8tn9wn4vd697f7f5r.png)
 
This problem only occurs on development stage of Next.js enviroment basically because at the current version of Next.js (11.1.2), Next uses [Babel](https://babeljs.io/) under the hood. 

And because of that, we need to inform the compiler that we're using the styled-component library, in a way to keep the stylized layout rendered at refresh time. 

For our own lucky, there is an easy way to solve that. With that in mind, lets add the babel-styled-components plugin, as you can see below:

```bash 
$ yarn add babel-plugin-styled-components -D
```
or in case you're using npm:
```bash 
$ npm install --save-dev babel-plugin-styled-components
```
After that, at the root of our directory, lets create a `.babelrc` file, then insert the code below:

```javascript 
{
  "presets": ["next/babel"],
  "plugins": [["styled-components", { "ssr": true }]]
}
```
And that's it, just restart the development build of Next in a way to babel see and apply the latest config, then it should be working 100% error-free.
HELP!
Tags: sql, beginners, sqlite, python
Published: 2021-09-23 03:17:23

I am trying to work on a project which is available on Youtube. 
https://www.youtube.com/watch?v=8rO7ztF4NtU&t=254s&ab_channel=AlexTheAnalyst
But instead of using sqlserver i am doing it on sqlite3 and facing minor challenges.

This query is not working 
=============================

q7= """UPDATE a.[mytable]
SET PropertyAddress = IFNULL(a.PropertyAddress,b.PropertyAddress)
From mytable AS a
Join mytable AS b
ON a.ParcelID = b.ParcelID
AND a.[UniqueID ] <> b.[UniqueID ]
WHERE a.PropertyAddress IS NULL"""

df = pd.read_sql_query(q7,connection)
df

=======================================
Error: 
DatabaseError: Execution failed on sql 'UPDATE a
SET PropertyAddress = IFNULL(a.PropertyAddress,b.PropertyAddress)
From mytable AS a
Join mytable AS b
ON a.ParcelID = b.ParcelID
AND a.[UniqueID ] <> b.[UniqueID ]
WHERE a.PropertyAddress IS NULL': no such table: a
Python Conference Latam 2021 #PyConLatam 
Tags: pycon2021, pylatam, techtalks
Published: 2021-09-23 02:02:58

El pasado agosto, se realizó otra versión del **PyCon Latam** (virtual) donde la comunidad pythonera se hizo presente 🐍. Revisa la agenda completa aquí: https://www.pylatam.org/horario-completo/

El evento de 2 días, organizado en una plataforma muy fácil de acceder, con espacios de discusión (virtual), feria de los auspiciadores, y concursos por participación en las presentaciones y más!

Tuve el honor de compartir una presentación denominada: **"Python 🐍 para empezar a aprender Inteligencia Artificial 🤖"**

![()[https://twitter.com/FerroRodolfo/status/1431705921680379906]](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/35y9vzhc1aiz8623no8q.png)
[Ale's Unpopular Opinions - Issue #1] Big Tech battles over ICE contracts & more
Tags: news
Published: 2021-09-23 01:57:27

> **Issue #1 -** _Big Tech battles over ICE contracts & more_

> **Ale's Unpopular Opinions, a newsletter:** _A Latina's 🇲🇽 bold take on the tech industry and world events. Get ready for a newsletter with some unpopular opinions._

---

### Salary negotiations for Women in Tech
This past week, I talked about [salary negotiations for women in tech](https://twitter.com/QuetzalliAle/status/1439963591424180231) and shared personal examples of specific $$$ amounts I’ve negotiated before.

Read the twitter thread 🧵 to get more ideas on how to ask boldly for the salary you deserve.

{% twitter 1439963591424180231 %}

### Big Tech battles over ICE contracts
Per usual, all the Big Tech companies are kissing up to ICE, in search of yet another government contract. 

Google, Microsoft, Amazon, IBM, etc are clamoring to get a massive [$300m contract to help ICE deport immigrants](https://www.businessinsider.com/amazon-google-microsoft-ice-raven-data-mining-tool-undocumented-workers-2021-8). If you work at any of these corporations, it would be **pretty badass** if you took a stand and demanded your employer not apply for this contract. Talk to your teammates and lateral teams; find out how you can start an internal group or email list for discussing how to take action internally for these issues.

{% twitter 1433101127768162307 %}

### Afghan Women continue to need our support
Since Biden ended the US exit in late August, the Taliban continues striving to return to their previous brutal regime. Women are especially vulnerable. 

You can help this ongoing humanitarian crisis by donating to [Women for Afghan Women](https://womenforafghanwomen.org/).

{% twitter 1438106610858172422 %}

### 🚨 DevRel Job Alert
[Superconductive](https://www.superconductive.com/) reached to me about [hiring a Developer Advocate](https://jobs.superconductive.com/o/developer-advocate) 🥑 , so sharing it with you all cause I’m not on the job market right now. 

DM me for intro.

--- 

Thanks for reading and don’t forget to take action! We all get the opportunity to make a change if we only care enough to take a stand. 🙂
Dice Roller
Tags: python, programming, computerscience, simulation
Published: 2021-09-23 01:07:56

![Console Output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e4qn70ugjccqt5vq0h1x.png)
```python
# dice_roller.py
#   This program simulates dice rolls using dice roll notation,
#   it is widely used in tabletop RPGs like D&D, Pathfinder etc.
# by: Scott Gordon

import random
import sys

print('***** Welcome to Dice Roller *****')
print('''Enter what kind and how many dice to roll. For example:
            3d20, will roll 3 20 sided dice.
            2d8+1, rolls 2 8 sided dice +1 modifier
            Type QUIT to leave Dice Roller.''')

while True:
    try:
        dice_str = input('> ')
        if dice_str.upper() == 'QUIT':
            print('Thanks for playing!')
            sys.exit()

        dice_str = dice_str.lower().replace(' ', '')

        d_index = dice_str.find('d')
        if d_index == -1:
            raise Exception('Missing the "d" character.')

        number_of_dice = dice_str[:d_index]
        if not number_of_dice.isdecimal():
            raise Exception('Missing the number of dice.')
        number_of_dice = int(number_of_dice)

        mod_index = dice_str.find('+')
        if mod_index == -1:
            mod_index = dice_str.find('-')

        if mod_index == -1:
            number_of_sides = dice_str[d_index + 1:]
        else:
            number_of_sides = dice_str[d_index + 1: mod_index]
        if not number_of_sides.isdecimal():
            raise Exception('Missing the number of sides.')
        number_of_sides = int(number_of_sides)

        if mod_index == -1:
            mod_amount = 0
        else:
            mod_amount = int(dice_str[mod_index + 1:])
            if dice_str[mod_index] == '-':
                mod_amount = -mod_amount

        # Simulate dice rolls:
        rolls = []
        for i in range(number_of_dice):
            roll_result = random.randint(1, number_of_sides)
            rolls.append(roll_result)

        print('Total:', sum(rolls) + mod_amount, '(Each die:', end='')

        for i, roll in enumerate(rolls):
            rolls[i] = str(roll)
        print(', '.join(rolls), end='')

        if mod_amount != 0:
            mod_sign = dice_str[mod_index]
            print(f', {mod_sign}{abs(mod_amount)}', end='')
        print(')')

    except Exception as exc:
        print('Invalid input. Enter something like "3d6" or "1d10+2".')
        print(f'Input was invalide because: {str(exc)}')
        continue

```
Photo by <a href="https://unsplash.com/@_staticvoid?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Lucas Santos</a> on <a href="https://unsplash.com/s/photos/d20?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Getting to know about Github
Tags: github, opensourse, issue, testing
Published: 2021-09-23 00:35:42

Throughout this week, I feel like I am learning what GitHub can do and how to use it properly. I know the part that I have learned is like a tip of an iceberg, but it is a start.

This week, I tested my friend's code and gave her feedback. I have known her quite a while. I know she is really good at programming and enjoys coding.  I knew she already had a partner, but since my professor said okay to review someone who has a partner, I asked her, and she said okay. 

When I tested her code and reviewed it, I realized that it was readme was more critical than I thought. I needed it for testing her code and knowing what features she had since we had choices for the optional features. 
One of my findings in her project was also about the readme file. It might look like a tiny mistake but, one missing space didn't let me run her entire project. 

The biggest thing I learned this week was how to use feathers and the usefulness of the functions in the Github. Even though it had been more than a year since I encountered the Github, I didn't really understand much about it. I also came to realize how important readme files are when I meet other people's codes.

what I reviewed:
https://github.com/suhhee1011/suhheeKim_OSD_release0.1_create_ssg/issues/17
{emayili} Styling Figures
Published: 2021-09-25 11:09:18

---
title: {emayili} Styling Figures
published: true
date: 2021-09-23 00:00:00 UTC
tags: 
canonical_url: https://datawookie.dev/blog/2021/09/emayili-styling-figures/
---

![{emayili} Styling Figures](https://datawookie.dev/blog/2021/09/emayili-styling-figures/featured.jpg)

By default `<img>` tags are wrapped in a tight `<p></p>` embrace by `{knitr}`. In general this works really well. However, I want to have more control over image formatting for `{emayili}`.

## Adding a Hook

I’d like to have the `<img>` tags wrapped by `<figure></figure>`. It’d also be useful to have the option of inserting a `<figcaption>`. To support these requirements I added a `{knitr}` hook which adds in these tags. It responds to the following chunk parameters (all optional):

- `out.width` — the figure width
- `fig.cap` — figure caption
- `fig.alt` — figure alternative text and
- `fig.class` — class attached to the `<figure>` tag.

## Example

First we’ll try out the figure caption with the following `.Rmd` file.

```
---
output: html_document
---

```{r fig.cap="Mercury Vapour"}
plot(pressure)
```
```

Rendering this file, attaching to an `envelope` object and sending it with `{emayili}` yields the message below.

![](https://datawookie.dev/blog/2021/09/emayili-styling-figures/msg-caption.png)

Nothing too exciting, just a caption neatly displayed below the plot.

Next let’s try attaching a class to the `<figure>` tag. We’ll use the CSS file `figures.css`. This file needs to be specified with the `css_files` argument to `render()`.

```
body {
  margin: 30px 0px;
}

figure {
  margin-bottom: 20px;
}

figure.center {
  text-align: center;
}

figcaption {
  color: white;
  text-align: left;
  background-color: #9fa4a7;
  padding: 10px 20px;
}

figcaption::before {
  content: "Figure: ";
}
```

In the `.Rmd` file we use the `fig.class` parameter to apply the `center` class to the `<figure>`.

```
---
output: html_document
---

```{r out.width="75%", fig.class="center"}
plot(pressure)
```
```

And this is what the rendered message looks like.

![](https://datawookie.dev/blog/2021/09/emayili-styling-figures/msg-class.png)

The `<img>` is now centered in the `<figure>`.

Finally we’ll bring it all together by styling a figure caption.

```
---
output: html_document
---

```{r out.width="75%", fig.class="center", fig.cap="Mercury Vapour"}
plot(pressure)
```
```

And the result in your inbox.

![](https://datawookie.dev/blog/2021/09/emayili-styling-figures/msg-caption-class.png)

Since many automated reports use figures, the ability to style those figures should be very useful.

* * *

![](https://raw.githubusercontent.com/datawookie/emayili/master/man/figures/emayili-hex.png) ![](https://fathomdata.dev/media/logo.svg)

<center>
The <code>{emayili}</code> package is developed &amp; supported by <a href="https://www.fathomdata.dev">Fathom Data</a>.
</center>
Day 457 : Today
Tags: hiphop, code, coding, lifelongdev
Published: 2021-09-22 23:59:11

_liner notes_:
- Professional : Whew, what a day! Today was the final day of the hackathon. I finished up the project and created the presentation. Got to sit in and watch the demos from the first session for the EU/UK participants. A lot of really cool projects were created. I was taking some online trainings while waiting for the US demos to start. I got a notification about a Twitter Space that was happening. This one was about DevRel and since that is basically what I do, I went to check it out. I even spoke about my experiences a little bit. It was fun. Then it was time for the final demo session for the hackathon. More really good projects. It's pretty amazing what people can get done in like two days. Did my presentation and the demo worked and even had other people join. Pretty good day.

- Personal : Last night, I just basically worked on making sure the hackathon project was at a point where it was working and any fine tuning I could do in the morning. Of course, while I'm working on the hackathon project, a friend hits me up about a quick side project I made for us. Apparently, Safari is picky about how Dates are formatted. It was throwing all sorts of errors. So I work on that as well. Got it working and also fixed some CSS stuff that was bugging me from before. A whole lot of coding happened last night.

![View from atop a mountain looking into a cloud filled crater in Haleakala Crater, HI, USA at sunset](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/150i94q3fnk01k1h3twq.jpg)

Running low on some supplies so I may place an order. I want to go through some tracks for the radio show. It's already the middle of the week! Going to watch an episode of Boruto. I may start trying out some layout ideas for my new side project. It's getting late because of the demo and I've got stuff to do.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube hZx4vSsytfQ %}
The God 🦸
Tags: beginners, architecture, antipatterns
Published: 2021-09-22 22:47:48

## Todo el core está en este archivo. 🙅

La Clase/Script/Función maestra. Lo hace todo. Levanta los sistemas; echa a andar los servicios; intercomunica los procesos; lanza, captura y gestiona los logs; da comer a los pobres y tiene terraza incluida.

- Nadie sabe a ciencia cierta que hace
- Es interdependiente
- Está desorganizado
- No está documentado

Ese tipo de sistemas ha sido desarrollado de una forma irresponsablemente "pragmática".
No querrás toparte con este sistema que lo hace todo y, peor aún, no querrás ser quien inicio con este sistema en cima pensó que estaba bien.

No te rompas mucho la cabeza si no sabes como empezar un proyecto, allá afuera hay muchas arquitecturas probadas, que escalan excelente, son sencillas de mantener y/o migrar. Entre mis favoritas DDD, TDD y arquitectura hexagonal.

No tienes que reinventar la rueda, solo sentarte a estudiar un poco de arquitectura de software. Quien sabe y el trabajo de tus sueños esta al otro lado, del mismo lado de designs patterns & clean architecture.
JS Coding Question #9: Get Max Character In A String [Challenging]
Tags: challenge, javascript, tutorial, career
Published: 2021-09-22 22:20:04

#### Interview Question #9:
Write a function that will return the max character in a string.🤔 You may get variation to the question as well like `Write a function that will return that most commonly used character in a sentence` or similar.

#### Additional Rules:
1. Treat lowercase and uppercase the same
2. Only count alphabetic characters, no symbols and numbers
3. Return one max character in case of multiple max characters

> If you need practice, try to solve this on your own without looking at the solution below.

Feel free to bookmark 🔖 even if you don't need this for now. You may need to refresh/review down the road when it is time for you to look for a new role.

#### Codepen: 
If you want to play around and experiment with the code: https://codepen.io/angelo_jin/pen/abwYGPo

Solution below will cycle on every string and create a map. Once the map is created, cycle on the map and use the variables created to see if the current char has greater count. Assign char and max count accordingly.
```js 
// Helper function to remove non alphabetic characters and transform string to lowercase
function normalizeString(str) {
  return str
    .replace(/[^\w]/g, '')
    .toLowerCase()
}

function getMaxChar(str) {
  const charMap = {}
  let max = 0
  let maxChar = ''

  for (let char of normalizeString(str)) {
    if (charMap[char]) {
      charMap[char]++
    } else {
      charMap[char] = 1
    }
  }

  for (let char in charMap) {
    if (charMap[char] > max) {
      max = charMap[char]
      maxChar = char
    }
  }

  return maxChar
}
```

Happy coding and good luck if you are interviewing!

If you want to support me - [Buy Me A Coffee](https://www.buymeacoffee.com/letscode77)


Video below if you prefer instead of bunch of text/code 👍😊
{% youtube ZexSjfDnbUE %}
Arrays(Lists) in python
Tags: python, arrays
Published: 2021-09-18 09:17:26

<p>Python does not have a built in array type, but you can use lists for all of the same tasks. An array is a collection of values of the same type saved under the same name.</p>

<p>Each value in the array is called an “element” and indexing that represents its position. You can access specific elements by calling the array name with the desired element’s index. You can also get the length of an array using the len() method.</p>

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h0aljxc3wvh76k62ue0p.png)


<p>Unlike programming languages like Java that have static arrays after declaration, Python’s arrays automatically scale up or down when elements are added/subtracted.</p>

<p>For example, we could use the append() method to add an additional element on the end of an existing array instead of declaring a new array.</p>

#Arrays(List)
```python
1.cars = ["Toyota", "Tesla", "Hyundai"]
2.print(len(cars))
3.cars.append("Honda")
4.cars.pop(1)
5.for x in cars:
6.  print(x)
```
#Output
```
3
Toyota
Hyundai
Honda
```
I made my first open source project
Tags: svelte, electron, opensource, project
Published: 2021-09-22 21:37:21

<p align="center">
  <h1 align="center"><a href="https://github.com/Rhyme-Player/Rhyme/">Rhyme</a></h1>
  <p align="center">The Home of your Music</p>
  <img align="center" src="https://user-images.githubusercontent.com/77546233/133614526-452649b3-fb72-4347-9ee4-73ef8c6eea3f.png" />

</p>

<br />

## :hear_no_evil: What is `Rhyme` ?

[Rhyme](rhyme.netlify.app) is a music player which allows the user to play their music with a simple and good looking user interface,
rhyme can play multiple type of files like `.mp3`, `.m4a`, `.webm`, `.flac`, `.wav`, `.aac`, `.ogg` and `.opus`.
A theme manager has been implemented so that you can customize the colors of the app the way you want the theme store, theme maker, and the way to change themes is still not implemented

<br />

## :bulb: Want a feature or idea to be added ?

Open an issue here at github giving details of the request. if the feature seems appropriate and legal we will implement.

<br />

## :package: Install

For instructions to install rhyme click on your os
[Windows](https://github.com/Rhyme-Player/Rhyme/wiki/Windows),
[Mac](https://github.com/Rhyme-Player/Rhyme/wiki/Mac),
[Linux](https://github.com/Rhyme-Player/Rhyme/wiki/Linux)

For instructions to compile or contribute to the app click [here](https://github.com/Rhyme-Player/Rhyme/wiki/Compile-or-Contribute)

<br />

## :thinking: Questions

If you want to ask any questions about the project, join us on our public Matrix channel at [#rhymes-player:matrix.org](https://matrix.to/#/#rhymes-player:matrix.org)

If you are trying out Rhyme and you encounter an error or any problem feel free to just open an issue here on GitHub.

<br />

## :clap: Supporters

[![Stargazers repo roster for @Rhyme-Player/Rhyme](https://reporoster.com/stars/Rhyme-Player/Rhyme?v=2)](https://github.com/Rhyme-Player/Rhyme/stargazers)

[![Forkers repo roster for @Rhyme-Player/Rhyme](https://reporoster.com/forks/Rhyme-Player/Rhyme)](https://github.com/Rhyme-Player/Rhyme/network/members)