teleren/devto huggingface dataset:
A base vem forte... Ou pelo menos deveria.
Tags: ptbr, carreira, career, braziliandevs
Published: 2021-01-28 14:03:11

Olá Devs! 👩‍💻👨‍💻

Quando escrevi minha primeira linha de código em 1995, eu não tinha muitas opções disponíveis e tudo se resumia em: Console (Pascal, Clipper ou C/C++) ou Desktop (VB ou Delphi) e a obrigatoriedade de conhecer SQL ANSI. 

Esses eram os caminhos apresentados na escola técnica que eu cursava na época, qualquer coisa além disso não fazia muito sentido para um jovem aspirante, pelo menos era o que nós aprendíamos. Saber essas tecnologias era a "garantia" de um futuro promissor.

Lembro também que um dos meus professores falava que o principal era saber lógica de programação e algoritmos, só saber as tecnologias não era um bom caminho. Ele sempre reforçava: "Com uma *base forte* você consegue programar em qualquer linguagem.". 

Percebi que aquilo era uma grande verdade e investia meu tempo transcrevendo os algoritmos de pseudocódigo em código. Normalmente nas linguagens que eu comentei: Pascal, C++ e Clipper. Essa era minha forma de exercitar e colocar em prática. 

No mundo atual, com uma infinidade de possibilidades e com o mercado requisitando cada vez mais especialistas, vejo que uma boa parcela dos novos Devs focam muito nas tecnologias e esquecem do resto. Normalmente é assim: Escolho FrontEnd ou BackEnd e depois me especializo em alguma plataforma, framework ou lib. No geral é isso.

Aprender tecnologias é importante, isso é fato, mas tenha em mente que ter uma *base forte* vai te transformar em um profissional melhor. Se amanhã aquela tecnologia que você utiliza cair em desuso, com uma *base forte* você vai estar melhor preparado para as novas tecnologias que surgirem. 

