teleren/devto huggingface dataset:
Looking to start a team for an idea I have regarding the music/NFT space.
Tags: webdev, opensource, startup
Published: 2021-11-22 23:54:20

I have this great idea that can potentially change the lives of many. I just need a team to start putting it into works. I want to build a strong, long lasting community that’s honest, transparent and puts the supporter first. Looking for a developer and graphic designer. Can anyone point me in the right direction of where to find them? or if you’re interested just message me.
WTH is a ConfigurationBuilder?
Tags: oop, programming, webdev, codenewbie
Published: 2021-11-22 23:54:02

OOP is hard. In my case, it's hard because it's a totally new way of thinking, everything is interconnected, and everyone assumes you know the basics.

I don't.

### Know the basics.

Over 6 months into my SWE career, I still find myself scratching my head at common OOPisms. Sometimes it's just a matter of getting unstuck enough to make progress with my stated goal. But often, I find myself tempted to unravel and unravel until I get to the root of my question.

This is an even more pronounced issue when we're talking about company code. Not only do I need to understand the general OOPisms, but also how they do or (more often than not) don't work with the way we write code. 

We have many internal libraries that weave in and out of the general workings of OOP and .Net. Some of these libraries are fundamental to any tool that we build. So much so that a basic concept inevitably becomes more complex because to understand what the library does means taking the time to understand why the library exists. But going down that rabbit hole often leads back to the start of this madness. 

It's like looking up the definition of communication only to find "the act of communicating". While true, that definition is useless to someone who doesn't know either word, aka me. It's useless to me.

### What spurred this rant? 

you're probably wondering. Get to the point already.

It all started with auth. But also logging. Dependency injection. And just getting and app started at the most basic level.

I ended last week working on some basic auth for a dummy app to test something pointless. No expectations.

I started the most recent library to implement one requirement--logging. It's a dummy app, with no external classes or anything else. Easy peasy. ..?