Eu defendo até hoje o que aprendi lá nos anos 90, só que com o tempo, fui aprimorando meu conceito de *base forte* que hoje segue assim: 
👉 Lógica de programação
👉 [Algoritmos e estrutura de dados] (https://www.amazon.com.br/Estruturas-Dados-Algoritmos-Com-Javascript/dp/8575226932/ref=asc_df_8575226932/?tag=googleshopp00-20&linkCode=df0&hvadid=379765802639&hvpos=&hvnetw=g&hvrand=3793496396438121219&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=20102&hvtargid=pla-811121404201&psc=1)
👉 [Orientação a objetos] (https://pt.wikipedia.org/wiki/Orienta%C3%A7%C3%A3o_a_objetos)
👉 [SOLID Principles] (https://medium.com/backticks-tildes/the-s-o-l-i-d-principles-in-pictures-b34ce2f1e898)
👉 [Clean Code] (https://balta.io/artigos/clean-code)
👉 [Design patterns](https://refactoring.guru/pt-br/design-patterns)
👉 Linguagens de programação com Filosofias e Paradigmas diferentes

A lista aumentou, mas o objetivo continua sendo o mesmo. Isso vai facilitar o bom entendimento do que existe hoje e deixar você preparado para o futuro. Pode ser até que seja um diferencial em uma disputa de vaga.

"Quando as raízes são profundas, não há razão para temer o vento."
*Provérbio chinês*

Até a próxima!👊
Fame, it’s all about fame on Spotify
Published: 2021-01-28 13:59:48



How to make your life premium? Is it hard? Now, look at yourself. Young, creative, fearless creator with great ideas and huge ambitions. What are you lacking? What do you need? What’s stopping you from becoming worlds' sensation? If you read the biographies of nowadays popular musician, you will see many similarities with yourself. However, somehow, they managed to become popular. How? Well, the answer is simple - [Spotify premium promotions](https://promosoundgroup.net/collection/spotify-promotion). Maybe not only Spotify, but on all music streaming services. However, Spotify promotion is the most effective one. Because there are many strategies for becoming popular on Spotify, and you can be sure that bombarding Spotify with songs or focusing on a single one won’t cut it. No matter how confident you are in the quality of your music, you need to understand that it is too hard to succeed without additional help. So, get ready to find out all you need to know about music promotion and career on Spotify.
	Let’s start with a little introduction. Before starting your career on Spotify you need to understand, how huge it is. Spotify has well over 120 million active users and more than 60 million songs. And if there are so many songs - there are many musicians too. And each one of them wants to be the king. So you can’t waste even a minute of your time on waiting. You need the result as fast as possible, before anyone else outpaces you. You must act fast, and gain as many followers at the beginning as possible. Same goes for plays and likes. The faster you get them - the better. The whole result of your promotion depends on your start. If you do everything correctly, you will get to the user recommendations, popular playlists, etc. So now you understand, why you need promotion, right?
	Now, how does it work? As on any other music streaming service, the core idea of the music promotion stays the same - increase your stats. And on Spotify, premium promotion means organic promotion, with real followers, real plays, real share, etc. The promotion service has its own channels and instruments, such as blogs, clever ads, contracts with other musicians and much more. Followers and plays you gain from premium promotions will stay on your account forever. The process of promotion is fast and easy. You just click a few buttons, and there you are - you’re popular. So, it is time for you to decide - whether you want to become a star or you want to continue hoping and waiting. Remember, without a goal and actions you can’t score. Remember about it during your next release. And for real, try it one, because you’re losing a couple bucks. Your future costs much more, right?
Azure Serverless Apps in 10 minutes
Tags: azure
Published: 2021-01-28 13:59:16

Azure had made it easy to create serverless applications. They have named the serverless apps to "Functions" of which, there are two parts. First the Azure portal has an icon like this:


To create the function "host" in the cloud. In your Azure portal click on this icon.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/atewgp1vc5wk2nb80k98.gif)

From there click on Create...

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/589fj5vjd6zaathcyo7b.gif)

You will see this screen:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6kqe79vkxzhjbab2us12.gif)

The billing part of this is the subscription and the resource group. If you don't have a resource group you can click create new which merely asks for a name. 

**Runtime Stack**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/cghqcmqg7iostobwpkb0.gif)

Here we see a runtime stack selection of .NET Core; however, there are many other stacks such as node.js which may be used.


✔️ Good so far, this sets up our portal side, look at this part as the definition of the container for our functions that will be published.

**Create the Function**

Back to the code side. We will use Visual Studio to create the function being that it will be in C#. 

Open up Visual Studio and install or update ['Azure Functions'](https://marketplace.visualstudio.com/search?term=azure%20functions&target=VSCode&category=All%20categories&sortBy=Relevance) 

**Create a new project in Visual Studio**

Select the Azure Functions Template

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/oxw8z0gqoc2szi53nkjn.gif)

On the next screen "Configure your new project" set the name, location, solution, and solution name. Note: You may add this to another existing solution too.

Select HTTP trigger on next screen.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/n3k0qsl3oqqcjmrgbp6j.gif)

**The Function Code**

After clicking the 'Create' button shown above, the templated code will look like this:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5yblvzqykjpcpwbmjk0e.gif)

**Publish to Azure**

Click on the BUILD tab in Visual Studio and select the option shown below.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0g0fivrtmh9v7634vg7n.gif)

Select Azure

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/17s21sqbun5xbpb6ehfc.gif)

Choose the Function Instance (container in Azure)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1drgcypzmi97xwqnhvsj.gif)

✔️ Done

To access the endpoint the url pattern is: /yourdomian/api/FunctionName in the url. 

**Conclusion**
The term serverless is somewhat misleading because we had to tell it the server configuration, location etc.  The 'serverless' part is that is was easy to do that, and we are only interested in using the new endpoint. From that perspective it is serverless with respect to maintain the platform function run.  Perhaps the best part is that we can spin up a new function in 10 minutes.

JWP2021
Five Points to Note When Writing Regular Expressions in .Net
Tags: net, netcore, csharp, backend
Published: 2021-01-28 13:36:43

Regular expressions are powerful patterns written to check the adherence of input to expected requirements. For example, regular expressions provide a way to validate email addresses to ensure they meet the expected requirement of a name, an `@` sign and a domain.
Though powerful, regular expressions (regex), can cause performance bottlenecks and security breaches through denial of service (DOS), if not used correctly. What are some important points to consider when using regex in .Net?

1.	Input source: An input source can be reliable or unreliable. They usually contain data that:
 - Matches the pattern
 - Does not match the pattern
 - Nearly matches the pattern.  