![Uhh...](https://media3.giphy.com/media/5t9wJjyHAOxvnxcPNk/giphy.gif?cid=ecf05e47kizrpkop33s2g95c92lpb6u48j3kxvoqwcm47ib9&rid=giphy.gif&ct=g)

But 2 hours later, I'm asking myself, <em>**what the heck is a ConfigurationBuilder?**</em> 

Why are ConfigurationBuilders everywhere? And why are there a million flavors to them? Which flavor applies to this situation? When do I need a new ConfigurationBuilder vs ConfigurationManager or a LoggerConfiguration or CreateDefaultBuilder()? What items will require some configuration builder? 

I've passed by this question several times before this point. But now I need to dive deep. My question list is getting to be unmanageable. 

### Sorry to disappoint..

If you clicked on this post with the same question, I have nothing else to offer but that I see you and I feel your pain. 

This was mostly a rant. But I'm also hoping someone might have a **simple** response. Most resources (MS docs, YouTube, Stack Overflow) jump into using one flavor or another without explaining the basic premise-- What is a ConfigurationBuilder?

Photo by JÉSHOOTS
JSON2OBJ
Tags: python, programming, json, oop
Published: 2021-11-22 23:45:15


## json2obj

 Allows you to transform JSON data into an object whose members can be queried using the member access operator. Unlike `json.dumps` in the standard library that returns a dictionary object, this library returns a JSONObjectMapper object. The attributes of these objects are defined by the contents of the JSON data provided to it

## Installation 

It can be installed using pip 
`pip install json2obj`
Source code available at 
https://github.com/trumpowen/json2obj

## Examples 

```python 

import datetime
from json2obj import JSONObjectMapper 

person = JSONObjectMapper("""{ "name" : "trumpowen" , "age" : 125 }""") 
person.name == "trumpowen" # true
person.age == 125 # true 
# replaces and overwrites 
person.name = {} 
person.name.first_name = "Wilkins" 
person.name.last_name = "Owen" 
person.name.other_names = ["Trump"]

# add new attribute. If this is not desired, you can initialize the object with readonly set to True. This will prevent the addition of new attributes and changing the values of existing attributes 
person.dob = datetime(1900, 12, 6) 
json_data = str(person) # returns a string representation 
json_as_dict = person.to_dict() # returns a dictionary representation 
```

## Documentation 
Use `help(obj)` , where obj is an instance of JSONObjectMapper
CSS Media Queries
Published: 2021-11-22 23:42:20

Media queries are extremely useful for responsive web design. Not everyone is using a desktop all the time, most of us are probably using our phones most of the time for the things we’re doing online. [Using media queries is a popular technique for delivering a tailored style sheet to desktops, laptops, tablets, and mobile phones (such as iPhone and Android phones).](https://www.w3schools.com/css/css3_mediaqueries.asp) Media queries allow us make changes to our CSS according to device sizing. And if you’ve ever been on a site on your phone and had to endlessly scroll just to see the landing page info, you know how frustrating that is. 

To get started we use the @media rule-which is used to target a specified media type. The syntax looks like this: 

```
@media (condition) {
  // CSS that we want to happen when the condition is met
}
```

For example if we want the font size to change and become smaller when someone is using a mobile device instead of a desktop, we would use a media query that looks like this: 

```
p {
  font-size: 25px;
}

@media (max-width: 375px) {
  p {
    font-size: 18px;
  }
}
```

This means that once the breakpoint is reached the custom rules you’ve defined go into effect. While there are so many devices of varying sizes out there, there are commonly used [breakpoints.](https://www.freecodecamp.org/news/css-media-queries-breakpoints-media-types-standard-resolutions-and-more/)

• 320px — 480px: Mobile devices
• 481px — 768px: iPads, Tablets
• 769px — 1024px: Small screens, laptops
• 1025px — 1200px: Desktops, large screens
• 1201px and more —  Extra large screens, TV

You can also include the type of media in the condition (likely you’ll be using screen), there are [four categories:](https://www.freecodecamp.org/news/css-media-queries-breakpoints-media-types-standard-resolutions-and-more/)
	
• all — for all media types
• print — for printers
• screen — for computer screens, tablets and, smart-phones
• speech — for screen readers that “read” the page out loud

Putting all these pieces together, a finalized media query for a tablet would look like this: 

```
.opening-paragraph {
  font-size: 25px;
}

@media screen and (max-width: 768px) {
  .opening-paragraph {
    font-size: 20px;
  }
}
```

You can make specific CSS rules for pretty much anything-we can adjust the margins, padding, font size, colors, etc. They’re pretty powerful. I hope this helps a little. In the past I’ve typically used a library or framework like Bootstrap that pretty handles the responsiveness for you but if you’re using plain old CSS media queries will be your best friend. Thanks for reading!
Day 483 : Nod Off
Tags: hiphop, code, coding, lifelongdev
Published: 2021-11-22 23:05:03

_liner notes_:
- Saturday : So, this day was the first day we were back at the radio station since it closed due to Covid almost 2 years ago. Felt good to be back in the station, but we weren't able to do the show on air. Apparently there was a last minute change in the basketball schedule and they decided to broadcast that instead. Awesome. Did the show anyway and had a good time. The recording of this week's show is at https://kNOwBETTERHIPHOP.com

![Radio show episode image of a photo of a neon sign of the WPRK logo with the words Nov 20th 2021 Kinda](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nccekfw6e505ddqb0sa5.jpg)

- Sunday : So I slept in the van by the station after the radio show and got up early and headed back to my spot. Got there just in time to do the https://untilit.works cyphers. Got the post radio show promo work done AND created a proof of concept for a new side project I decided to make. I did it in Glitch and had to update a template I had so that was interesting. haha Learned alot. After the cyphers, I watched "Fear The Walking Dead" and "The Walking Dead: World Beyond" and fell asleep

- Professional : Got some pretty big news about the company. So there were quite a few meetings about it. Kind of interested in seeing where it goes. Showed a coworker the proof of concept I made the day before. They actually used it to help them find some stuff, so I decided to register a domain name and think about some other features I could add. Other than that, I went to get my vaccine shot and that took a lot longer than I thought and when I finally got back home, I started to kind of feel the effects coming on.

- Personal : So as I was driving back to my spot, one of the storage shelves I put up, fell down. I think something wasn't really screwed in properly so all the vibration kind of shook it loose. Luckily nothing was in it to break. Only a couple of corner brackets broke, so I'll have to replace them and maybe strengthen the joints. I also didn't double up on a cross bar so that allow the shelf to rotate. At least now I know that it could happen and have solutions on how to fix it.

![View from a field in High Tatras Mountains, Slovakia under blue skies with some feathery clouds and the silhouette of a mountain range with the sun behind it in the distance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/usaa02bwqa6modiaiobk.jpg)

Going to take it easy and hopefully the vaccine shot doesn't kick my butt. haha I may just do a little coding on the new side project and watch Cowboy Bebop. I've only seen one episode and like it so far. So yeah, probably do that till I nod off.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube 7ogtW3nz-x8 %}
Desktop Spell Check
Tags: javascript
Published: 2021-11-22 22:58:57

Hi, 
I use a tool called MediaMonkey to manage my music collection. It is a desktop application that offers a Javascript API. I am looking for a self-contained spell checker where I can pass it a string or the text field, it spell checks and either returns the updated text back or updates the text field. I looked at JavaScriptSpellCheck, but it doesn't work in a File type environment. Any other suggestions? Oh, the app doesn't allow interfacing with ActiveX objects so using MS Word is out.
Day 17 of #100daysofcode: Some Bumps in the Road
Tags: 100daysofcode, react, python, beginners
Published: 2021-11-22 22:11:53

I ran into some life circumstances in the past 48 hours that is going to eat up a few days of valuable work time. I will do my best to keep up with updates, but I will be stretched thin this next week as finals draw near.

## Today
* Worked on some Leetcode problems
* Learned about React routing
* Looked through some cursory information about Vue (expect more discussion on this in the future)
* Looked through the Flutter web dev tutorial
  * I don't think I will be pursuing Flutter for this project, however I may revisit Flutter later in this #100daysofcode challenge


## Upcoming
* Finals and final projects
* Iron out details regarding the Study Aid app (I really need to name this thing)
  * Flask vs Django
  * Should I change how I deploy? Should Docker get in the picture?
  * Are there any other systems I should think about using as a part of this project?
* Learn more about Material UI, I will probably use Material UI a little bit in my (ongoing) school project. 
* Start the Study Aid app!


### Resources
[JS Course - FreeCodeCamp](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/)
[Material UI](https://mui.com)
[First Flutter app on the web](https://docs.flutter.dev/get-started/codelab-web)
Prometheus and Grafana, Part 2
Tags: monitoring, linux
Published: 2021-11-22 20:13:46

The Prometheus.yml:
```
# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.

scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
      - targets: ['localhost:9090']

  - job_name: 'node-exporter'

    # Override the global default and scrape targets from this job every 5 seconds.
    scrape_interval: 5s
    metrics_path: /metrics

    static_configs:
      - targets:
        - <PUBLIC IP>:9100
```
This is a good starting place for a monitoring system for Linux boxes

Running the services in docker is also advised as it simplifies the rollout.

Docker node exporter:
```
sudo docker run --restart always -d --net="host" --pid="host"  -v "/:/host:ro,rslave"  prom/node-exporter:latest  --path.rootfs=/host
```

Docker prometheus:
```
sudo docker service create --replicas 1 --name dockerprometheus     --mount type=bind,source=/home/ubuntu/prometheus/prometheus.yml,destination=/etc/prometheus/prometheus.yml     --publish published=9090,target=9090,protocol=tcp     prom/prometheus
```


When you get around to making panels in Grafana, these queries are very useful:

```
100 - ((node_filesystem_avail_bytes{mountpoint="/",fstype!="rootfs"} * 100) /            node_filesystem_size_bytes{mountpoint="/",fstype!="rootfs"})
```


```
node_filesystem_avail_bytes

```

OR you could just setup a template for Node Exporter:
To import a new dashboard for Node Exporter, go to Dashboards -> Manage
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oije3p8c31dk0q4e9l1r.png)

Enter **405** for the Grafana ID.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mznb1185qy8e232p8a2o.png)

Pick up the name and choose a Data Source for the dashboard.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/83rpzsyv4arll5w16mz8.png)

To make an alert, start a NEW dashboard and NEW panel. Template dashboards like above will not work. 

Enter the query for the item you want to track and press the Alert tab.
That should do it for a basic monitoring service.
How to modify a string in Python
Tags: programming, python
Published: 2021-11-22 22:07:32

You cannot!

Strings in Python are immutable (something that cannot be changed)

## Why are Python strings immutable?
Read [here](https://docs.python.org/3/faq/design.html#why-are-python-strings-immutable) 

## What can you do? 
You can create a new modified string. 

## Examples
### Convert all characters to upper case 
``` python 
original = "My String" 
new_string = original.upper() 
print(new_string)  # "MY STRING"
```

### Change one character
Since you can't really change the string, the solution is to convert it a mutable type like `list` and modify that. 

``` python 
original = "My String" 
original_list = list(original)
original_list[0] = 'm' 
new_string = "".join(original_list)
print(new_string)  # 'my String' 
```

> You could also try slicing to speed up the process
Why is good naming so important?
Tags: cleancode, programming, beginners, tinyarticle
Published: 2021-11-22 21:52:24

I started to feel bad about torturing my fellow colleagues to have better function, variable and class names and also easy to understand error messages.

> If you can think of **good names** for every piece of your code I believe that you also understand the **domain** of the problem, that you can deconstruct a problem to a logical set of low-noise actions.

I will also think that you will be able to explain what you are working on or struggling with to your colleagues - which is also super important in a workspace.

So by spending time on naming your variables, functions and classes you also have to think on a _higher level_, mapping out what you are really doing by verbalising it. And that is a great detector of uncertainty and half-baked ideas.

Therefore it is a good practice to stop time-to-time before you create a pull request to look what you already have and find the most descriptive names possible. When you learn more about a programming language you will be able to use more syntactic solutions to increase the readability of your code.

### Examples
#### Super generic name
```javascript
import { hosts } from 'config';

export function serverhost() {
  return hosts[1];
}
```

Is it an action to host a server? A variable that return a `hostName` of a server? Is the returned value `host` an object maybe which has IP address as well? Why do you return only the second one?

#### Does way too many things
```javascript
import { server } from 'my-fav-server-lib';

export function getHostNameAndLogErrorAndSetItAsWellIfItIsNotDefinedAlsoStartServer() {
  const hosts = server.getHosts();
 
  if (hosts.length === 0) {
    hosts[0] = server.start().getDefaultHostName();

    console.error('Hosts was empty! Starting a new server instance.');
  }

  return hosts[0];
}
```

Why are we starting a server in a getter? Why are we getting its host name?

### Summary
Exercise your mind by naming things well and do not be afraid to split and reorganize code if you struggle to find a good name. I do it very often: _"Oh, now that I know what I want from this code let's split this function up!"_. After you did your best it is time for your colleagues during a **pull request** to help you finding the words that work for all of you! 😊
O método para ir mais longe
Tags: productivity, webdev, programming, computerscience
Published: 2021-11-22 21:29:44

Diariamente o ser humano vem procurando e criando meios para acelerar a evolução, e aqui eu vou passar um pouco de 3 pilares que eu tenho utilizado evoluir cada vez no meu desenvolvimento pessoal e profissional.

## Foco

A falta de foco e uma das piores pedras no caminho dos devs quando se trata de evolução, o grande leque de tecnologias que surgem diariamente faz com que muitos devs(principalmente os iniciantes) não tenham um foco especifico em uma stack e isso acaba atrapalhando a evolução de muita gente.

Não se trata qual e a melhor tecnologia, se trata de qual tecnologia você e melhor desenvolvendo.

Mantenha sua atenção no que você esta estudando no momento.

ouvir uma frase uma vez que falava que longevidade > intensidade
manter a regularidade nos estudos e fundamental, e muito melhor estudar todo dia um pouco que estudar muito uma vez por semana

## Pratica 

E para você evoluir com tecnologia que você escolheu não basta só ter foco se você não exercita, e necessário MUITA PRATICA, e a pratica que acelera o seu desenvolvimento.

Programação e uma disciplina pratica, e ela que vai te da toda bagagem e experiência para vencer os desafios que você enfrenta no seu dia a dia e te transforma e um profissional muito mais capacitado no mercado.

A teoria só funciona quando você sabe quando e onde aplicar.

A sensação de esta apenas copiando código e super normal para quem ta começando, mas a repetição se transforma em repertorio e todo o código começa a fazer sentido

## Grupo

Ter pessoas ao seu lado, vivendo o mesmo contexto que você e o melhor combustível que um dev pode receber, o aprendizado compartilhado e a troca de experiências faz a sua evolução se tornar mais leve e divertida.

Quem nunca teve um bug que não resolvia a dias e um amigo ajudou a resolver. Esta ao lado de devs mais experientes faz com que você esteja sempre atualizado com as melhores praticas e tecnologias do mercado

Conhecimento quanto mais a gente divide, mais se multiplica!
Useful Docker Commands
Tags: docker, webdev, programming
Published: 2021-11-22 21:22:02

Today I learned some docker commands, let me share it with you:

##To stop all containers simply type:
```
docker kill $(docker ps -q)
```
``docker ps`` - list all running containers

flag ``-q`` - displays only ids of these containers

``docker kill`` - stops containers


##If you want to remove all containers use the command:

```
docker rm $(docker ps -a -q)
```

``docker rm`` - removes containers

flag ``-a`` - lists all containers not only running ones

The rest is similar to previous command


##To remove all docker images type:

```
docker rmi $(docker images -q)
```

``docker rmi`` - removes images

``docker images - q`` - lists ids of all images
For Keyoxide...
Published: 2021-11-22 21:16:29

This is an OpenPGP proof that connects [my OpenPGP key](https://keyoxide.org/A1E987C6A8AA5EA031411AAF70FEEBB21535B6FA) to [this dev.to account](https://dev.to/x448nax). For details check out https://keyoxide.org/guides/openpgp-proofs

[Verifying my OpenPGP key: openpgp4fpr:A1E987C6A8AA5EA031411AAF70FEEBB21535B6FA]
Legacy Code : Working With FeedBack
Tags: code, refactoring, testing
Published: 2021-11-22 20:59:29

Hello :) , Today We will Talk about Legacy Code and how to make changes inside it by having a source of feedback.

## What is a Legacy Code ?

> << Legacy Code is code without tests >> as simple as it is , the first time i read it it hits me. We all know enterprise with legacy code , sometimes we have participated to this legacy code base. ;)
Now we know that the problem is there is no tests , how do you make update or change in legacy code ?




## The Source of FeedBack 

> When making changes we do not want to break anything elsewhere , so M. Feathers said << we shoul have a source of feedback , and this source of feedback is tests >> this drop us to the _Legacy Code dilemna_  **When we change code, we should have tests in place. To put tests in place, we often have to change code.**




## Unit Testing
> Indeed some can ask why unit testing ? because It is a small world that tests a small unit of our system. Why Not Larger Tests ? Because the qualities of an unit test which are **Fast Running** and ** Fas Error Localization** are not the qualities of a larger test for example . And this is preciseley where an unit test is a source of feedback .Thanks to these two qualities we can make a change or an update in a legacy system without fear.




## The Legacy Code Change Algorithm

This one is from Michael Feathers in his book [Working Effectively with Legacy Code](https://www.amazon.fr/FEATHERS-WORK-EFFECT-LEG-CODE/dp/0131177052/ref=sr_1_1?__mk_fr_FR=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=9XII6SF8MC6M&keywords=working+effectively+with+legacy+code&qid=1637611580&qsid=260-1504361-7871542&sprefix=working+effec%2Cgift-cards%2C221&sr=8-1&sres=0131177052%2C5845915309%2C180056810X%2C1691064130%2C0132350882%2C0134494164%2CB01G8MS5E6%2CB00QS2HXUO%2C0135957052%2C0201633612%2C1838982973%2C1789539234%2CB01CRIZEF8%2C0134757599%2C032179320X&srpt=ABIS_BOOK ). Look what he says:
>The day-to-day goal in legacy code is to make changes, but not just any changes. We want to make functional changes that deliver value while bringing more of the system under test. At the end of each programming episode, we should be able to point not only to code that provides some new feature, but
also its tests. Over time, tested areas of the code base surface like islands rising out of the ocean. Work in these islands becomes much easier. Over time, the islands become large landmasses. Eventually, you’ll be able to work in continents of test-covered code.

beautiful isn't it ;).

Now the **Algorithm of change** :

1. _Identify Change Points_
2. _Identify Test Points_
3. _Breaking Dependencies_
4. _Write Tests_
5. _Makes Changes and Refactor_





### What i think about this algorithm ?
> In the next few weeks , thanks to JESUS i will share my advice about them. I am going to read more to give you a better understanding.


Thanks for Reading ;)