Unreliable sources will contain more input that nearly matches or does not match a given pattern. 
Input that nearly matches the regex pattern, typically require more processing time. Depending on the input length, this time could be days, or even years.
2.	Always use a timeout: The regex engine in .Net uses an infinite timeout by default when matching. This is meant to be changed according to the developer’s need and the resulting timeout exception handled accordingly. Using a regex timeout secures an app from denial of service.
3.	Object instantiation: Use static pattern-matching method, such as `Regex.Match(String, String)` instead of instantiating the regex class `new Regex(pattern)` for methods that will be frequently called, as this, will probably use a cached, compiled version
4.	Assembly Compilation: When developing a regular expression library, you can significantly improve the startup time and execution time by compiling to a library. 
5.	 Testing: When testing, do not restrict input to only ones that match. Test input that nearly matches and observe the performance, especially in scenarios where the regex will handle unreliable input

Additional reading:
[Microsoft doc: Best practices for regular expressions in .NET](https://docs.microsoft.com/en-us/dotnet/standard/base-types/best-practices)

[Microsoft Doc: Backtracking in Regular Expressions](https://docs.microsoft.com/en-us/dotnet/standard/base-types/backtracking-in-regular-expressions)

There you have it. Thanks for reading. If you learned something new from this article, please like and share.

Did you spot a typo, an error or want to contribute? [Here's the repo on GitHub](https://github.com/samtimberlan/Blog-Posts/blob/master/Five%20points%20to%20note%20when%20using%20Regular%20Expressions.md)
Check the connectivity of PG database
Tags: rails, postgres, ruby
Published: 2021-01-28 13:35:02

![Check the connectivity of PG database](https://dev-to-uploads.s3.amazonaws.com/i/ah7m5eqt5pmfs7fe046v.jpg)

Basically, You want to know that the PG connection is still alive and ready for the queries used by your application.

You may have your application checked for the database connectivity via `/ping` for a health check.

Which Rails provide the built-in method for checking the status as follows;

```rb
> ActiveRecord::Base.connection.active?
> # true
```

If `true` means that the PG connection is still alive; otherwise, it was down.

Or maybe you will try something like this instead.

```rb
> ActiveRecord::Base.connection.execute('SELECT 1')
> # (0.5ms)  SELECT 1
> #<PG::Result:0x007f8e98bf3758 status=PGRES_TUPLES_OK ntuples=1 nfields=1 cmd_tuples=1>
```

The above sample works well, but I found that the query performance of `SELECT 1` is worse than the empty string `''`. It is raised on [Here](http://gitlab.com/gitlab-org/gitlab/-/issues/220055)

The solution is referred to [Use empty query instead of "SELECT 1"](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49730) That improves database throughput to reduce the usage of CPUs in the database due to health checks.

Luckily, Rails supports queries with the empty string as follows;

```rb
> ActiveRecord::Base.connection.execute('')
> (0.4ms)
> #<PG::Result:0x007f8ea485e8e8 status=PGRES_EMPTY_QUERY ntuples=0 nfields=0 cmd_tuples=0>
```
7 Reasons Why You Should Choose AWS as Your Cloud platform
Tags: cloudcomputing, devops, amazonwebservices, awsdeveloper
Published: 2021-03-08 19:25:44

---
title: 7 Reasons Why You Should Choose AWS as Your Cloud platform
published: true
date: 2021-01-28 13:21:05 UTC
tags: CloudComputing,DevOps,AmazonWebServices,awsdeveloper
canonical_url: https://www.botreetechnologies.com/blog/7-reasons-to-choose-aws-as-your-cloud-platform/
---

![AWS Cloud computing](https://www.botreetechnologies.com/blog/wp-content/uploads/2021/01/aws-cloud-consulting-.jpg)

Cloud computing is on the rise, and AWS is emerging as the clear winner. With more than 40% market share of the cloud service market, Amazon Web Services is the leader in the industry. It offers cloud-based storage, virtual storage, and 70 other services to enterprises for their digital needs.

COVID-19 has driven companies to explore cloud computing more than ever. Amazon cloud business solutions enable you to move your organization to virtual channels. [AWS cloud consulting](https://www.botreetechnologies.com/aws-devops-services) is becoming popular as enterprises look to analyze how going virtual with AWS will help them reap the benefits of digital technology.

This article will highlight the 7 reasons to choose AWS cloud services for your enterprise. While there are other platforms like Google Cloud, [DigitalOcean](https://www.botreetechnologies.com/digital-ocean-devops-services), Heroku, and more, we will see the AWS benefits that make it stand out in the industry.

###Read more: [Amazon AWS S3 - How to handle deprecated SSLv3 connectivity](https://www.botreetechnologies.com/blog/amazon-aws-s3-how-to-handle-deprecated-sslv3-connectivity/)

###7 Top Reasons to Consider AWS as Your Cloud Platform

AWS cloud management system now has over a million customers and generates $10 billion in annual revenue.  The platform is trusted by companies like Kellogs, Samsung, Unilever, Nokia, Netflix, Adobe, and most of the multinational giants.

Here are 7 reasons you should choose [Amazon Web Services](https://www.botreetechnologies.com/blog/amazon-s3-step-by-step-guide-to-enabling-versioning-of-uploaded-files-in-buckets/) as your cloud platform:- 

1. Location

One of the biggest AWS advantages is that it is available in 44 different zones in 16 geographical locations. You can access the servers from any country you want. By hiring an AWS developer, you can access all the features from wherever you are. There are no regional boundaries on utilizing the servers as well.

The post [7 Reasons to Choose AWS as Your Cloud Platform](https://www.botreetechnologies.com/blog/7-reasons-to-choose-aws-as-your-cloud-platform/) appeared first on [BoTree Technologies](https://www.botreetechnologies.com/blog).
Use git bisect to pinpoint a bug
Tags: git, java, maven
Published: 2021-02-24 12:16:31

---
title: Use git bisect to pinpoint a bug
published: true
date: 2021-01-28 13:15:09 UTC
tags: git, java, maven
canonical_url: https://maarten.mulders.it/2021/01/use-git-bisect-to-pinpoint-a-bug/
---

During my work on Maven today, I found a very specific bug. The error message wasn’t that clear, and I couldn’t make a guess what might’ve caused it. I read about `git bisect` a few times and figured that today, I would use that tool to find the bug.

---

[Continue reading...](https://maarten.mulders.it/2021/01/use-git-bisect-to-pinpoint-a-bug/)
How I can aggregate the generated json for postgresql in order to be able more easily to copy-paste it into pg-diff config
Tags: help, postgres
Published: 2021-01-28 13:09:20

As I asked upon:

https://dba.stackexchange.com/q/284165/118215

Using that query:

```
select 
        table_name::text as table_name ,
        json_build_object(
            'tableName'::text,table_name::text,
            'tableSchema'::text,table_schema::text,
            'tableKeyFields'::text,jsonb_agg(column_name::text)
        ) as table_info
    FROM 
        information_schema.columns
    WHERE 
        table_schema = 'public'
    group by 
        table_name,table_schema;
```

I managed to generate the json required for each table in order to place it into [pg-diff's](https://michaelsogos.github.io/pg-diff/) config.


But I want the results of the query's mentioned above to be aggrregated into a single string that is `\n,` seperated so I can easily copy-pasted it from my tool into pg-diff's config file: `pg-diff-config.json`.

Do you know how I can do that?
Using Parcel to create a React app
Tags: react, beginners, codenewbie, 100daysofcode
Published: 2021-01-28 13:07:37


[Parcel](https://parceljs.org) is a fast application bundler that allows you to create a more lean and lightweight setup of React (as well as other types of app) with zero configuration.  Over the last few months it has become my personal favourite method of creating a React app.  

Let's create a bare-bones "Hello, world!" app using Parcel. 


## Step 1) Create a new folder for your project
Yeah, probably able to do that bit yourself



## Step 2) Create a `package.json` file
In Terminal, `cd` into your new folder and run

```json
npm init -y
```

This will automatically create a new fresh `package.json` file.



## Step 3) Installing Parcel, React and ReactDOM
First let's install the Parcel bundler as a dev-dependancy.

```json
npm i -D parcel-bundler
```

and now install react, and react-dom.
```
npm i react react-dom
```



## Step 4) Adding a "start" script
Open the `package.json` file, and in the "scripts" section add the following "start" script.

```json
"start": "parcel index.html --open"
```



## Step 5) Create the initial `index.html` 
In your chosen text editor create a new file called `index.html` and create the standard HTML boilerplate.  

Now we need to add a couple of things.
1. A `div` where React will be inserted
2. A `script` which will act as the javaScript entry point

In the `body` of the `index.html`, add 

```html
<div id="root"></div>
<script src="./index.js"></script>
```

## Step 6) Create the `index.js` file
Now create the `index.js` so we can add React

```javascript
import React from 'react'
import { render } from 'react-dom'

render(<p>Hello, world!</p>, document.getElementById('root'))
```



## Step 7) Check everything works
From terminal run

```json
npm start
```

Yes, that is it. Parcel will now do its magic and you will be sat in front of a fully functional React app. 


## Next Steps

- Create a base component (`App.js` or similar), import it into `index.js` and replace the paragraph tags and 'Hello, world!' with your base component
- Have a read of the [parcel documentation](https://parceljs.org/getting_started.html) to understand how awesome Parcel is and what Parcel supports right out of the box.
Help us improve your job search!
Published: 2021-01-28 13:03:36

![
https://survey.alchemer.eu/s3/90305929/4c291a2b79ca
](https://dev-to-uploads.s3.amazonaws.com/i/638180tfo85rupmtboc7.png)

Look, whether you have a job or not, I think we can all agree that it’s a fr*cking frustrating experience finding a new role (especially one that’s better). 

You have to wade through incomplete job postings that don’t actually list requirements needed, or you may even take the time to send out custom letters only to get silently rejected on the other end without you knowing why. 

We want to fix this experience so we can be part of the solution and not the problem. Now, this doesn’t require turning tricks or writing up 100-page reports... 

All you have to do is take this short survey and share your opinion to help us identify your needs, problems, but also solutions. Simple as that! And I might add, there’s a **€100 Amazon Voucher** up for grabs if you do take the survey. 

{% twitter 1354685843718479872 %}


[<button name="button">Take survey</button>](https://survey.alchemer.eu/s3/90305929/4c291a2b79ca)
Daily Developer Jokes - Thursday, Jan 28, 2021
Tags: jokes, dailydeveloperjokes
Published: 2021-01-28 13:00:07

---
title: "Daily Developer Jokes - Thursday, Jan 28, 2021"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Thursday%2C%20Jan%2028%2C%202021"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259bf358c4.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Hey officer! How did the hackers escape?

___A:___ No idea. They just ransomware.
 -->
Plate Calculator
Tags: dohackathon, html, javascript
Published: 2021-01-10 21:27:23

## What I built

A simple plate calculator for the gym.

### Category Submission: 

_Program for the People_

### App Link

[Plate Calculator](https://platecalculator-k5jpa.ondigitalocean.app)

### Screenshots

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


### Description

Simple: Select your barbell. Add weights.
It then gives you the total in kilograms.
 

### Link to Source Code

[GitHub](https://github.com/akoepcke/plateCalculator)

### Permissive License

[MIT](https://choosealicense.com/licenses/mit/)

## Background

Lifting weights is, when done right, not only good for physical health, but also for mental health.
Wasting concentration and mental energy to calculate the total weight of barbell and plates, then checking and re-rechecking again, when I'm just glad I got to the gym and managed to grab a rack or bench, is, however, really annoying. 

There used to be a simple, and pretty, website, that did just this, but apparently it is not online anymore.

There is also a bunch of other web apps and smartphone apps, though I have not yet found one that works with kilograms, uses the plate sizes I have available, and also looks good to my eyes.

### How I built it 
The app is a simple static HTML page.
Styling is done with [TailwindCSS](https://tailwindcss.com).

Functionality is implemented with [Alpine.js](https://github.com/alpinejs/alpine/).

I've been using Alpine when it was first released and still in Beta. It has grown and changed quite a bit since then, and I was looking for a simple app to try it out again. Functionally, the plate calculator is not quite as boring as the typical ToDo-List, but not so complicated that I would need days to understand and implement it.

The GitHub repo has a shiny "Deploy to DigitalOcean"-Button, that really made deployment way too easy.

### Additional Resources/Info
[TailwindCSS](https://tailwindcss.com)
[Alpine.js](https://github.com/alpinejs/alpine/)